Wouter
Wouter

Reputation: 81

R: Error with polr(): initial value in 'vmmin' is not finite

I'm trying to estimate an ordered probit model using polr: polr(Rating ~ Currac + Debt + Inflation + GDPpc + GDPgr + Ratio + Levelofdev + Eurozone + Default, method ="probit")

where Rating is an ordered discrete dependent variable and the independent variables are a set of economic determinants (e.g. inflation rate).

However, I keep getting the same error:

Error in optim(s0, fmin, gmin, method = "BFGS", ...) : initial value in 'vmmin' is not finite

I found it in the C code (src/main/optim.c), at line 523 in the procedure vmmin. An error is thrown because the result of function fminfn is not finite. In this function fminfn, at line 82, the result is calculated as result = REAL(s)[0]/(OS->fnscale). This does not make much sense to me, however.

I understood it should have something to do with a function evaluating at an infinite value at the starting values. I was hoping someone could explain this in more detail, or help me overcome the problem.

Exluding/omitting NA-values from the dataset does not resolve the problem. However, when I delete either Inflation or GDPpc from the set of regressors, it suddenly works fine. And when I delete everything else but keep both Inflation and GDPpc, it also still works.

If you have experienced the same problem or might know how to deal with this, I would be really grateful for your response.

Thanks a lot,

Wouter

Upvotes: 8

Views: 5848

Answers (2)

D A Wells
D A Wells

Reputation: 1157

Change the start parameters

As jrdnmdhl points out in the comments, this could be because of poor initial values. These are the first guess of the coefficients and intercepts. If they're not a good guess it's harder to get accurate answers, hence the error.

You can make your own guess and add them to the start argument.

An example

I had a simple model m1 which worked and a more complicated model which didn't m2. I took the coefficients and intercept estimated successfully in the m1 and used them for m2 because these should be close to the "correct" values. For the extra terms of the complex model I used zero as a first guess (but it could have been anything).

m1 <- polr(y ~ a, data = example)

Get the simple model coefficients (m1$coefficients) and intercepts (m1$zeta). Put a zero at the end of the coefficients for any new regression parameters in the complex model. In my case there's just one, b.

myGuess <- c(m1$coefficients, 0, m1$zeta)

Use this new vector as a start argument.

m2 <- polr(y ~ a+b, data = example, start = myGuess)

If zero doesn't work try your own best guess for the regression coefficient.

Upvotes: 1

Annabelle
Annabelle

Reputation: 23

I encountered a very similar issue when using polr() for ordered logistic regression. I was able get the algorithm to converge using the orm function in the rms package https://www.rdocumentation.org/packages/rms/versions/6.0-1/topics/orm

Still worth investigating how the distribution of Inflation and GDPpc differs from each of the other independent variables in your model across Rating.

Upvotes: 1

Related Questions