[ADMB Users] Retrospective analysis
Luis Ridao
luridao at gmail.com
Tue Nov 2 08:46:20 PDT 2010
I resend the template and data files.
The originals I sent are wrong
Sorry for the inconvinience
On Tue, Nov 2, 2010 at 3:32 PM, Luis Ridao <luridao at gmail.com> wrote:
> Hi,
>
> Following Steve's approach I set a "nyrs_r" variable and made sure that the
> data dimensions agreed.
> I initially encountered plenty of errors (solved by removing the indexes in
> the data, e.g. C=elem_prod(elem_div(F,Z).....);
> instead of C=elem_prod(elem_div(F(1,nyrs),Z(1,nyrs)).......);) and
> although the compilation and building finally passed the checks
> the running of the model failed:
>
> Incompatible bounds in dvar_vector elem_prod(_CONST dvar_vector& v1,_CONST
> dvar_vector& v2)
> Process catage6109_rec_mod_ret exited abnormally with code 1
>
> I guess it is a problem with the dimensions but I just can't see it.
>
> Attached are the .tpl and .dat files.
>
> Thanks in advance.
>
>
> On Mon, Nov 1, 2010 at 5:41 PM, Steve Martell <s.martell at fisheries.ubc.ca>wrote:
>
>> 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/20101102/4f657177/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: catage6109_rec_mod_ret.tpl
Type: application/octet-stream
Size: 12326 bytes
Desc: not available
URL: <http://lists.admb-project.org/pipermail/users/attachments/20101102/4f657177/attachment.obj>
More information about the Users
mailing list