Re: [R] nlminb supplying NaN parameters to objective function

2015-05-08 Thread Jean Marchal
Prof. Nash, awesome! This sounds promising. Thank you for the explanation, Jean 2015-05-08 14:16 GMT-07:00 Prof J C Nash (U30A) : > 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

[R] nlminb supplying NaN parameters to objective function

2015-05-08 Thread Prof J C Nash (U30A)
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 > Warning messages: > 1: In dnbinom(x = dummyData[, "Y"], mu = mu, size = param

Re: [R] nlminb supplying NaN parameters to objective function

2015-05-07 Thread Jean Marchal
Thanks for the advice! I will continue to monitor the optimizer behaviour. Jean 2015-05-07 17:03 GMT-07:00 William Dunlap : > Your immediate problem may be solved, but the exact value of that limiting > value > affects the parameter estimates a fair bit. I have not really looked at > your functi

Re: [R] nlminb supplying NaN parameters to objective function

2015-05-07 Thread William Dunlap
Your immediate problem may be solved, but the exact value of that limiting value affects the parameter estimates a fair bit. I have not really looked at your function, but the ledge around it puts a kink (discontinuous first derivative) into it, which can mess up optimizers. Bill Dunlap TIBCO Sof

Re: [R] nlminb supplying NaN parameters to objective function

2015-05-07 Thread Jean Marchal
Yes, indeed! Problem solved! Thanks a lot! Jean 2015-05-07 14:06 GMT-07:00 William Dunlap : > Your nLL function returns 1e+308 in near-boundary cases. Since 1e+308 is so > close to machine infinity, it is easy to get into Inf-Inf (=NaN) or Inf/Inf > (=NaN) > situations when working with it. Tr

Re: [R] nlminb supplying NaN parameters to objective function

2015-05-07 Thread William Dunlap
Your nLL function returns 1e+308 in near-boundary cases. Since 1e+308 is so close to machine infinity, it is easy to get into Inf-Inf (=NaN) or Inf/Inf (=NaN) situations when working with it. Try making that limiting value something smaller, like 1e+30, and you may have better luck. Bill Dunlap

Re: [R] nlminb supplying NaN parameters to objective function

2015-05-07 Thread Jean Marchal
A follow-up to my yesterday's email. I was able to make a reproducible example. All you will have to do is load the .RData file that you can download here: https://drive.google.com/file/d/0B0DKwRjF11x4dG1uRWhwb1pfQ2s/view?usp=sharing and run this line of code: nlminb(start=sv, objective = nLL, l

[R] nlminb supplying NaN parameters to objective function

2015-05-06 Thread Jean Marchal
Dear list, I am doing some maximum likelihood estimation using nlminb() with box-constraints to ensure that all parameters are positive. However, nlminb() is behaving strangely and seems to supply NaN as parameters to my objective function (confirmed using browser()) and output the following: $pa