[R-sig-ME] Does lmer have it's own random number generator?
Ben Bolker
bbolker at gmail.com
Tue Jan 4 04:13:49 CET 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
For what it's worth:
I get similarly wonky results on 64-bit MacOS, clean results on 32-bit
MacOS and Ubuntu.
*** 32-bit MacOS:
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: i386-apple-darwin9.8.0/i386 (32-bit)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/C/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] grid splines stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] ez_2.1-0 lme4_0.999375-37 Matrix_0.999375-46
lattice_0.19-13
[5] stringr_0.4 ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3
[9] plyr_1.2.1 car_2.0-7 survival_2.36-2 nnet_7.3-1
[13] MASS_7.3-9
loaded via a namespace (and not attached):
[1] nlme_3.1-97 stats4_2.12.0 tools_2.12.0
>
> proc.time()
user system elapsed
52.408 1.140 53.894
*** 64-bit MacOS:
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/C/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] grid splines stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] ez_2.1-0 lme4_0.999375-37 Matrix_0.999375-46
lattice_0.19-13
[5] stringr_0.4 ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3
[9] plyr_1.2.1 car_2.0-7 survival_2.36-2 nnet_7.3-1
[13] MASS_7.3-9
loaded via a namespace (and not attached):
[1] nlme_3.1-97 stats4_2.12.0 tools_2.12.0
*** 32-bit Linux:
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: i486-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_CA.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid splines stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] ez_2.1-0 lme4_0.999375-37 Matrix_0.999375-47
lattice_0.19-16
[5] stringr_0.4 ggplot2_0.8.9 proto_0.3-8 reshape_0.8.3
[9] plyr_1.2.1 car_2.0-8 survival_2.36-3 nnet_7.3-1
[13] MASS_7.3-9
loaded via a namespace (and not attached):
[1] nlme_3.1-97 stats4_2.12.1 tools_2.12.1
>
On 11-01-03 09:53 AM, Mike Lawrence wrote:
> Using a variant of Thierry's code I get rather different results on my
> machine (MacBookPro7,1, OS 10.6.5; see also sessionInfo() results
> below). The modification I made simply puts call to set.seed() within
> each loop of replicate(). I observe the same behaviour no matter
> whether I apply this modification or not, but I wanted to highlight
> lmer's insensitivity (on my machine) to the seed:
>
>> library(ez)
>> data(ANT)
>>
>> tmp <- replicate(100, {
> + set.seed(1)
> + 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, na.rm = T)
> ML REML ldL2 ldRX2
> 1.103807e-01 5.612587e-02 1.159465e+00 1.190199e-02
> sigmaML sigmaREML pwrss disc
> 1.309610e-05 1.334286e-05 3.593904e+06 9.197845e+06
> usqr wrss dev llik
> 1.293124e+06 9.198576e+06 NA NA
> NULLdev
> NA
>>
>> apply(tmp, 1, function(x){mean(is.finite(x))})
> ML REML ldL2 ldRX2 sigmaML sigmaREML
> 0.9 0.9 0.9 0.9 0.9 0.9
> pwrss disc usqr wrss dev llik
> 0.9 0.9 0.9 0.9 0.0 0.0
> NULLdev
> 0.0
>>
>> sessionInfo()
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
>
> locale:
> [1] en_CA.UTF-8/en_US.UTF-8/C/C/en_CA.UTF-8/en_CA.UTF-8
>
> attached base packages:
> [1] grid splines stats graphics grDevices utils
> datasets methods base
>
> other attached packages:
> [1] ez_2.1-0 lme4_0.999375-37 Matrix_0.999375-45
> lattice_0.19-13 stringr_0.4 ggplot2_0.8.8
> [7] proto_0.3-8 reshape_0.8.3 plyr_1.2.1
> car_2.0-6 survival_2.36-1 nnet_7.3-1
> [13] MASS_7.3-8
>
> loaded via a namespace (and not attached):
> [1] nlme_3.1-97 stats4_2.12.0 tools_2.12.0
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk0ikG0ACgkQc5UpGjwzenO79gCfbwER9lhHWfTZVVf0t3z1gWyo
Dx0An0Sti2l04V0o2M+pyR3T1KW0RwY+
=/yXc
-----END PGP SIGNATURE-----
More information about the R-sig-mixed-models
mailing list