[ADMB Users] inner maxg = 0 infinite loop in ADMB-RE

Chris Gast cmgast at gmail.com
Thu Dec 23 09:46:04 PST 2010

Hi Motoki,

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.

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:

epssum = epsum + epsilon[i]*epsilon[i]

totL -= epssum*REmultiplier

(where totL is the log-likelihood). I use REmultiplier values between 10 and
500, depending on the variability I have simulated in my data.

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.

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.

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.

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


Chris Gast
cmgast at gmail.com

On Wed, Dec 22, 2010 at 10:02 AM, Motoki Wu <apewu at u.washington.edu> wrote:

> Hi ADMBeings,
> From simulated data, I am trying to estimate a delay-difference model
> with a Beverton-Holt stock recruitment curve with process error on the
> recruitment. Many times when my catch exceeds the biomass the inner
> gradient becomes 0 and loops indefinitely.
> I know this has been somewhat dealt with before, but I was wondering
> if the infinite loop is something intentional. I fully concede that my
> model could be wrong, but the current situation makes it difficult to
> test the code for a wide-ranging set of inputs w/o the need for manual
> intrusion.
> http://groups.google.com/group/admb-users/browse_thread/thread/b06eeb8a991f17e9
> I've archived a specific instance at:
> http://students.washington.edu/apewu/compare/
> "simulate6_RE_h05b" for the infinite loop
> "simulate6_RE_h07" for something that works
> Thanks
> Motoki Wu
> Quantitative Ecology & Resource Management
> University of Washington, Seattle
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20101223/01c82f31/attachment.html>

More information about the Users mailing list