[R-sig-ME] lme4 glmer convergence question
Ben Bolker
bbolker at gmail.com
Fri Nov 6 22:04:03 CET 2015
On Fri, Nov 6, 2015 at 1:58 PM, Sally A. Roman <saroman at vims.edu> wrote:
> Hello -
> I am trying to use the lme4 package for a glmm and am getting a convergence code of 0 and a statement: Model failed to converge with max|grad| = 0.00791467 (tol = 0.001, component 1). I am interested in using the lme4 package because I would like to have AIC values to determine the appropriate model as I add in additional covariates.
In contrast to glmmPQL, I'm guessing?
> Two weeks ago when I tried the same approach I got a warning message that the model failed to converge because of the max|grad| issue, but am not getting the warning message this time, just the statement at the end of the summary output.
>
> Summary output below:
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) [glmerMod]
> Family: Gamma ( log )
> Formula: Meat_Weight ~ logsh + SAMS_region_2015 + (1 | StationID)
> Data: datad
> Control: glmerControl(optCtrl = list(maxfun = 100000))
>
> AIC BIC logLik deviance df.resid
> 29841.2 29893.0 -14912.6 29825.2 4748
>
> Scaled residuals:
> Min 1Q Median 3Q Max
> -5.6389 -0.5089 0.0376 0.5660 7.3199
>
> Random effects:
> Groups Name Variance Std.Dev.
> StationID (Intercept) 0.007073 0.0841
> Residual 0.026626 0.1632
> Number of obs: 4756, groups: StationID, 426
>
> Fixed effects:
> Estimate Std. Error t value Pr(>|z|)
> (Intercept) -9.21833 0.10890 -84.65 < 0.0000000000000002
> logsh 2.62984 0.02223 118.33 < 0.0000000000000002
> SAMS_region_2015ET 0.09299 0.03174 2.93 0.003393
> SAMS_region_2015HC 0.12031 0.03347 3.59 0.000325
> SAMS_region_2015HCsr 0.08405 0.03892 2.16 0.030810
> SAMS_region_2015LI 0.07721 0.03209 2.41 0.016107
>
> (Intercept) ***
> logsh ***
> SAMS_region_2015ET **
> SAMS_region_2015HC ***
> SAMS_region_2015HCsr *
> SAMS_region_2015LI *
> ---
> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> Correlation of Fixed Effects:
> (Intr) logsh SAMS__2015E SAMS_regn_2015HC
> logsh -0.968
> SAMS__2015E -0.179 -0.036
> SAMS_regn_2015HC -0.166 -0.038 0.699
> SAMS_rgn_2015HCs -0.139 -0.037 0.600 0.569
> SAMS__2015L -0.186 -0.027 0.728 0.691
> SAMS_rgn_2015HCs
> logsh
> SAMS__2015E
> SAMS_regn_2015HC
> SAMS_rgn_2015HCs
> SAMS__2015L 0.593
> convergence code: 0
> Model failed to converge with max|grad| = 0.00764043 (tol = 0.001, component 1)
>
> Does this mean that the model is not converging? I also used the glmmPQL method. The coefficient parameter estimates are similar between the two model types.
>
> Here is glmer (lme4) model code. I increased the maxfun to deal with other issues I had when I ran the model last time.
>
> l1<-glmer(Meat_Weight~logsh+SAMS_region_2015+(1|StationID),
> family="Gamma"(link="log"),data=datad,control=glmerControl(optCtrl=list(maxfun=100000)))
> Here is the glmmPQL code.
>
> m1<-glmmPQL(fixed=Meat_Weight~logsh+SAMS_region_2015,random=~1|StationID,
> family=Gamma(link="log"),data=datad)
>
> I am sure this is not information to diagnosis the problem, but if anyone has suggestions I can provide more data.
>
> Thanks
>
> Sally Roman
> Fisheries Specialist
> Virginia Institute of Marine Science
> Marine Advisory Services
>
> Phone: 804-684-7165
> Fax: 804-684-7161
Have you looked at ?convergence ? The bottom line (as commented on
here recently by Doug Bates in this forum) is that the convergence
tests give a lot of false positives; I have thought a lot about
removing them, or at least about increasing the tolerances
considerably, but have been afraid to make changes that would lead to
a lot more false *negatives* (i.e. unreported problems with models)
without a lot more time & effort evaluating these rules and makng the
decision carefully (which I don't have right now ...)
Especially if you are getting similar-enough results between glmmPQL
and glmer, I would feel free to ignore the warnings.
More information about the R-sig-mixed-models
mailing list