Skip to content
Prev 10478 / 20628 Next

inconsistent results between lme4 and lme4.0

Kevin Wright <kw.stat at ...> writes:
I did try this with bobyqa and got better answers:

sim <- function(N, n) { c.mer(lmer(y ~ x1 + x2 + (1 | grp), dgp())) }
sim2 <- function(N, n) { c.mer(lmer(y ~ x1 + x2 + (1 | grp), dgp(),
                         control=lmerControl(optimizer="bobyqa"))) }

set.seed(080813)
apply(sapply(1:nsims, sim), 1, function(xx) c(mean(xx),sd(xx)))
# the means, in row 1, should be 1s across the board... but aren't
##     (Intercept)          x1       x2 grp.(Intercept)
## [1,]    1.418810 -0.02859056 0.143737        1.151423 2.0353251
## [2,]    1.474223  0.28381662 2.815086        1.138676 0.6091787

set.seed(080813)
apply(sapply(1:nsims, sim2), 1, function(xx) c(mean(xx),sd(xx)))
##      (Intercept)        x1       x2 grp.(Intercept)          
## [1,]   0.9694322 1.0135719 1.168296       1.0372534 1.0239419
## [2,]   1.2322048 0.1949554 2.157951       0.9658897 0.2899341

detach(package:lme4)
library(lme4.0) # lme4.0_0.9999-1

apply(sapply(1:nsims, sim), 1, function(xx) c(mean(xx),sd(xx)))
##      (Intercept)        x1       x2 grp.(Intercept)          
## [1,]    1.055962 1.0008875 1.050862        1.124547 1.0029512
## [2,]    1.335184 0.2055197 2.288807        1.155740 0.2802394

   We will try to look into this.  It's rather difficult to come
up with numerical methods that are uniformly better (although we
were hoping ...) -- we have also certainly seen a number of cases
where lme4 does much better than lme4.0 ...  ideally we can at
least find numeric summaries that will warn of dangerous situations.

  cheers
    Ben Bolker