[R-sig-ME] glmerMod with covariance matrix set to 0?

Ben Bolker bbolker at gmail.com
Sun Apr 27 22:54:25 CEST 2014


On 14-04-27 12:38 PM, Elizabeth Crone wrote:
> Dear mixed modelers,
> 
> When lme4 fits a glmer model, the default parameterization is to model the
> full covariance matrix of random effects.  For some data sets, this takes a
> very long time, and the covariance is also difficult to estimate with
> missing data.  Is there a way to set the correlation matrix to 0?  [I can
> think of ways to hack it, but I wonder if there is a command I haven't
> noticed.]
> 
> To make my question more concrete, consider an example where I am modeling
> counts of animals at several sites through time:
> glmer(count ~ -1 + site + (-1 + site|year), family = poisson)
> 
> This model estimates the average log-count of animals at each site, the
> standard deviation through time at each site, and the covariance of
> log-counts at all pairs of sites through time.  [The -1's set the
> parameterization to means and standard deviations for each site, as opposed
> to a reference group, and deviations from that group.] Missing data are
> sites with no counts in some years, which is one thing that makes the
> covariance difficult to estimate.
> 
> Is there a command to set the random effects correlations to 0, without
> manually creating a dummy variable for each site, running a separate lmer
> model for each site?
> 
> Thanks!
> Elizabeth Crone
> 
> 


  This is possible, but it's not *very* easy at present. The basic idea
is to build the full deviance function, and then wrap it in a function
that sets the diagonal elements of the v-cov matrix to the parameters
specified (and the fixed effects vector, if it's a GLMM with nAGQ>0) but
sets the off-diagonal elements of the variance-covariance matrix to
zero.  I haven't had time to put together such an example, but a similar
trick is done at http://rpubs.com/bbolker/6298 ; the diagLmer() function
defined there might work with suitable modifications.

  A slightly better way would actually be to redefine the internal
Lind/Lambda structures; the best way would be for us to implement a
notation that would allow end-users to do this easily ...

  Ben Bolker



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