[R-sig-ME] default optimizer in lmer 1.1-7?

Ben Bolker bbolker at gmail.com
Thu Nov 6 17:11:33 CET 2014


[cc'ing to r-sig-mixed-models]

You can see the default optimizer for GLMMs by running

 > glmerControl()$optimizer
[1] "bobyqa"      "Nelder_Mead"

This means that bobyqa is used for the first (nAGQ=0) stage of
optimization, whereas Nelder-Mead is used for the second (nAGQ>0).  If
optimizer is a length-1 vector, the same optimizer is used for both stages
of optimization (I *think* this is explained in the documentation, but it
might not be ...)

If you read the NEWS file <
http://cran.r-project.org/web/packages/lme4/news.html> slightly more
carefully, you'll see that the default was only changed for `lmer` fits,
not `glmer` fits -- from 1.1-4,

* The default optimizer for lmer fits has been switched from "Nelder_Mead"
to "bobyqa" because we have generally found the latter to be more reliable.
To switch back to the old behaviour, use
control=lmerControl(optimizer="Nelder_Mead").

  We are very seriously considering making bobyqa, or nloptwrap, the
default for GLMMs as well (for both stages of optimization) in the next
release.

 I haven't looked at your results in too much detail otherwise -- it's a
little bit puzzling that all the AICs seem to be about the same, but I was
in a hurry (and I want to send this off before the problem gets buried in
my inbox).


On Thu, Nov 6, 2014 at 10:16 AM, Jordi Moya Laraño <jordi at eeza.csic.es>
wrote:

>  Dear Ben,
> We have been going crazy about replicating previous analyses with glmer
> and I think that what may be happening is that when you copiled the last
> version you left in unadvertedly "Nelder_Mead" by default instead of
> "bobyqa" as it is claimed to be done in the last version of the manual. Is
> that a possibility? My analyses give the results by default as those
> obtained if you were using "Nelder_Mead". I am also wondering whether
> Nelder_Mead results should be trusted whatsoever.
>
> Here are my codes and results (the results using "bobyqa" are the once
> qualitatively very similar to those using previous versions of lme4):
> >
> TELA_MANIP1<-glmer(ABUNDANCE~RAIN*TRAT+(1|SITE)+(1|caso),data=tela2013,poisson)
> > summary(TELA_MANIP1)
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) ['glmerMod']
>  Family: poisson  ( log )
> Formula: ABUNDANCE ~ RAIN * TRAT + (1 | SITE) + (1 | caso)
>    Data: tela2013
>
>      AIC      BIC   logLik deviance df.resid
>    265.8    282.2   -124.9    249.8       49
>
> Scaled residuals:
>      Min       1Q   Median       3Q      Max
> -1.67352 -0.56382  0.04347  0.63915  1.61069
>
> Random effects:
>  Groups Name        Variance  Std.Dev.
>  caso   (Intercept) 0.0815360 0.28555
>  SITE   (Intercept) 0.0001355 0.01164
> Number of obs: 57, groups:  caso, 57; SITE, 7
>
> Fixed effects:
>                           Estimate Std. Error z value Pr(>|z|)
> (Intercept)               1.515432   0.004537   334.0  < 2e-16 ***
> RAINLOW                   0.013886   0.004533     3.1  0.00219 **
> TRATNO_PREDATORS         -0.621030   0.004532  -137.0  < 2e-16 ***
> TRATPREDATORS             0.238772   0.004534    52.7  < 2e-16 ***
> RAINLOW:TRATNO_PREDATORS -0.251747   0.004531   -55.6  < 2e-16 ***
> RAINLOW:TRATPREDATORS     0.046884   0.004532    10.3  < 2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
>               (Intr) RAINLOW TRATNO TRATPR RAINLOW:TRATN
> RAINLOW       0.000
> TRATNO_PRED   0.000  0.000
> TRATPREDATO   0.000  0.000   0.001
> RAINLOW:TRATN 0.000  0.000   0.000  0.000
> RAINLOW:TRATP 0.000  0.000   0.001  0.000  0.000
> > library(car)
> > Anova(TELA_MANIP1,type="III",test="Chisq")
> Analysis of Deviance Table (Type III Wald chisquare tests)
>
> Response: ABUNDANCE
>                  Chisq Df Pr(>Chisq)
> (Intercept) 1.1158e+05  1    < 2e-16 ***
> RAIN        9.3829e+00  1    0.00219 **
> TRAT        2.1559e+04  2    < 2e-16 ***
> RAIN:TRAT   3.1937e+03  2    < 2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> >
> TELA_MANIP1<-glmer(ABUNDANCE~RAIN*TRAT+(1|SITE)+(1|caso),data=tela2013,poisson,glmerControl(optimizer
> = c("bobyqa")))
> > summary(TELA_MANIP1)
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) ['glmerMod']
>  Family: poisson  ( log )
> Formula: ABUNDANCE ~ RAIN * TRAT + (1 | SITE) + (1 | caso)
>    Data: tela2013
> Control: glmerControl(optimizer = c("bobyqa"))
>
>      AIC      BIC   logLik deviance df.resid
>    265.8    282.2   -124.9    249.8       49
>
> Scaled residuals:
>      Min       1Q   Median       3Q      Max
> -1.67891 -0.56610  0.04277  0.63769  1.61159
>
> Random effects:
>  Groups Name        Variance Std.Dev.
>  caso   (Intercept) 0.08089  0.2844
>  SITE   (Intercept) 0.00000  0.0000
> Number of obs: 57, groups:  caso, 57; SITE, 7
>
> Fixed effects:
>                          Estimate Std. Error z value Pr(>|z|)
> (Intercept)               1.51734    0.19288   7.867 3.64e-15 ***
> RAINLOW                   0.01200    0.30771   0.039   0.9689
> TRATNO_PREDATORS         -0.62228    0.27051  -2.300   0.0214 *
> TRATPREDATORS             0.23893    0.23320   1.025   0.3056
> RAINLOW:TRATNO_PREDATORS -0.24897    0.46286  -0.538   0.5907
> RAINLOW:TRATPREDATORS     0.04942    0.36944   0.134   0.8936
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
>               (Intr) RAINLOW TRATNO TRATPR RAINLOW:TRATN
> RAINLOW       -0.617
> TRATNO_PRED   -0.703  0.440
> TRATPREDATO   -0.817  0.510   0.581
> RAINLOW:TRATN  0.410 -0.665  -0.584 -0.339
> RAINLOW:TRATP  0.519 -0.833  -0.367 -0.632  0.554
> > library(car)
> > Anova(TELA_MANIP1,type="III",test="Chisq")
> Analysis of Deviance Table (Type III Wald chisquare tests)
>
> Response: ABUNDANCE
>               Chisq Df Pr(>Chisq)
> (Intercept) 61.8859  1  3.639e-15 ***
> RAIN         0.0015  1   0.968899
> TRAT        13.6932  2   0.001063 **
> RAIN:TRAT    0.5580  2   0.756552
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> >
> >
> >
> TELA_MANIP1<-glmer(ABUNDANCE~RAIN*TRAT+(1|SITE)+(1|caso),data=tela2013,poisson,glmerControl(optimizer
> = c("Nelder_Mead")))
> > summary(TELA_MANIP1)
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) ['glmerMod']
>  Family: poisson  ( log )
> Formula: ABUNDANCE ~ RAIN * TRAT + (1 | SITE) + (1 | caso)
>    Data: tela2013
> Control: glmerControl(optimizer = c("Nelder_Mead"))
>
>      AIC      BIC   logLik deviance df.resid
>    265.8    282.2   -124.9    249.8       49
>
> Scaled residuals:
>      Min       1Q   Median       3Q      Max
> -1.67425 -0.55993  0.04442  0.63968  1.61151
>
> Random effects:
>  Groups Name        Variance  Std.Dev.
>  caso   (Intercept) 8.144e-02 0.285378
>  SITE   (Intercept) 6.202e-05 0.007875
> Number of obs: 57, groups:  caso, 57; SITE, 7
>
> Fixed effects:
>                           Estimate Std. Error z value Pr(>|z|)
> (Intercept)               1.512854   0.004555   332.1  < 2e-16 ***
> RAINLOW                   0.016625   0.004551     3.7 0.000259 ***
> TRATNO_PREDATORS         -0.619082   0.004550  -136.1  < 2e-16 ***
> TRATPREDATORS             0.243134   0.004552    53.4  < 2e-16 ***
> RAINLOW:TRATNO_PREDATORS -0.254128   0.004549   -55.9  < 2e-16 ***
> RAINLOW:TRATPREDATORS     0.042442   0.004551     9.3  < 2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
>               (Intr) RAINLOW TRATNO TRATPR RAINLOW:TRATN
> RAINLOW       0.000
> TRATNO_PRED   0.000  0.000
> TRATPREDATO   0.000  0.000   0.001
> RAINLOW:TRATN 0.000  0.000   0.000  0.000
> RAINLOW:TRATP 0.000  0.000   0.001  0.000  0.000
> > library(car)
> > Anova(TELA_MANIP1,type="III",test="Chisq")
> Analysis of Deviance Table (Type III Wald chisquare tests)
>
> Response: ABUNDANCE
>                  Chisq Df Pr(>Chisq)
> (Intercept) 110319.413  1  < 2.2e-16 ***
> RAIN            13.343  1  0.0002594 ***
> TRAT         21372.929  2  < 2.2e-16 ***
> RAIN:TRAT     3207.377  2  < 2.2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> >
> TELA_MANIP1<-glmer(ABUNDANCE~RAIN*TRAT+(1|SITE)+(1|caso),data=tela2013,poisson,glmerControl(optimizer
> = c("Nelder_Mead")))
> > summary(TELA_MANIP1)
>
> Generalized linear mixed model fit by maximum likelihood (Laplace
> Approximation) ['glmerMod']
>  Family: poisson  ( log )
> Formula: ABUNDANCE ~ RAIN * TRAT + (1 | SITE) + (1 | caso)
>    Data: tela2013
> Control: glmerControl(optimizer = c("Nelder_Mead"))
>
>      AIC      BIC   logLik deviance df.resid
>    265.8    282.2   -124.9    249.8       49
>
> Scaled residuals:
>      Min       1Q   Median       3Q      Max
> -1.67425 -0.55993  0.04442  0.63968  1.61151
>
> Random effects:
>  Groups Name        Variance  Std.Dev.
>  caso   (Intercept) 8.144e-02 0.285378
>  SITE   (Intercept) 6.202e-05 0.007875
> Number of obs: 57, groups:  caso, 57; SITE, 7
>
> Fixed effects:
>                           Estimate Std. Error z value Pr(>|z|)
> (Intercept)               1.512854   0.004555   332.1  < 2e-16 ***
> RAINLOW                   0.016625   0.004551     3.7 0.000259 ***
> TRATNO_PREDATORS         -0.619082   0.004550  -136.1  < 2e-16 ***
> TRATPREDATORS             0.243134   0.004552    53.4  < 2e-16 ***
> RAINLOW:TRATNO_PREDATORS -0.254128   0.004549   -55.9  < 2e-16 ***
> RAINLOW:TRATPREDATORS     0.042442   0.004551     9.3  < 2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
>               (Intr) RAINLOW TRATNO TRATPR RAINLOW:TRATN
> RAINLOW       0.000
> TRATNO_PRED   0.000  0.000
> TRATPREDATO   0.000  0.000   0.001
> RAINLOW:TRATN 0.000  0.000   0.000  0.000
> RAINLOW:TRATP 0.000  0.000   0.001  0.000  0.000
> > library(car)
> > Anova(TELA_MANIP1,type="III",test="Chisq")
> Analysis of Deviance Table (Type III Wald chisquare tests)
>
> Response: ABUNDANCE
>                  Chisq Df Pr(>Chisq)
> (Intercept) 110319.413  1  < 2.2e-16 ***
> RAIN            13.343  1  0.0002594 ***
> TRAT         21372.929  2  < 2.2e-16 ***
> RAIN:TRAT     3207.377  2  < 2.2e-16 ***
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
>
> best wishes,
> Jordi
>
>   Jordi Moya-Laraño
> Functional and Evolutionary Ecology
> Estación Experimental de Zonas Áridas - CSIC
> Carretera de Sacramento s/n
> La Cañada de San Urbano
> 04120-Almería
> Spain
>
> phone:+34 950281045 ext. 419
> email: jordi at eeza.csic.es
> www.eeza.csic.es/foodweb
>
>

	[[alternative HTML version deleted]]



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