Luis Ridao
unread,Dec 7, 2010, 8:25:44 AM12/7/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to us...@admb-project.org
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