Edoardo Airoldi wrote:
hi all,
 I am using optim.  I am getting the following error message:

Error in optim(par = start.vals[, h], fn = post.func.pois, gr = post.grad.
pois, :
L-BFGS-B needs finite values of fn


If I look at optim typing '> optim' it seems that the error comes from inside .Internal(optim), so I wonder how can I see the code for .Internal(
optim)?


thanks
Edo




Actually, the error means that your function (post.func.pois) is returning a infinite value. I usually put print statements in to see where this is happening. As in,


post.func.pois = function(par, ...) {
...
print(par)
print(some.operation(par)) # etc.
...
return(value) # if this is Inf, optim will stop
}

If you really think you need to see the optim source code, you can downdload the source from cran and look for optim.c.

Regards,
Sundar

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to