[Lme4-commits] r1758 - pkg/lme4/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 29 15:04:49 CEST 2012


Author: bbolker
Date: 2012-05-29 15:04:48 +0200 (Tue, 29 May 2012)
New Revision: 1758

Modified:
   pkg/lme4/tests/glmmExt.R
   pkg/lme4/tests/profile.R
   pkg/lme4/tests/refit.R
Log:

  re-comment-out refit() tests (work on Linux, but fail on Windows)
  small changes based on fixes to profile/PIRLS



Modified: pkg/lme4/tests/glmmExt.R
===================================================================
--- pkg/lme4/tests/glmmExt.R	2012-05-29 13:03:26 UTC (rev 1757)
+++ pkg/lme4/tests/glmmExt.R	2012-05-29 13:04:48 UTC (rev 1758)
@@ -66,6 +66,11 @@
 ggl1 <- glmer(y ~ 1 + (1|block), data=dgl, family=Gamma(link="log"), verbose= 2)
 ggl2 <- glmer(y ~ x + (1|block), data=dgl, family=Gamma(link="log"), verbose= 2)
 
+##
+## library(lme4.0)
+## ggl1 <- glmer(y ~ 1 + (1|block), data=dgl, family=Gamma(link="log"), verbose= 2)
+## fails
+
 ## Poisson/log
 gP1 <- glmer(y ~ 1 + (1|block), data=dP, family=poisson, verbose= 2)
 gP2 <- glmer(y ~ x + (1|block), data=dP, family=poisson, verbose= 2)
@@ -74,6 +79,14 @@
 gG1 <- glmer(y ~ 1 + (1|block), data=dG, family=gaussian(link="log"), verbose=TRUE)
 gG2 <- glmer(y ~ x + (1|block), data=dG, family=gaussian(link="log"), verbose=TRUE)
 
+## works with lme4.0 but AIC/BIC/logLik are crazy, and scale
+## parameter is not reported
+## glmmML etc. doesn't allow models with scale parameters
+## gG1B <- glmmadmb(y ~ 1 + (1|block), data=dG,
+##                  family="gaussian",link="log",verbose=TRUE)
+## what is the best guess at the estimate of the scale parameter?
+## is it the same as sigma?
+## gG1B$alpha
 
 if(Sys.info()["user"] != "maechler") { # <- seg.faults (MM)
 

Modified: pkg/lme4/tests/profile.R
===================================================================
--- pkg/lme4/tests/profile.R	2012-05-29 13:03:26 UTC (rev 1757)
+++ pkg/lme4/tests/profile.R	2012-05-29 13:04:48 UTC (rev 1758)
@@ -38,14 +38,21 @@
 gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
              data = cbpp, family = binomial)
 
-### FIXME: PIRLS step fails here
+### FIXME: works, but with warnings/slower
+system.time(pr4 <- profile(gm1))  ## ~ 10 seconds
+
+
+## FIXME: compDev=FALSE fails
 if (FALSE) {
-    system.time(pr4 <- profile(gm1))  ## ~ 7 seconds
-
-    xyplot(pr4,layout=c(5,1),as.table=TRUE)
-    splom(pr4)
+    gm1B <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
+                  data = cbpp, family = binomial,
+                  compDev=FALSE,verbose=3)
 }
 
+profile(gm1,which=3)
+xyplot(pr4,layout=c(5,1),as.table=TRUE)
+splom(pr4)
+
 nm1 <- nlmer(circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree,
              Orange, start = c(Asym = 200, xmid = 725, scal = 350))
 if (FALSE) {

Modified: pkg/lme4/tests/refit.R
===================================================================
--- pkg/lme4/tests/refit.R	2012-05-29 13:03:26 UTC (rev 1757)
+++ pkg/lme4/tests/refit.R	2012-05-29 13:04:48 UTC (rev 1758)
@@ -25,7 +25,6 @@
 gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
             cbpp, binomial)
 gm1R <- refit(gm1,with(cbpp,cbind(incidence,size-incidence)))
-gm1S <- refit(gm1,simulate(gm1)[[1]])
 
 ## FIXME: testing all-zero responses
 ## this gives "pwrssUpdate did not converge in 30 iterations"
@@ -39,16 +38,20 @@
 stopifnot(all.equal(gm1,gm1R,tol=4e-5))
 getinfo(gm1)
 getinfo(gm1R)
-getinfo(gm1S) 
 
+## FIXME: still failing on Windows
+## gm1S <- refit(gm1,simulate(gm1)[[1]])
+## getinfo(gm1S) 
+
 ## binomial GLMM (prob/weights)
 gm2 <- glmer(incidence/size ~ period + (1 | herd), cbpp, binomial, weights=size)
 gm2R <- refit(gm2,with(cbpp,incidence/size))
-gm2S <- refit(gm2,simulate(gm2)[[1]])
 stopifnot(all.equal(gm2,gm2R,tol=4e-5))
 getinfo(gm2)
 getinfo(gm2R)
-getinfo(gm2S)
+## FIXME: check on Windows
+## gm2S <- refit(gm2,simulate(gm2)[[1]])
+## getinfo(gm2S)
 
 ## Bernoulli GLMM (specified as factor)
 data(Contraception,package="mlmRev")



More information about the Lme4-commits mailing list