[R] Error in optim(p, fun,...)

Prof Brian D Ripley ripley at stats.ox.ac.uk
Tue Sep 25 20:13:01 CEST 2001


On Tue, 25 Sep 2001, Tony Long wrote:

> All:
>
> 	I am getting an error code from the optimization function.  The code is
>
> Error in optim(p,fun.LLike, lower=low, upper = up, method = "L-BFGS-B", :
>           non-finite finite-difference value [0]
>
> If I add a trace=6 option to my control list the last message before
> this error is:
>           At X0, 0 variables are exactly at the bounds
>
> Any ideas on where I should start would be appreciated.  Tony

It means that in computing derivatives by finite differencing, one
of the values is NA, +Inf or -Inf.  Put some print values in
your objective function and find out why it is giving a non-finite value.

It's not an error in optim: it is supposed to work that way.

-- 
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