problems fitting GLMM poisson with cross random effects in lme4 and glmmADMB
On Wed, Oct 31, 2012 at 12:40 PM, Pablo Inchausti
<pablo.inchausti.f at gmail.com> wrote:
Douglas, Many thanks for the speedy response. When I tried: m5=with(DF3,lmer(n.spp~log(hs.arrastre+1)+zona+prof+SSTA+zona*log(hs.arrastre+1)+zona*SSTA+zona*prof+ (1|a?o)+(1|grado),weight=n.lances,family="poisson", verbose=T)) 0: 1150.8846: 0.396545 0.388196 2.44097 0.0156075 -0.221623 -0.0492026 -0.000271677 0.0909335 -0.0106744 -0.00526810 -0.161031 -0.0626493 -0.000706752 -0.000404302 1: 1150.8846: 0.396545 0.388196 2.44097 0.0156075 -0.221623 -0.0492026 -0.000271677 0.0909335 -0.0106744 -0.00526810 -0.161031 -0.0626493 -0.000706752 -0.000404302 Error in mer_finalize(ans) : Downdated X'X is not positive definite, 1. In addition: Warning messages: 1: In mer_finalize(ans) : Cholmod warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line 432 2: In mer_finalize(ans) : Cholmod warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line 432
The value before the ':' is the objective function, in this case the deviance. The parameters are listed after the deviance. If I recall correctly they are in the order of the standard deviations of the random effects (both around 0.39) and then the fixed-effects parameters.
I cannot tell to the correspondence of the parameter values in the first two iteractions with the parameters in the model. Guessing that the 1150.8846 (a huge value?) corresponds to the intercept, I suppose that I could provide other initial values? I added: start=rep(0.5,15) since there are 15 columns in the failed output above, but I could not change the initial values. Any suggestions? Thanks in advance Cheers Pablo On 31 October 2012 15:29, Douglas Bates <bates at stat.wisc.edu> wrote:
On Wed, Oct 31, 2012 at 12:00 PM, Pablo Inchausti <pablo.inchausti.f at gmail.com> wrote:
Dear all, I am experiencing problems when trying to fit the following GLMM with library lme4: m5=with(DF3,lmer(n.spp~log(hs.arrastre+1)+zona+prof+SSTA+zona*log(hs.arrastre+1)+zona*SSTA+zona*prof+ (1|a?o) +(1|grado),weight=n.lances,family="poisson")) The response variable are counts (number of species), and there are four explanatory variables with fixed effects: three continuous variables (SSTA, arrastre, prof) and one is a three-level factor (zona). There are two crossed (uncorrelated random effects): (1|a?o) with a?o having 24 levels; the other random effect (1|grado) has by coincidence also 24 levels. The DF has 419 rows and no missing values. The numbers of cases for each of the random effects are unbalanced but not zero:
with(DF2, table(a?o))
1984 1985 1987 1988 1989 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2005 2006 2007 2008 2009 2010 3 4 3 29 12 23 8 8 40 31 9 12 12 6 14 32 7 8 28 31 35 26 26 12
with(DF2, table(grado))
333 342 343 344 345 352 353 354 355 356 363 364 365 366 374 375 376 385 386 387 395 396 397 398 7 35 22 18 9 22 31 25 18 17 28 32 10 6 22 26 11 13 18 13 9 9 12 6
with(DF2, table(grado, a?o)) is very sparse, which is why I am trying to
fit uncorrelated random effects. I have used the very same dataset, with the same model structure) for other analyses with response variables having Gaussian distribution and have had no problems at all. I invariably obtain the error message: Error in mer_finalize(ans) : Downdated X'X is not positive definite, 1. In addition: Warning messages: 1: In mer_finalize(ans) : Cholmod warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line 432 2: In mer_finalize(ans) : Cholmod warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line 432
I have absolutely no idea how to interpret this message or resolve the error.
The error messages are coming from the sparse matrix library CHOLMOD. One of the disadvantages of adopting such code in the Matrix package for R is that it wants to provide its own error messages and without considerable effort at rewriting it, which would need to be repeated every time a new version is released, these messages show up as R error messages. The best thing to do is to trace the progress of the iterations in the optimization of the parameter estimates. You will likely find that the fixed-effects parameters or the random effects are heading to extreme values.
After trying to fit the same model with library glmmAMDB, I obtain
another
(equally cryptical) error message:
Error in II[, ii] = II[, ii] + REmat$codes[[i]] :
number of items to replace is not a multiple of replacement length
In addition: Warning messages:
1: In glmmadmb(n.spp ~ log(hs.arrastre + 1) + zona + prof + SSTA + :
NAs removed in constructing fixed-effect model frame: you should
probably
remove them manually, e.g. with na.omit()
2: In II[, ii] + REmat$codes[[i]] :
longer object length is not a multiple of shorter object length:
I have tried many of the control options of either library (i.e.
changing
the # of iterations, of evaluations, etc) but the error messages remain
unchanged.
I would really appreciate if any of you could possible spare some
minutes
and suggest some alternative.
Many thanks in advance,
Cheers
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models