Skip to content
Prev 106441 / 398513 Next

Problems with Optimization

On Wed, 20 Dec 2006, Tobias wrote:

            
Function 'fn' can return 'NA' or 'Inf' if the function cannot be
      evaluated at the supplied value, but the initial value must have a
      computable finite value of 'fn'. (Except for method '"L-BFGS-B"'
      where the values should always be finite.)

so you are not being fair to the R developers (who were kind enough to 
both implement and document this).
Given that the underlying algorithms are in C not R, this is what 
returning NA asks them to do.
In the documented way, returning NA.