[R-sig-ME] Too big for lmer?

Ken Beath ken at kjbeath.com.au
Fri Aug 7 10:44:37 CEST 2009


This will fit using a 64bit version of R, but unless there is more  
than the 4GB of memory I have it will run slowly.

Like Thierry I wonder if you really want a 6000 level fixed effect.

Ken

On 07/08/2009, at 4:56 AM, Kevin W wrote:

> 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]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




More information about the R-sig-mixed-models mailing list