Skip to content
Prev 350772 / 398502 Next

nlminb supplying NaN parameters to objective function

Your problem is saying (on my machine) that it cannot compute the
gradient. Since it does this numerically, my guess is that the step to
evaluate the gradient violates the bounds and we get log(-something).

I also get
I put lower=0.01 and got convergence OK, but that may not be suitable,
since all but one of the parameters are at that bound.
As it turns out, Duncan Murdoch, Ben Bolker and I had a meeting
yesterday to discuss improvements in optimization and nonlinear least
squares and derivatives. One suggestion to be implemented is a wrapper
for objective functions to reveal when bounds are violated. It will,
however, take a little time for me to get that organized.

FYI, without the reproducible example, you would not have received this
attempt to explain things. Thanks.

JN