[ADMB Users] a conditional statement under PARAMETER_SECTION

Steve Martell s.martell at fisheries.ubc.ca
Sat Mar 19 11:35:45 PDT 2011


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
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users




More information about the Users mailing list