[R-sig-ME] Cholmod warning with glmer

Ben Bolker bbolker at gmail.com
Sun Jan 6 03:52:37 CET 2013


David Winsemius <dwinsemius at ...> writes:

> On Jan 4, 2013, at 1:40 PM, leanne heisler wrote:

> > I am running a generalized linear mixed effects model with lme4
> and am getting an error I have not been able to decipher. I was
> hoping for some guidance. I am using the following code:

> >> glmer(DM~PREC+(1|NEST)+(1|NG)+(1|LONG),data=data,
>> family=poisson,verbose=TRUE)
> > 0: 6107.8287: 1.34084 1.29515 0.532795 3.23218 -0.00145626
> > 1: 6107.8287: 1.34084 1.29515 0.532795 3.23218 -0.00145626
> > Error in mer_finalize(ans) : Downdated X'X is not positive definite, 1.
> > In addition: Warning messages:

 [snip]

> > All fixed and random effects are continuous variables (DM is
> counts of deer mice) except for the random effect 'NEST', which is
> categorical. The model runs fine when the random effects NEST and
> LONG are removed.
 
> LONG appears to be integer and it might be useful to look at
>  table(data$LONG) and table(data$NG).
> 
> > The results of str(data) are:
> > 
> >> str(data)
> > 'data.frame': 930 obs. of 14 variables:
> > $ NEST : Factor w/ 627 levels "#10 Treesbank",..: 2 7 9 42 [snip]
> > $ LONG : num -101 -111 -111 -112 -112 ...
> > $ DM : int 1 1 1 1 1 1 1 1 1 1 ...
> > $ PREC : num 221.3 142.9 68.7 186.9 185.9 ...

> You are of necessity going to have quite a few levels where NEST has
> only one value since 627 values are distributed of 930 rows. I think
> a cross-tabulation of those random effects will build a fairly
> sparse data object.

  I don't think that will matter that much, but it may matter how
many distinct values of LONG there are (impossible to tell from
this summary, as David said you should try table(data$LONG) ...)

  This doesn't normally matter much, but glmer can be finicky so
I would take a shot at scaling and centering PREC:

data$scPREC <- scale(data$PREC)

and then continue with scPREC as the predictor (the reason this
matters is that the variance components are often fairly small
(on the order of 1 or less), while your precipitation is measured
in the hundreds -- this difference in scales can cause problems
for the numerical optimization algorithm used.

  Ben Bolker



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