[ADMB Users] spline smoother on selectivity (shorter version)

Luis Ridao luridao at gmail.com
Tue Mar 8 07:31:00 PST 2011


ADMB-help,

Following suggestions proposed to my initial request I have modified the code:

DATA_SECTION
....
  init_vector LO(1,nNodes)// SPLINES
  init_vector HI(1,nNodes)
  init_ivector PH(1,nNodes)
  init_vector parm(1,2)

PARAMETER_SECTION
.....
  init_bounded_number_vector log_sel1(1,nNodes,LO,HI,PH)		// SPLINES
  init_bounded_number_vector log_sel2(1,nNodes,LO,HI,PH)		// SPLINES
  init_bounded_number_vector log_sel3(1,nNodes,LO,HI,PH)		// SPLINES
  vector predSel1(1,nages)	// SPLINES
  vector predSel2(1,nages)	// SPLINES
  vector predSel3(1,nages)	// SPLINES

On Tue, Mar 1, 2011 at 12:54 PM, Luis Ridao <luridao at gmail.com> wrote:
> ADMB-help,
>
> Following Dave's suggestion on implementing a spline smoother
> on selectivity (in a separable catch-at-age model) I managed to
> do something like:
>
> PARAMETER_SECTION
>   init_vector log_sel1(1,nNodes)        // nNodes = 5 -> (1,2,3,4,5)
>   init_vector log_sel2(1,nNodes)        // nages = 12 ->
> (1,2,3,4,5,6,7,8,9,10,11,12)
>   sdreport_vector predSel1(1,nages)
>   sdreport_vector predSel2(1,nages)
>
> for (i=1;i<=nyrs;i++)
>   {
>   if (i<=36)
>   {
>     vcubic_spline_function qs(nodes,log_sel1);   // SPLINES
>     predSel1=qs(ages);
>
>   }
>   else
>  ......
>
> for(i=1;i<=nyrs;i++)
>   {
>   if (i<=36)
>   {
>   F(i)=mfexp(log_fy(i))*mfexp(predSel1);
>   }
>   else
>   .........
>
> The program compiles and runs without problems but when the number of
> "nodes"
> are changed to another amount (e.g. 6) ADMB complains about Hessian:
>
> "Warning -- Hessian does not appear to be positive definite
> Hessian does not appear to be positive definite"
>
> The model template and data files  are attached
>
> Thanks in advance
>
>
>



More information about the Users mailing list