yoo
yoo

Reputation: 491

lme4 "optimizer (nloptwrap) convergence code: 0 (OK)" but no convergence warning

I ran multilevel model using lme4 package, and results was like this:

Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: y ~ 1 + con + ev1 + ev2 + ev1:con + ev2:con + (1 | pid)
   Data: dat_ind

REML criterion at convergence: 341.3

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.5811 -0.6757  0.0088  0.7251  1.9435 

Random effects:
 Groups   Name        Variance Std.Dev.
 pid      (Intercept)  0.00    0.000   
 Residual             15.47    3.933   
Number of obs: 60, groups:  pid, 30

Fixed effects:
             Estimate Std. Error        df t value Pr(>|t|)    
(Intercept) -3.078944   0.575915 54.000000  -5.346 1.86e-06 ***
con          0.293982   0.026027 54.000000  11.295 7.71e-16 ***
ev1         -1.118278   0.836885 54.000000  -1.336    0.187    
ev2         13.608356   0.716009 54.000000  19.006  < 2e-16 ***
con:ev1     -0.001739   0.037749 54.000000  -0.046    0.963    
con:ev2      0.031400   0.032062 54.000000   0.979    0.332    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
        (Intr) con    ev1    ev2    con:v1
con     -0.143                            
ev1      0.077  0.071                     
ev2     -0.365  0.257 -0.364              
con:ev1  0.071  0.071 -0.087 -0.155       
con:ev2  0.259 -0.392 -0.156  0.022 -0.348
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see ?isSingular

what is "optimizer (nloptwrap) convergence code: 0 (OK)" meaning?

Moreover, it does not throw a convergence warning.

for example, This did not throw a convergence warning (e.g., Warning message: Model failed to converge with 1 negative eigenvalue: -2.3e+01 )

Upvotes: 5

Views: 3636

Answers (1)

Robert Long
Robert Long

Reputation: 6812

what is "optimizer (nloptwrap) convergence code: 0 (OK)" meaning?

It means that the model has converged

Moreover, it does not throw a convergence warning.

That's because it has converged.

However, the line:

boundary (singular) fit: see ?isSingular

is important. It means that it has converged to a singular fit which in this case is because the random intercepts variance has been estimated at zero:

Random effects:  
 Groups   Name        Variance Std.Dev       
 pid      (Intercept)  0.00    0.000   

In this case it is possible that you don't need random intercepts at all and you can proceed with a model fitted with lm()

Upvotes: 5

Related Questions