fm01ML <- lmer(Yield ~ 1|Batch, Dyestuff, REML = FALSE)
system.time( tpr <- profile(fm01ML, optimizer="Nelder_Mead") )
## ~2.6s (on a 2010 Macbook Pro)
system.time( tpr <- profile(fm01ML))
## ~1s, + possible warning about bobyqa convergence
(confint(tpr) -> CIpr)
stopifnot(all.equal(CIpr,
array(c(12.1985292, 38.2299848, 1486.4515,
84.0630513, 67.6576964, 1568.54849), dim = 3:2,
dimnames = list(c(".sig01", ".sigma", "(Intercept)"),
c("2.5 %", "97.5 %"))),
tol= 1e-07))# 1.37e-9 {64b}
xyplot(tpr)
densityplot(tpr, main="densityplot( profile(lmer(..)) )")
splom(tpr)
## Batch and residual variance only
system.time(tpr2 <- profile(fm01ML, which=1:2, optimizer="Nelder_Mead"))
## GLMM example (running time ~11 seconds on a modern machine)
gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
data = cbpp, family = binomial)
system.time(pr4 <- profile(gm1))
xyplot(pr4,layout=c(5,1),as.table=TRUE)
splom(pr4)
Run the code above in your browser using DataCamp Workspace