[R-sig-ME] Starting values slot
Douglas Bates
bates at stat.wisc.edu
Mon Jul 20 07:48:27 CEST 2009
On Mon, Jul 20, 2009 at 4:40 AM, Ben Bolker<bolker at ufl.edu> wrote:
> Stuart Luppescu wrote:
>> A long time ago (2005) Doug Bates wrote this (in the R-help list,
>> perhaps) with regard to specifying starting values for lmer:
>>
>>>> for linear mixed models. The object "mer" is a mixed-effects
>>>> representation and the list "cv" is the control values. The only
>>>> thing that the C function "lmer_initial" does is set the initial
>>>> values of the relative precision matrices for the random effects.
>>>> These are the inverses of the variance-covariance matrices relative to
>>>> the variance of the per-observation noise term. They are stored
>>>> (upper triangle only) in a slot called "Omega" of the mer class (which
>>>> is contained in the lmer class).
>>
>> Was this ever implemented? I don't see the Omega slot mentioned in the
>> mer-class documentation. I have a model that has been running for more
>> than 8 hours now (on a *very* fast machine, even) -- 2.6 million records
>> within two grouping factors containing 75,000 and 33,000 levels. (And
>> this version is just with a random sample of the full data.) When adding
>> fixed effects to the model, I'd like to avoid having to wait many hours
>> for it to finish, so I'd like to be able to speed things up by giving it
>> starting values from the previous version of the model.
>>
>> Can I use start=lm.previous at Omega, or is there another way to do this?
>>
>> Thanks.
>
> There's a function called ST2Omega() hidden in the namespace
> (lme4:::ST2Omega), but reading the help for "lme4" it looks like you
> should now just use the ST slot:
> library(lme4)
> fm0 <- lmer(Reaction ~ (Days|Subject), sleepstudy)
> fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
> fm1B <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy,
> start = fm0 at ST)
> ? I'm a little out of my depth here ?
The Omega slot is now gone. It has been replaced by the relative
covariance factor, which I call Lambda and which is implemented as the
product of two matrices, a diagonal matrix, S, and a unit lower
triangular matrix, T. The best recent description of the derivation
of the computational methods is in the slides for my presentation with
Martin at the DSC2009 conference, available at
http://matrix.r-forge.r-project.org/slides/2009-07-14-Copenhagen/
For setting starting values you do not need the details of the
implementation. The fixed-effects parameters, beta, and the common
scale parameter, sigma, have been profiled out of the deviance and
REML criterion. Thus the optimization is over the parameters that
determine Lambda only. I usually call these theta. If you use
verbose = TRUE in a call to lmer you will get output with the value of
the criterion being optimized (either the REML criterion or, for ML
estimation, the deviance) and the values of the components of theta at
each iteration. This provides some assurance that progress is being
made if, as in your case, the optimization is taking a long time. For
the next model fit you simply specify the converged value of theta as
the start argument to lmer.
More information about the R-sig-mixed-models
mailing list