[R-sig-ME] glmmADMB question
Ben Bolker
bbolker at gmail.com
Tue Jan 10 17:59:28 CET 2017
(please keep r-sig-mixed-models in Cc: list)
On Tue, Jan 10, 2017 at 9:14 AM, Jennifer Botting
<jlb53 at st-andrews.ac.uk> wrote:
> Thank you for the reply and advice; I tried blme and it worked using the
> following (there are 7 levels to my fixed effect):
>
>
> m <- bglmer(Ges~ Condition+(1|Subject),data=Dat,
> family=poisson,
> fixef.prior = normal(cov = diag(9,7)))
>
> However, when I tried to use different outcome variables, some models again
> failed to converge with the following error :
>
> In get("checkConv", lme4Namespace)(attr(opt, "derivs"), opt$par, :
> Model failed to converge with max|grad| = 0.73863 (tol = 0.001, component
> 1)
>
> Do you think that this is something that can be fixed by adjusting the
> controls within bglmer?
>
> Thank you very much for the advice,
> Jenny
Maybe (?) try tightening the priors a little bit? I think I would
also try out the advice under ?convergence : try substituting a
different optimizer and see whether you get similar-enough results.
If so, don't worry about the convergence warning.
cheers
Ben Bolker
>
> On 8 January 2017 at 10:19, Ben Bolker <bbolker at gmail.com> wrote:
>>
>>
>> A few suggestions:
>>
>> - your "crazy" parameters below, and your statement that
>>
>> Some issues with my data are that for one of the conditions, the count
>> of Ges was 0 for all subjects. Similarly, for some subjects, the count
>> for Ges was 0 across all conditions.
>>
>> suggest that you have an issue of complete separation (e.g. see
>>
>> <http://stats.stackexchange.com/questions/128742/mixed-logistic-model-with-complete-separation>;
>> however, the solutions listed there don't currently work in glmmADMB or
>> glmmTMB ... are you sure you need zero-inflation? Lots of zeros doesn't
>> necessarily mean zero-inflation (it could just mean a Poisson/NB with a
>> very low mean)
>>
>> The options I know of for handling complete separation in GLMMs in R
>> include the blme package (can do anything glmer does, but *not* NB
>> models - although you could approximate that via a logNormal-Poisson
>> model); MCMCglmm; and brms. The latter two can handle zero-inflated
>> models, but take you into the deep (Bayesian) end of the pool ...
>>
>> On 17-01-08 09:32 AM, Jennifer Botting wrote:
>> > Hi,
>> >
>> > I'm having trouble running a ZIPGLMM in glmmADMB. I am comparing the
>> > number of behaviours exhibited by 12 individuals over 7 conditions. Each
>> > subject was tested 4 times.
>> >
>> >> str(Dat)
>> > 'data.frame': 329 obs. of 26 variables:
>> > $ Subject : Factor w/ 12 levels "Baraka","Batang",..: 11 11 11 11
>> > 11
>> > 11 11 11 11 11 ...
>> > $ Sex : Factor w/ 2 levels "F","M": 1 1 1 1 1 1 1 1 1 1 ...
>> > $ History : Factor w/ 2 levels "HR","MR": 1 1 1 1 1 1 1 1 1 1 ...
>> > $ Session : int 1 2 3 4 1 2 3 4 1 2 ...
>> > $ Order : int 3 1 1 4 5 5 5 2 1 2 ...
>> > $ Condition : Factor w/ 7 levels "A ","B","BE",..: 1 1 1 1 2 2 2 2 3
>> > 3
>> > ...
>> > $ Voc: int 0 0 0 0 7 1 5 5 6 3 ...
>> > $ Non : int 0 0 0 0 0 0 0 0 0 0 ...
>> > $ Fac : int 0 0 0 0 0 0 0 0 0 0 ...
>> > $ Ges : int 0 0 0 0 0 0 0 1 0 0 ...
>> > ...............................
>> >
>> > The data include a very large number of zeros, so I tried the following
>> > formula in glmmADMB, starting with Ges as my outcome variable:
>> >
>> > *> m <- glmmadmb(formula = Ges ~ Condition + (1 | Subject), data = Dat,
>> > family = "poisson", zeroInflation = TRUE) *
>> >
>> > and got the following error:
>> >
>> > Parameters were estimated, but standard errors were not: the most likely
>> > problem is that the curvature at MLE was zero or negative
>> > Error in glmmadmb(formula = Ges~ Condition + (1 | Subject), data = Dat,
>> > :
>> > The function maximizer failed (couldn't find parameter file)
>> > Troubleshooting steps include (1) run with 'save.dir' set and inspect
>> > output files; (2) change run parameters: see '?admbControl';(3) re-run
>> > with
>> > debug=TRUE for more information on failure mode
>> > In addition: Warning message:
>> > running command 'C:\windows\system32\cmd.exe /c glmmadmb -maxfn 500
>> > -maxph
>> > 5 -noinit -shess' had status 1
>> >
>> > When I ran it with debug=TRUE, I got the following output:
>> >
>> > Parameters were estimated, but standard errors were not: the most likely
>> > problem is that the curvature at MLE was zero or negative
>> > run failed: Initial statistics: 7 variables; iteration 0; function
>> > evaluation 0; phase 1 Function value 3.7639324e+002; maximum gradient
>> > component mag 1.2938e+001 Var Value Gradient |Var Value
>> > Gradient |Var Value Gradient 1 0.00000 1.2938e+001 | 2
>> > 0.00000 9.7086e-001 | 3 0.00000 1.6197e+000 4 0.00000
>> > -2.6734e+000
>> > | 5 0.00000 -5.9309e-002 | 6 0.00000 -2.6798e+000 7 0.00000
>> > -4.9402e-001 | - final statistics: 7 variables; iteration 7; function
>> > evaluation 10 Function value 3.2460e+002; maximum gradient component
>> > mag
>> > -8.0580e-005 Exit code = 1; converg criter 1.0000e-004 Var Value
>> > Gradient |Var Value Gradient |Var Value Gradient 1
>> > -7.41263 1.8275e-006 | 2 -0.58080 3.4938e-005 | 3 -0.99038
>> > 1.6835e-005
>> > 4 1.59079 8.0028e-005 | 5 0.06984 3.2566e-005 | 6 1.63706
>> > -8.0580e-005 7 0.32457 7.7648e-005 | Initial statistics: 8
>> > variables;
>> > iteration 0; function evaluation 0; phase 2 Function value
>> > 3.2460159e+002;
>> > maxi... <truncated>
>> > Error in glmmadmb(formula = Ges ~ Condition + (1 | Subject), data = Dat,
>> > :
>> > The function maximizer failed (couldn't find parameter file)
>> > Troubleshooting steps include (1) run with 'save.dir' set and inspect
>> > output files; (2) change run parameters: see '?admbControl';(3) re-run
>> > with
>> > debug=TRUE for more information on failure mode
>> > In addition: Warning message:
>> > running command 'C:\windows\system32\cmd.exe /c glmmadmb -maxfn 500
>> > -maxph
>> > 5 -noinit -shess' had status 1
>> > restored working directory to I:/xxxxx
>> > removed temp directory
>> > C:\Users\BO~1\AppData\Local\Temp\1\RtmpiwJxjv\glmmADMB12a03acd7a0c
>> >
>> >
>> > I tried adding another fixed effect and the model ran, but gave crazy
>> > values for the condition levels:
>> >
>> > Call:
>> > glmmadmb(formula = Ges ~ Condition + History + (1 | Subject),
>> > data = Dat, family = "poisson", zeroInflation = TRUE)
>> >
>> > AIC: 257.9
>> >
>> > Coefficients:
>> > Estimate Std. Error z value Pr(>|z|)
>> > (Intercept) -91.28 91007.00 0.00 0.999
>> > ConditionB 89.63 91007.00 0.00 0.999
>> > ConditionBE 88.69 91007.00 0.00 0.999
>> > ConditionEYC 91.28 91007.00 0.00 0.999
>> > ConditionF 90.54 91007.00 0.00 0.999
>> > ConditionFE 91.17 91007.00 0.00 0.999
>> > ConditionHA 89.59 91007.00 0.00 0.999
>> > HistoryMR -2.48 1.02 -2.43 0.015 *
>> > ---
>> > Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>> >
>> > Number of observations: total=329, Subject=12
>> > Random effect variance(s):
>> > Group=Subject
>> > Variance StdDev
>> > (Intercept) 1.837 1.355
>> >
>> > Zero-inflation: 0.15369 (std. err.: 0.13609 )
>> >
>> > Log-likelihood: -118.968
>> > Warning message:
>> > In .local(x, sigma, ...) :
>> > 'sigma' and 'rdig' arguments are present for compatibility only:
>> > ignored
>> >
>> >
>> >
>> > I tried changing some controls that people had suggested online, such as
>> >
>> > *admb.opts=admbControl(shess=FALSE,noinit=FALSE)*
>> >
>> > but this didn't work with my model.
>> >
>> > Some issues with my data are that for one of the conditions, the count
>> > of
>> > Ges was 0 for all subjects. Similarly, for some subjects, the count for
>> > Ges
>> > was 0 across all conditions.
>> >
>> > I'd be extremely grateful if you had any advice.
>> >
>> > Jenny
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > R-sig-mixed-models at r-project.org mailing list
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> >
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
>
>
> --
> ________________________________________
>
> Jennifer Botting, PhD Student
> Centre for Social Learning and Cognitive Evolution
> University of St Andrews
> KY16 9JP
More information about the R-sig-mixed-models
mailing list