Skip to content

Error in reS$ziReStruc[[i]]

8 messages · C. AMAL D. GLELE, Mollie Brooks, Ben Bolker +1 more

#
Hi, dear all.
I've built a glmm (model) with glmmTMB; it had fitted without,  neither
error message, nor warnings;
but, since I've added the following ziformula=~village (village is a 6
levels grouping factor variable), I got the warning message
"Model convergence problem; non-positive-definite Hessian matrix"
Trying to resolve this, I've used ziformula=~(1|village) instead;
 then, the model fits without neither error message, nor warnings; but when
I'd ran "summary(model)", I got the following error message "Error in
reS$ziReStruc[[i]] : subscript out of bounds": it's my first time to get
such an error message and I don't know any idea about its possible cause;
so, any help to solve it will be much appreciated.
In advance, thanks.
Kind regards,
#
~village would treat village as a fixed effect in the zero-inflation
model; ~1|village would
On Mon, Aug 13, 2018 at 9:11 AM C. AMAL D. GLELE <altessedac2 at gmail.com> wrote:
#
Sorry, hit 'send' by accident.

 ~village would treat village as a fixed effect in the zero-inflation
model; ~1|village [or ~(1|village)] would treat it as a random effect.
I can't reproduce a problem with summary(); here's a reproducible
example.  Can you construct a reproducible example that fails ?

dd <- data.frame(village=factor(rep(1:6,50)))
set.seed(101)
zp <- c(0.2,0.8,0.3,0.5,0.6,0.7)
dd$z <- rbinom(300,size=1,prob=zp[dd$village])
dd$z[dd$z==1] <- rpois(sum(dd$z),lambda=3)
library(glmmTMB)
g1 <- glmmTMB(z~1,ziformula=~1|village,data=dd,
        family=poisson)
g2 <- update(g1,ziformula=~village)
summary(g1)
summary(g2)
#
I think this bug was fixed in the development version (https://github.com/glmmTMB/glmmTMB/issues/370). It might still be in the CRAN version. 

Install from Github and it should work. https://github.com/glmmTMB/glmmTMB

Cheers,
Mollie

  
  
#
Thanks to you all for your replies.
I will first try Mollie's suggestion and keep you informed.
All the best,
Amal


2018-08-13 20:34 GMT+02:00 Mollie Brooks <mollieebrooks at gmail.com>:

  
  
5 days later
#
Hi, dear Mollie.
When installing from Github  "
devtools::install_github("glmmTMB/glmmTMB/glmmTMB")";
I've encountered several errors that I corrected; but I do not have a
solution for the last
one (pasted below) yet:
"Installation failed: Cannot change working directory"
In advance thanks.
All the best.
Amal

2018-08-13 20:34 GMT+02:00 Mollie Brooks <mollieebrooks at gmail.com>:

  
  
#
This seems like a permissions problem.  As

 https://github.com/satijalab/seurat/issues/94

says, try running as administrator? (i.e., run R as administrator, then
run install_github(...) within that session
On 2018-08-19 10:45 AM, C. AMAL D. GLELE wrote:
#
In case you have a single grouping factor for the random effects, you can also try package GLMMadaptive that uses adaptive Gaussian quadrature: https://drizopoulos.github.io/GLMMadaptive/

More info for zero-inflated models at: https://drizopoulos.github.io/GLMMadaptive/articles/ZeroInflated_and_TwoPart_Models.html

Best,
Dimitris

From: C. AMAL D. GLELE <altessedac2 at gmail.com<mailto:altessedac2 at gmail.com>>
Date: Sunday, 19 Aug 2018, 4:46 PM
To: Mollie Brooks <mollieebrooks at gmail.com<mailto:mollieebrooks at gmail.com>>
Cc: R SIG Mixed Models <r-sig-mixed-models at r-project.org<mailto:r-sig-mixed-models at r-project.org>>
Subject: Re: [R-sig-ME] Error in reS$ziReStruc[[i]]

Hi, dear Mollie.
When installing from Github  "
devtools::install_github("glmmTMB/glmmTMB/glmmTMB")";
I've encountered several errors that I corrected; but I do not have a
solution for the last
one (pasted below) yet:
"Installation failed: Cannot change working directory"
In advance thanks.
All the best.
Amal

2018-08-13 20:34 GMT+02:00 Mollie Brooks <mollieebrooks at gmail.com>:
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models