Ben Haller
2011-Feb-16 16:41 UTC
[R] error in optim, within polr(): "initial value in 'vmmin' is not finite"
Hi all. I'm just starting to explore ordinal multinomial regression. My dataset is 300,000 rows, with an outcome (ordinal factor from 1 to 9) and five independent variables (all continuous). My first stab at it was this: pomod <- polr(Npf ~ o_stddev + o_skewness + o_kurtosis + o_acl_1e + dispersal, rlc, Hess=TRUE) And that worked; I got a good model fit. However, a variety of other things that I've tried give me this error: Error in optim(s0, fmin, gmin, method = "BFGS", ...) : initial value in 'vmmin' is not finite This occurs, for example, when I try to use the method="probit" option of polr(). It also occurs when I try a regression involving interactions, such as: pomod <- polr(Npf ~ o_stddev * o_skewness * o_kurtosis * o_acl_1e * dispersal, rlc, Hess=TRUE) I have good reason to believe that interactions are important here, so I'd very much like to be able to fit such models. I have been doing that successfully with logistic regression (considering my outcome variable to be binary, either "1" or "2-9") using glm(), but now using polr() it gives me this error. I've searched Google and the R lists for information about this error, and while I did find a couple of other people asking about it, I didn't find any advice about what to do about it that I can apply to my situation. I'd be happy to share my dataset with anyone willing to help me on this, but 300,000 rows is a bit large to include in this email. :-> Thanks! Ben Haller McGill University
Ben Haller
2011-Feb-18 10:20 UTC
[R] error in optim, within polr(): "initial value in 'vmmin' is not finite"
An update for the benefit of the list/posterity: I resolved this issue by switching over to using the lrm() function of package rms. It seems to pick better starts, or something; in any case, it has been able to converge on a solution for every model I've tried, although for the most complex ones I needed to raise maxit (maximum iterations) above the default of 12 slightly. The lrm() function does not support interactions higher than third-order, and it does only logistic regressions, not probit or other types, so it does have its drawbacks; but it has solved my difficulties quite nicely. Just in case anybody cares. :-> Ben Haller McGill University On Feb 16, 2011, at 5:41 PM, Ben Haller wrote:> Hi all. I'm just starting to explore ordinal multinomial regression. My dataset is 300,000 rows, with an outcome (ordinal factor from 1 to 9) and five independent variables (all continuous). My first stab at it was this: > > pomod <- polr(Npf ~ o_stddev + o_skewness + o_kurtosis + o_acl_1e + dispersal, rlc, Hess=TRUE) > > And that worked; I got a good model fit. However, a variety of other things that I've tried give me this error: > > Error in optim(s0, fmin, gmin, method = "BFGS", ...) : > initial value in 'vmmin' is not finite > > This occurs, for example, when I try to use the method="probit" option of polr(). It also occurs when I try a regression involving interactions, such as: > > pomod <- polr(Npf ~ o_stddev * o_skewness * o_kurtosis * o_acl_1e * dispersal, rlc, Hess=TRUE) > > I have good reason to believe that interactions are important here, so I'd very much like to be able to fit such models. I have been doing that successfully with logistic regression (considering my outcome variable to be binary, either "1" or "2-9") using glm(), but now using polr() it gives me this error. I've searched Google and the R lists for information about this error, and while I did find a couple of other people asking about it, I didn't find any advice about what to do about it that I can apply to my situation. > > I'd be happy to share my dataset with anyone willing to help me on this, but 300,000 rows is a bit large to include in this email. :-> > > Thanks! > > Ben Haller > McGill University > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.