Discussion:
[R-sig-ME] Error in reS$ziReStruc[[i]]
C. AMAL D. GLELE
2018-08-13 13:11:40 UTC
Permalink
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,

[[alternative HTML version deleted]]
Ben Bolker
2018-08-13 18:28:41 UTC
Permalink
~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 <***@gmail.com> wrote:
>
> 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,
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Ben Bolker
2018-08-13 18:31:15 UTC
Permalink
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)
>
> On Mon, Aug 13, 2018 at 9:11 AM C. AMAL D. GLELE <***@gmail.com> wrote:
> >
> > 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,
> >
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-mixed-***@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
Mollie Brooks
2018-08-13 18:34:54 UTC
Permalink
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

> On 13Aug 2018, at 15:11, C. AMAL D. GLELE <***@gmail.com> wrote:
>
> 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,
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


[[alternative HTML version deleted]]
C. AMAL D. GLELE
2018-08-13 21:54:12 UTC
Permalink
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 <***@gmail.com>:

> 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
>
> On 13Aug 2018, at 15:11, C. AMAL D. GLELE <***@gmail.com> wrote:
>
> 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,
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>

[[alternative HTML version deleted]]
Ben Bolker
2018-08-19 15:52:54 UTC
Permalink
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:
> 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 <***@gmail.com>:
>
>> 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
>>
>> On 13Aug 2018, at 15:11, C. AMAL D. GLELE <***@gmail.com> wrote:
>>
>> 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,
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-***@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>>
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
D. Rizopoulos
2018-08-19 16:48:05 UTC
Permalink
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 <***@gmail.com<mailto:***@gmail.com>>
Date: Sunday, 19 Aug 2018, 4:46 PM
To: Mollie Brooks <***@gmail.com<mailto:***@gmail.com>>
Cc: R SIG Mixed Models <r-sig-mixed-***@r-project.org<mailto:r-sig-mixed-***@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 <***@gmail.com>:

> 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
>
> On 13Aug 2018, at 15:11, C. AMAL D. GLELE <***@gmail.com> wrote:
>
> 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,
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-***@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>

[[alternative HTML version deleted]]

_______________________________________________
R-sig-mixed-***@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

[[alternative HTML version deleted]]
Loading...