[ADMB Users] Retrospective analysis

Steve Martell s.martell at fisheries.ubc.ca
Mon Nov 1 10:41:16 PDT 2010


Luis,
There are many different ways to do this without having to create separate reduced data sets.  

One approach would be to include the number of retrospective years at the top of the data file,  and read this along with all the other data.  Then at the very botttom of the data section (after all of the data has been read in), modify your model dimensions by the number of retrospective years. For example:

DATA_SECTION

  int_int retyrs;		//number of retrospective years 
  int_int nyrs;		//total number of years

  //... read the rest of the data.

  //... now modify the model dimensions at the end of the data section.
  !! nyrs = nyrs - retyrs;

Note that you'll have to make sure your calculations in the PROCEDURE_SECTION etc. that are based on the data have the correct dimensions if retyrs > 0.  For example, you'll have to be explicit in calculating residuals:

	dvar_vector pred_ct(1,nyrs);
	resid = log(elem_div(obs_ct,pred_ct));

	//should be:
	resid = log(elem_div(obs_ct(1,nyrs),pred_ct(1,nyrs)));

Steve


On 2010-11-01, at 9:45 AM, Luis Ridao wrote:

> ADMB-help,
> 
> I was wondering how to implement a retrospective analysis of a given catch-at-age model.
> The straightforward but also the slowest approach might be to shorten the data file and adjust
> the parameter section accordingly but I guess there must be a way to get around this
> (maybe some shell scripting?)
> 
> Is there anyone out there who has faced a similar issue?
> 
> Thanks in advance,
> Luis
> 
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users

Steve Martell
s.martell at fisheries.ubc.ca



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20101101/c3c8c2d8/attachment.html>


More information about the Users mailing list