[ADMB Users] indexing with a 3-years-lag
Luis Ridao
luridao at gmail.com
Tue Dec 7 05:25:44 PST 2010
ADMB-users,
I'm having problems to fit a ssb-rec Ricker curve.
The problem is with the rec array indexing.
Recruitment strength is measured at age 3 so what I do is to create
two extras arrays holding the ssb-rec pairs with a 3-yrs lag.
I thought this solution would make it easier but I get the following
error:
LRC $ ./catage6109_rec_mod_surv_ric
ok to here
Incompatible bounds in dvar_vector& dvar_vector::operator = (_CONST
dvar_vector& t)
Snipet of the tpl file:
nyrs=49
.......................
sdreport_vector ssb(1,nyrs)
sdreport_vector ssb_m3(1,nyrs-3) // SAME AS SSB with dimension (1,46)
sdreport_vector rec(1,nyrs)
sdreport_vector rec_m3(1,nyrs-3) // SAME AS REC with dimension (1,46)
sdreport_vector pred_rec(1,nyrs)
sdreport_vector pred_rec_m3(1,nyrs-3) // SAME AS PRED_REC with
dimension (1,46)
.........................
FUNCTION ssb_rec_ricker
ssb=rowsum(elem_prod(elem_prod(N,weight_at_age),mat_at_age))/1000;
ssb_m3=ssb.sub(1,46);
rec=column(N,1)/1000;
cout<<"ok to here"<<endl; // HERE IS THE
rec_m3=rec.sub(3,49); // PROBLEM
for (int i=1;i<=nyrs-3;i++)
{
pred_rec_m3(i)=exp(log_alfa)*ssb_m3(i)*exp(-exp(log_beta)*ssb_m3(i));
}
............................
The valid index for rec is (1,49)
Why can't I subset it to (3,49)?
Thanks in advance,
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20101207/d3a5cec0/attachment.html>
More information about the Users
mailing list