[R] nlminb() - how do I constrain the parameter vector properly?

Steven LeBlanc oreslag at gmail.com
Mon Oct 21 09:01:34 CEST 2013


On Oct 20, 2013, at 9:54 PM, Mark Leeds <markleeds2 at gmail.com> wrote:

> Bill: I didn't look at the code but I think the OP means that during the nlminb algorithm,
> the variance covariance parameters hit values such that the covariance matrix estimate becomes negative definite.

Yes, that is what I meant.

> 
> Again, I didn't look at the details but one way to deal with this is to have the likelihood
> function return -Inf whenever the covariance matrix becomes not positive definite. so, the
> likelihood should check for  positive definiteness first before it actually calculates anything.
> If PD is not true, the -Inf value should push nlminb towards values that obtain a positive definite matrix. But there could be something more subtle going on that I'm not understanding. I don't know even what algorithm nlminb is using ( probably quasi-newton ) but this is one thing the OP could try.

I tried this at your suggestion. nlminb() seems to hang at -Inf, but Inf works splendidly. Thanks much!



More information about the R-help mailing list