<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>I'm just starting to use ADMB, and am interested in running a something like a changepoint model. I am running into problems trying to use a parameter, to be estimated, in a conditional statement. When estimating the negative log likelihood I have code that looks like this:<br>
<br> if(useNB==1){<br> for(int n=1;n<=nobs;n++){ <br><br> <b>if(yrKey(n)<cp)</b>{<br> mu_hat(n)=f0+<b>rS1</b>(siteKey(n))+(f1+rSs(siteKey(n)))*Cyear(n)+rY(yrKey(n)); <br> }<br> else { <br>
mu_hat(n)=f0+<b>rS2</b>(siteKey(n))+(f1+rSs(siteKey(n)))*Cyear(n)+rY(yrKey(n)); <br> }<br> NB_mu(n)=mfexp(mu_hat(n)); <br> <br> nll += -log_negbinomial_density((catch(n)),(NB_mu(n)),(1+((NB_mu(n))/s)));<br>
}<br> }<br><br><br></div>where cp is my changepoint parameter (intended to estimate a single year in the series), bounded between 0 and max(year index), with an initial value of 30 (max year index = 50). The point of this is to allow the random site parameter to be estimated separately for the period before the changepoint and after it.<br>
<br></div>The error that I receive is as follows: <br>error: no match for 'operator<' in '((df1b2_parameters*)this)->df1b2_parameters::<anonymous>.df1b2_pre_parameters::<anonymous>.model_parameters::<anonymous>.model_data::yrKey.ivector::operator()(n) < ((df1b2_parameters*)this)->df1b2_parameters::cp'<br>
<br></div>Is this possible to do in this program? Thank you in advance for any thoughts on how to execute this.<br><br></div>Kindly,<br></div>Tiffany<br></div>