[ADMB Users] a conditional statement under PARAMETER_SECTION

Saang-Yoon shyunuw at gmail.com
Sat Mar 19 12:14:33 PDT 2011


Hello, Steve.
Thank you very much for your prompt response, which is helpful.  By
the way, the conditional statement in your example is used below
"init_bounded_matrix_vector sel_par".   Now if we want to ignore the
parameter vector, "sel_par" by an option, then we may want to put the
parameter declaration ("init_bounded_matrix_vector sel_par") under the
optional statement, which would lead to a compile/link error.  I
wonder about how you or others get around in "one" TPL file.  Again
thank you.
Saang-Yoon


On Mar 19, 2:35 pm, Steve Martell <s.mart... at fisheries.ubc.ca> wrote:
> Sanng-Yoon,
>
> Statements such as this work fine for me in the PARAMETER_SECTION
>
>         //Selectivity parameters (A very complicated ragged array)
>         init_bounded_matrix_vector sel_par(1,ngear,1,jsel_npar,1,isel_npar,-5.,5.,sel_phz);
>         LOC_CALCS
>                 //initial values for logistic selectivity parameters
>                 //set phase to -1 for fixed selectivity.
>                 for(int k=1;k<=ngear;k++)
>                 {
>                         if( isel_type(k)==1 || isel_type(k)==6 )
>                         {
>                                 sel_par(k,1,1) = log(ahat(k));
>                                 sel_par(k,1,2) = log(ghat(k));
>                         }
>                 }
>         END_CALCS
>
> On 2011-03-19, at 11:31 AM, Saang-Yoon wrote:
>
> > Hi, all.
> > Whenever I put a conditional statement (e.g., if - else) under
> > PARAMETER_SECTION, I run into an error.   I wonder whether ADMB is
> > designed not to allow a conditional statement under PARAMETER_SECTION
> > ever.  Sometimes I need to consider or ignore a parameter, depending
> > on a model assumption.  If you were, how would you get around in
> > ADMB?   Temporarily I make two TPL files (e.g., two EXE files) by the
> > assumption.  But I suspect some of you may get around in "one" TPL
> > file (i.e., "one" EXE file).
> > Saang-Yoon
> > _______________________________________________
> > Users mailing list
> > Us... at admb-project.org
> >http://lists.admb-project.org/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Us... at admb-project.orghttp://lists.admb-project.org/mailman/listinfo/users



More information about the Users mailing list