Skip to content

NA return to NLM routine

1 message · Berend Hasselman

#
On 30-11-2012, at 23:55, Mac Gaulin wrote:

            
if you do 

a <- NA
str(a)

you'll see that a is a logical. And that is an invalid value for the function to return.
When you do things such as NA+0 or -NA you get a numeric value NA and that is a non-finite value which is why you get the warning..

Instead of NA you could return something like .Machine$double.xmax .
Or use constrOptim as advised.

Berend