I resend the template and data files.<br>The originals I sent are wrong<br><br>Sorry for the inconvinience<br><br><br><div class="gmail_quote">On Tue, Nov 2, 2010 at 3:32 PM, Luis Ridao <span dir="ltr"><<a href="mailto:luridao@gmail.com">luridao@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br><br>Following Steve's approach I set a "nyrs_r" variable and made sure that the data dimensions agreed.<br>
I initially encountered plenty of errors (solved by removing the indexes in the data, e.g. C=elem_prod(elem_div(F,Z).....);<br>
instead of C=elem_prod(elem_div(F(1,nyrs),Z(1,nyrs)).......);) and although the compilation and building finally passed the checks<br>the running of the model failed:<br><br>Incompatible bounds in dvar_vector elem_prod(_CONST dvar_vector& v1,_CONST dvar_vector& v2)<br>
Process catage6109_rec_mod_ret exited abnormally with code 1<br><br>I guess it is a problem with the dimensions but I just can't see it.<br><br>Attached are the .tpl and .dat files.<br><br>Thanks in advance.<div><div>
</div><div class="h5"><br><br><div class="gmail_quote">
On Mon, Nov 1, 2010 at 5:41 PM, Steve Martell <span dir="ltr"><<a href="mailto:s.martell@fisheries.ubc.ca" target="_blank">s.martell@fisheries.ubc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">Luis,<div>There are many different ways to do this without having to create separate reduced data sets. </div><div><br></div><div>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:</div>
<div><br></div><div>DATA_SECTION</div><div><br></div><div> int_int retyrs;<span style="white-space: pre-wrap;"> </span>//number of retrospective years </div><div> int_int nyrs;<span style="white-space: pre-wrap;"> </span>//total number of years</div>
<div><br></div><div> //... read the rest of the data.</div><div><br></div><div> //... now modify the model dimensions at the end of the data section.</div><div> !! nyrs = nyrs - retyrs;</div><div><br></div><div>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:</div>
<div><br></div><div><span style="white-space: pre-wrap;"> </span>dvar_vector pred_ct(1,nyrs);</div><div><span style="white-space: pre-wrap;"> </span>resid = log(elem_div(obs_ct,pred_ct));</div><div><br></div><div><span style="white-space: pre-wrap;"> </span>//should be:</div>
<div><span style="white-space: pre-wrap;"> </span>resid = log(elem_div(obs_ct(1,nyrs),pred_ct(1,nyrs)));</div><div><br></div><div>Steve</div><div><br></div><div><br><div><div><div></div><div><div>On 2010-11-01, at 9:45 AM, Luis Ridao wrote:</div>
<br></div></div><blockquote type="cite"><div><div></div><div>ADMB-help,<br><br>I was wondering how to implement a retrospective analysis of a given catch-at-age model.<br>The straightforward but also the slowest approach might be to shorten the data file and adjust<br>
the parameter section accordingly but I guess there must be a way to get around this<br>
(maybe some shell scripting?)<br><br>Is there anyone out there who has faced a similar issue?<br><br>Thanks in advance,<br>Luis<br><br></div></div>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@admb-project.org" target="_blank">Users@admb-project.org</a><br><a href="http://lists.admb-project.org/mailman/listinfo/users" target="_blank">http://lists.admb-project.org/mailman/listinfo/users</a><br>
</blockquote></div><font color="#888888"><br><div>
<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
Steve Martell</div><div><a href="mailto:s.martell@fisheries.ubc.ca" target="_blank">s.martell@fisheries.ubc.ca</a></div><div><br></div></span><br>
</div>
<br></font></div></div></blockquote></div><br>
</div></div></blockquote></div><br>