Skip to content
Prev 95 / 20628 Next

Model specification help

On 3/8/07, Andrew Perrin <clists at perrin.socsci.unc.edu> wrote:
I haven't done a thorough analysis of the memory usage in lmer but I
can make some informed guesses as to where memory can be saved.  The
details of the implementation and the slots in the internal
representation of the model are given in the "Implementation" vignette
in the lme4 package.  At present there is only one small example shown
in there but I will add others.

For the model fitting process itself the largest object needed is the
symmetric sparse matrix in the A slot and the Cholesky factor of the
updated A*.  The dimension of that square matrix is the sum of the
sizes of the random effects vector and the fixed effects vector plus 1
(for the response).  Generally the Cholesky factor will be slightly
larger than the A but care is taken to make the Cholesky factor as
small as possible.

I enclose an example from fitting a model with two random effects per
student, one random effect per teacher and two random effects per
school to the star (Tennessee's Student-Teacher Achievement Ratio
study) data.  The dimension of the random effects will be 2*10732 +
1374 + 2 * 80 so that easily dominates the dimension of A.

In this case the sizes of the slots L, A, ZXyt and frame are
comparable.  However, if we strip things down to the bare essentials
we don't need ZXyt, frame, flist, offset and weights after the matrix
A has been constructed.

The dimension of the matrices L and A is dominated by the dimension of
the random effects vector.  The dimension of ZXyt, etc. involves the
number of observations.  This might be good news in your case in that
the sizes of the parts that must be preserved are dominated by the
number of students and not the number of grades recorded.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: andrew.txt
URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20070309/cd340b55/attachment.txt>