[ADMB Users] Circumventing a type mismatch

Fowler, Mark Mark.Fowler at dfo-mpo.gc.ca
Wed Dec 7 10:41:37 PST 2011


Steve and Larry, Thank you. The value() function solves the problem of
capturing a dif var in a regular matrix. I realize now I've seen this
function before (probably your course, Steve). Too bad I can't make it
work in the other direction. I wanted the option to replace some ogive
parameters dependent on other ogive parameters in the preliminary calcs
section (but others not). Have to type single value assignments to
accomplish this. But serves me right for forgetting value().
 

		Mark Fowler 
		Population Ecology Division 
		Bedford Inst of Oceanography 
		Dept Fisheries & Oceans 
		Dartmouth NS Canada 
		B2Y 4A2 
		Tel. (902) 426-3529 
		Fax (902) 426-9710 
		Email Mark.Fowler at dfo-mpo.gc.ca 
		Home Tel. (902) 461-0708 
		Home Email mark.fowler at ns.sympatico.ca 

 

________________________________

From: Steve Martell [mailto:martell.steve at gmail.com] 
Sent: December 7, 2011 2:09 PM
To: Fowler, Mark
Cc: users at admb-project.org
Subject: Re: [ADMB Users] Circumventing a type mismatch


Mark,  

Based on the definitions of the variables you have defined in the
DATA_SECTION and PARAMETER_SECTIONS, it appears that your trying to
overwrite data-type variables with values from the differentiable
variables.  I would try in the PRELIMINARY_CALCS_SECTION or procedure
section:

now_values=value(par_values);

the value function will allow you to overwirte a Data type variable with
the values from the dvar_matrix.

Steve
On 2011-12-07, at 9:37 AM, Fowler, Mark wrote:


	I'm looking for a convenient way to bypass a type mismatch in
data objects. I know go-arounds for this but they require lots of
typing, I'm hoping for a simple translation syntax solution, or maybe a
format definition I haven't come across.

	Example 

	Define a matrix in the DATA_SECTION 

	   matrix now_values(1,n_values,1,2) 

	Define another matrix in the PARAMETER_SECTION (so type dvar) 

	  matrix par_values(1,n_values,1,2) 

	Capture or create values of par_values in
PRELIMINARY_CALCS_SECTION. Something like 

	now_values=justgimmethecurrentnumbers(par_values); 

	Or 

	par_values=dvarwannabe(now_values); 

	Seeking a simple way to keep track of associated initial and
fitted values in outputs, or alternatively pass computed initial values
from a suite of choices to a parameter object. Inspired by hordes of
ogives.

			Mark Fowler 
			Population Ecology Division 
			Bedford Inst of Oceanography 
			Dept Fisheries & Oceans 
			Dartmouth NS Canada 
			B2Y 4A2 
			Tel. (902) 426-3529 
			Fax (902) 426-9710 
			Email Mark.Fowler at dfo-mpo.gc.ca 
			Home Tel. (902) 461-0708 
			Home Email mark.fowler at ns.sympatico.ca 


	_______________________________________________
	Users mailing list
	Users at admb-project.org
	http://lists.admb-project.org/mailman/listinfo/users
	




A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and tequila....



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20111207/92ea4cb1/attachment.html>


More information about the Users mailing list