Skip to content
Prev 312608 / 398506 Next

NA return to NLM routine

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
Message-ID: <1419E517-AF15-410D-9388-87A906CB11D7@xs4all.nl>
In-Reply-To: <CAJfZegmnAv6eHySxV3MPnWYqbnCj7aEFydAkCmtu+Zi57=gvCw@mail.gmail.com>