[R-sig-ME] Does lmer have it's own random number generator?

Ken Knoblauch ken.knoblauch at inserm.fr
Mon Jan 3 15:28:18 CET 2011


Douglas Bates <bates at ...> writes:
> <Thierry.ONKELINX at ...> wrote:
> > Are you sure? Below the results of 100 simulations. 
> > I get the same results each time.
> >> set.seed(1)
> >> tmp <- replicate(100, {
> > +       fit <- lmer(
> > +               formula = rt ~ (1|subnum) +
> > +                       cue*flank*group*block +
> > +                       cue*flank*group*I(block^2) +
> > +                       cue*flank*group*I(block^3)
> > +               , data = ANT[ANT$error==0,]
> > +       )
> > +       fit <at> deviance })
> >> apply(tmp, 1, var)
> >       ML      REML      ldL2     ldRX2   sigmaML sigmaREML     pwrss
> > disc
> >        0         0         0         0         0         0         0
> > 0
> >     usqr      wrss       dev      llik   NULLdev
> >        0         0        NA        NA        NA
> >> sessionInfo()
> > R version 2.12.0 (2010-10-15)
> > Platform: i386-pc-mingw32/i386 (32-bit)
> > locale:
> > [1] LC_COLLATE=Dutch_Belgium.1252  LC_CTYPE=Dutch_Belgium.1252
> > [3] LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C
> > [5] LC_TIME=Dutch_Belgium.1252
> >> [mailto:r-sig-mixed-models-bounces at ...] Namens Mike Lawrence
> >> Verzonden: maandag 3 januari 2011 3:52
> >> Aan: r-sig-mixed-models at ...
> >> Onderwerp: [R-sig-ME] Does lmer have it's own random number generator?
> >> Does lmer have it's own internally seeded random number
> >> generator? I just came across an example where I get
> >> different results across repeated identically specified lmer
> >> fits even when I use set.seed():

-------------- snip ----------------------


> >> any(is.finite(attr(fit,'deviance')))
> A call to lmer does not, as far as I know, result in any calls to
> random number generators.  There is only one point in the lme4 package
> where set.seed is called and that is in the simulate method.
> 

Could this be part of the Mac 32bit weirdness that surfaced a little while ago
with respect to lme4?  Mike didn't say what platform he was one.

-- 
Ken Knoblauch
Inserm U846
Stem-cell and Brain Research Institute
Department of Integrative Neurosciences
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.sbri.fr/members/kenneth-knoblauch.html




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