Hi Motoki,<div><br></div><div>While I haven't looked into the details of your model yet, and I definitely don't claim to be an ADMB expert, I have experienced this issue in a range of model types and simulated data. In the types of models I work with, I found that this occurs most often when ADMB is searching for optimal values of SD parameters and random effect terms, which I always put in a second phase of optimization. I find that ADMB sometimes attempts to use very large random effect terms. By "large", I mean that if I have simulated and modeled a survival percentage as s = exp(beta+epsilon)/(1+exp(beta+epsilon)), where epsilon~N(0,sd=.1), I get the "inner maxg=0" infinite loop while ADMB is trying RE terms that gradually grow from the order of 1e-2 to 1e3 and beyond (and thus the penalty term for the REs becomes -infinity on the log scale), until I force it to quit.</div>
<div><br></div><div>I have a solution that appears to be successful in most such situations, although I'm not advocating it as the best solution. I impose an additional penalty on the random effect terms: before finishing the likelihood function by multiplying by negative one, I subtract the sum of squared random effect terms, multiplied by a scaling factor that is determined by trial-and-error. Such as:</div>
<div><br></div><div>epssum=0;</div><div>for(i=0;i<n;i++){</div><div>epssum = epsum + epsilon[i]*epsilon[i]</div><div>}</div><div><br></div><div>totL -= epssum*REmultiplier</div><div><br></div><div>(where totL is the log-likelihood). I use REmultiplier values between 10 and 500, depending on the variability I have simulated in my data.</div>
<div><br></div><div>I've found from a large series of simulations that my fixed effect parameters are still estimated successfully, and there may be some evidence that SD terms are underestimated (which wouldn't be surprising), but for now, this is preferable to complete failure of model fit. This evidence of SD parameter estimation is not conclusive, due to a variety of other factors particular to the models I am studying. For real data, I probably wouldn't advocate this, except possibly as a last resort, but for simulations, I have found it very helpful.</div>
<div><br></div><div>I have also found some success by using the -noinit option, and by employing the (unsupported-but-still-present) data type random_effects_bounded_vector.</div><div><br></div><div>Finally, if you're running a large series of simulations, and are looking for a way to check for this infinite loop, I simply output the AMDB results window to a text file (individually for each simulation), and I have a batch file that runs on an infinite loop, periodically checking the file size of that temporary file, If the text file gets too large (again, subjective, based on experience with this problem), the batch file then kills the running process, and starts the next simulation. It's not pretty, but it works for me.</div>
<div><br></div><div>Hopefully someone can respond with some more details about what is actually going on with ADMB, rather than the pieced-together solution that I have concocted.</div><div><br></div><div><br></div><div>
<br>
</div><div><br></div><div>Chris</div><div><br></div><div><br clear="all"><br>-----------------------------<br>Chris Gast<br><a href="mailto:cmgast@gmail.com" target="_blank">cmgast@gmail.com</a><br>
<br><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 10:02 AM, Motoki Wu <span dir="ltr"><<a href="mailto:apewu@u.washington.edu" target="_blank">apewu@u.washington.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi ADMBeings,<br>
<br>
>From simulated data, I am trying to estimate a delay-difference model<br>
with a Beverton-Holt stock recruitment curve with process error on the<br>
recruitment. Many times when my catch exceeds the biomass the inner<br>
gradient becomes 0 and loops indefinitely.<br>
<br>
I know this has been somewhat dealt with before, but I was wondering<br>
if the infinite loop is something intentional. I fully concede that my<br>
model could be wrong, but the current situation makes it difficult to<br>
test the code for a wide-ranging set of inputs w/o the need for manual<br>
intrusion.<br>
<a href="http://groups.google.com/group/admb-users/browse_thread/thread/b06eeb8a991f17e9" target="_blank">http://groups.google.com/group/admb-users/browse_thread/thread/b06eeb8a991f17e9</a><br>
<br>
I've archived a specific instance at:<br>
<a href="http://students.washington.edu/apewu/compare/" target="_blank">http://students.washington.edu/apewu/compare/</a><br>
"simulate6_RE_h05b" for the infinite loop<br>
"simulate6_RE_h07" for something that works<br>
<br>
Thanks<br>
<font color="#888888"><br>
Motoki Wu<br>
Quantitative Ecology & Resource Management<br>
University of Washington, Seattle<br>
_______________________________________________<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>
</font></blockquote></div><br></div>