I have a simple model that appears to be too big for lmer (using 2GB of
memory).  I _can_ fit the model with asreml, but I would like to make a
comparison with lmer. Simulated data is used below, but I have real data
this causing the same problem.

set.seed(496789)
dat <- data.frame(H=sample(1:51, 24000, replace=TRUE),
                  L=sample(1:6101, 24000, replace=TRUE))
Heff <- rnorm(51, sd=sqrt(40))
Leff <- rnorm(6101, sd=sqrt(1200))
err <- rnorm(24000, sd=10)
dat$y <- 100+Heff[dat$H] + Leff[dat$L] + err
dat <- transform(dat, H=factor(H), L=factor(L))
str(dat)
bwplot(y~H, dat)  # Looks right

Using asreml recovers the variance components almost exactly:

m1 <- asreml(y~1, data=dat, sparse=~L, random=~H)

summary(m1)$varcomp
           component std.error   z.ratio constraint
H           50.96058 10.249266  4.972121   Positive
R!variance 100.07324  1.056039 94.762853   Positive

Now try lmer:

m0 <- lmer(y~1+L+(1|H), data=dat)

Error: cannot allocate vector of size 1.1 Gb
In addition: Warning messages:
1: In model.matrix.default(mt, mf, contrasts) :
  Reached total allocation of 1535Mb: see help(memory.size)

Am I pushing lmer past its limits (given the 2GB of memory) or is there a
way to make this fit?


Kevin Wright

	[[alternative HTML version deleted]]


