[ADMB Users] Compile Problem

James R. Bence bence at msu.edu
Wed Aug 31 20:45:10 PDT 2011


Justin

The problem is that you are defined the h matrix as constant matrix (no 
derivative information) when you created it in the data section.  When you 
attempted to assign values in it to equal values of a parameter the 
complaint occurs.  Basically you are not supposed to let variables created 
in the data section depend upon parameters, which is what you are 
doing.  You really do not want to be doing this even if it were allowed 
because presumably you are putting the parameters into your matrix so you 
can use your matrix in calculations of your objective function, and admb 
needs the derivative information in order to use its search approach for 
the minimum.  Basic rule.  If a variable changes when the parameter values 
change it should be defined in the parameter section and not the data section.

Solution is easy.  Define h_f in the parameter section just by moving the 
line of code you now define it with from the data section.

Jim

At 08:05 PM 8/31/2011, Justin Carney wrote:
>Hi,
>
>I am getting a g++ error message when trying to compile my ADMB code. I 
>get an error saying it cannot convert 'param_init_bounded_number' to 'double'
>The simplified version of the code causing the error message is
>
>for (int i=1;i<=25;i++)
>{for (int j=1;j<=90;j++)
>{if (i<=11)
>{h_f(j,i)=b96}}}
>
>In the data section I have a dummy matrix for h_f
>
>matrix h_f(1,90,1,25)
>
>And in the parameter sections I have b96 as a bounded number with the 
>initial value of 0.82 being read in from the starting estimate file.
>
>init_bounded_number b96(0,1)
>
>Does anyone know why I might be getting this error message?
>
>Thanks,
>
>Justin
>_______________________________________________
>Users mailing list
>Users at admb-project.org
>http://lists.admb-project.org/mailman/listinfo/users

Jim Bence
Dept. of Fisheries and Wildlife
Michigan State University
http://www.msu.edu/user/bence/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110831/a64d1769/attachment.html>


More information about the Users mailing list