[R-sig-ME] Timing for lmer2 versus lmer for chocolate cake data (WinXP)
Douglas Bates
bates at stat.wisc.edu
Mon Jan 29 15:37:42 CET 2007
On 1/28/07, Douglas Bates <bates at stat.wisc.edu> wrote:
> On 1/28/07, Andrew Robinson <A.Robinson at ms.unimelb.edu.au> wrote:
> > I've switched from FreeBSD to WinXP temporarily :)
> >
> > I've attached a comparison of lmer and lmer2 upon the analysis of
> > Cochran and Cox's chocolate cake data. Here, it seems that lmer2 is
> > faster (0.08 vs. 0.15) but the AIC of the fitted model for lmer2 is
> > higher (1643 vs 1635). The models are quite different in the random
> > effects.
>
> Thanks for including that example Andrew. If you turn on the
> msVerbose control setting you will see that it is a problem in the
> optimizer behavior near the boundary for the new parameterization
> (script and output attached).
>
> It is a good thing to have such an example. I had only observed the
> opposite behavior where the optimizer had boundary problems in the
> relative variance scale but not in the relative standard deviation
> scale. I'm not quite sure what I am going to do about it though.
I have just committed a couple of changes to the SVN archive for the
lme4 package
https://svn.r-project.org/R-packages/trunk/lme4
that allow lmer2 to fit this model to these data and obtain the same
estimates as lmer did.
One approach is to fit a simpler model with additive fixed effects
first and use the fitted variance components from that model as the
starting estimates for the model that allows for interaction of the
fixed effects. The version of lmer2 on the SVN archive allows you to
specify a start argument that should be in the form of the ST slot for
the model. If you fit two models with the same random effects
specification then you can use the ST slot from the first as the
starting estimate for the second.
The other thing that I did was to change the call in lmer2 to the
nlminb optimizer so that it uses the default setting of the rel.tol
convergence criterion. In the currently released version of lme4 the
this criterion is reset so that convergence is declared if the
deviance apparently has been determined to an accuracy of 0.001. I
made this change because we observed that in many cases a substantial
portion of the iterations of the optimizer were spent at the optimum
making very small changes in parameter values that did not have a
substantial impact on the value of the deviance.
It looks like changing that criterion was too risky. I would rather
have slower optimization with a higher degree of confidence that the
declared optimum is indeed the optimum.
I enclose R code and output for fitting these models with the modified
(and, as yet, unreleased) version of lmer2. I also modified the cake
data so that the temperature is an ordered factor. This results in
slightly different values of the REML criterion but you can still see
the pattern of convergence. My purpose in using an ordered factor is
to see if the linear contrast in the temperature is dominant, which it
is.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cake_R.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20070129/cce70675/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cake_Rout.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20070129/cce70675/attachment-0001.txt>
More information about the R-sig-mixed-models
mailing list