[R] optim gets stuck

Prof Brian D Ripley ripley at stats.ox.ac.uk
Fri Jul 28 18:07:52 CEST 2000

On Fri, 28 Jul 2000, Marcel Wolbers wrote:

> Dear all
> I'm having some trouble with a bound-constrained optimization using
> optim(...,method="L-BFGS-B"). 
> Usually, everything works fine, but for some simulations, the algorithm just 
> gets stuck. 
> When I let my function (+gradient) evaluation print out the
> function value, I see that L-BFGS-B keeps calling the function with 
> arguments giving the same function value (up to at least the accuracy 
> required by factr, i.e. 1E-8). So, I don't really understand 
> why it doesn't stop. 
> Is this a well-known problem?

No. It is pretty well-tested PD code for the problem.  Have you scaled 
sensibly?  If you are not supplying derivatives, either do so or
lower the tolerances.

> The main problem is that the optimization doesn't stop (at least not
> in reasonable time) and so the whole simulation gets stuck. Is there a way 
> to control the time used by "L-BFGS-B" better than with setting maxiter? 
> (For example setting an upper limit to the number of function and gradient 
> calls would be nice...)

Yes, it would be nice.  The authors did not provide it though, so if you
have the patience a patch would be gratefully received.

> Sorry, I can't give a reproducable example. The code that produces the
> problem is not very handy to attach to the mail (it calls C code...).

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list