[R-sig-ME] lme4/glmer convergence warnings

Paul Johnson pauljohn32 at gmail.com
Tue Apr 22 17:42:08 CEST 2014


Hi

I have that same convergence warning, but I've fiddled around quite a
bit and get the same estimates whether I change to Nelder_Mead or use
the routines in optimx.  I did the relgrad check Ben asked for.

This means all good, right? Itty bitty number being good...

> max(abs(relgrad))
[1] 0.0000001698392
>

I can upload the data and code if you need, its got a lot of rows :)

> lmer3 <- lmer(as.formula(paste( "liquidAssetswASINH ~ ", fmlanew3, part2, "+(1|sippidf)")), data = dat, REML = FALSE, control = lmerControl(optimizer = "bobyqa"))
Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 0.00954838 (tol = 0.002)
> summary(lmer3)
Linear mixed model fit by maximum likelihood  ['lmerMod']
Formula: liquidAssetswASINH ~ NoNo + (e2bonly + e2bPlus) * (tage) + (e2bonly +
    e2bPlus) * (tpearnTMmeanw1000) + esex + emsr + eracer + renroll +
    eeducater + rmesrrTMpcttrunc + errprRefNew + etenurerTM.ch6 +
    tfipsstr + (1 | sippidf)
   Data: dat
Control: lmerControl(optimizer = "bobyqa")

      AIC       BIC    logLik  deviance  df.resid
 484468.0  484763.2 -242203.0  484406.0    100967

Scaled residuals:
    Min      1Q  Median      3Q     Max
-4.4895 -0.2807  0.0128  0.4315  5.0182

Random effects:
 Groups   Name        Variance Std.Dev.
 sippidf  (Intercept) 3.186    1.785
 Residual             4.992    2.234
Number of obs: 100998, groups: sippidf, 36415

Fixed effects:
                              Estimate Std. Error t value
(Intercept)                   3.532580   0.114950   30.73
NoNoNoNo                     -5.827712   0.034154 -170.63
e2bonlyYes                    1.445270   0.131311   11.01
e2bPlus1                     -0.096062   0.120796   -0.80
tage                          0.044094   0.002449   18.01
tpearnTMmeanw1000             0.279506   0.012600   22.18
esexFemale                   -0.069325   0.025256   -2.74
emsrNot                       1.454538   0.025194   57.73
eracerNotWhite               -0.299493   0.036034   -8.31
eracerAsian                  -0.208051   0.064168   -3.24
renrollEnrolled full-time     0.320056   0.032989    9.70
renrollEnrolled part-time     0.181865   0.039189    4.64
eeducaterpartHigh            -0.064377   0.074716   -0.86
eeducaterHighSch             -0.090467   0.069822   -1.30
eeducaterpartColl             0.074347   0.070763    1.05
eeducaterCollege              0.807621   0.074188   10.89
rmesrrTMpcttruncPartJob      -0.017902   0.032287   -0.55
rmesrrTMpcttruncJob           0.082878   0.034674    2.39
errprRefNewYes                0.089412   0.046943    1.90
etenurerTM.ch6NotOwner_Owner  0.049244   0.041681    1.18
etenurerTM.ch6Owner           0.245273   0.023970   10.23
etenurerTM.ch6Owner_NotOwner  0.014995   0.049510    0.30
tfipsstrWest                 -0.139529   0.037873   -3.68
tfipsstrNorth Central        -0.020640   0.036890   -0.56
tfipsstrSouth                -0.163906   0.034739   -4.72
e2bonlyYes:tage              -0.131191   0.004494  -29.19
e2bPlus1:tage                 0.008010   0.003859    2.08
e2bonlyYes:tpearnTMmeanw1000 -0.160948   0.023931   -6.73
e2bPlus1:tpearnTMmeanw1000    0.263943   0.015025   17.57

Correlation matrix not shown by default, as p = 29 > 20.
Use print(...., correlation=TRUE)  or
     vcov(....)     if you need it



> relgrad <- with(lmer3 at optinfo$derivs,solve(Hessian,gradient))
> max(abs(relgrad))
[1] 0.0000001698392

On Thu, Apr 10, 2014 at 8:35 PM, Ben Bolker <bbolker at gmail.com> wrote:
> On 14-04-10 09:01 PM, Corey Sparks wrote:
>
>> Hello all, I’ve been seeing the aforementioned convergence errors for
>> weeks in a course i’m teaching using lme4, so I decided to follow
>> Ben’s advice on reporting the :
>
>> I’m fitting a binomial GLMM for small area estimation model building
>> here:
>> glmer(I(bmi>30)~povz+vachousz+baccz+blackz+hispanicz+factor(region)+(1|state)+(1|cofips),
>> family="binomial", data=merged, weights=cntywt/mean(cntywt))
>>
>> n=~240000, n_cofips=217, n_state=46 I get the warning: In
>> checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
>> Model failed to converge with max|grad| = 0.235915 (tol = 0.001)
>>
>> and the gradients:
>>
>> relgrad <- with(fit.1 at optinfo$derivs,solve(Hessian,gradient))
>>> max(abs(relgrad))
>> [1] 0.0001631008
>
>   This is good (relative gradient is less than the 0.001 or 0.002
> tolerance we would think to set as a default)
>
>>
>> and when I use refit(), I get: fit.1<-refit(fit.1)
>>> relgrad <- with(fit.1 at optinfo$derivs,solve(Hessian,gradient))
>>> max(abs(relgrad))
>> [1] 2.369877e-06
>
>   This doesn't really matter so much (as long as we're getting below
> tolerance on the relative gradient, I don't care so much if we can
> decrease it still further by refitting).
>
>>
>> For another model on a LMM, I get:
>>
>> fit.mix<-lmer(bmiz~agez+lths+coll+black+hispanic+other+(1|cofips),
>> brfss_11)
>>
>> In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,
>> : Model failed to converge with max|grad| = 0.00550412 (tol = 0.002)
>>
>> relgrad <- with(fit.mix at optinfo$derivs,solve(Hessian,gradient))
>>> max(abs(relgrad))
>> [1] 8.099289e-08
>
>   ditto.
>
>>
>> Hope this helps
>>
>
>   Yes, this is encouraging (switching to relative gradients would clear
> everything up here)
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



-- 
Paul E. Johnson
Professor, Political Science      Assoc. Director
1541 Lilac Lane, Room 504      Center for Research Methods
University of Kansas                 University of Kansas
http://pj.freefaculty.org               http://quant.ku.edu



More information about the R-sig-mixed-models mailing list