[R-sig-ME] glmmADMB errors

Ben Bolker bbolker at gmail.com
Fri Oct 20 17:49:42 CEST 2017


Following up on this: the proximal problem is that you have specified
Protection as both a random and a fixed effect, because the nesting
syntax (1|Protection/Location) expands to
(1|Protection)+(1|Protection:Location). I agree with Mollie that it's
generally less confusing to give unique values to the Location
variable, but if not then I would expect

Biomass~Protection+Exposure+Protection:Exposure+
  (1|Protection:Location)

to work better.


On Fri, Oct 20, 2017 at 8:10 AM, Mollie Brooks <mollieebrooks at gmail.com> wrote:
> Sorry, I didn't see in your email that you had tried the Gamma distribution
> in glmmADMB.
>
> The cause of the error may have been the nesting of the random effect. In
> my opinion, the nesting notation causes confusion quite often and it's best
> to just give each of the 8 locations (i.e. RE levels) a unique name. If, on
> the other hand, there are only 4 unique locations and both treatments are
> in the same location, then location should be a fixed effect because 4
> levels is too few for a random effect.
>
> If you're fitting a zero-inflated model, you might have better luck with
> convergence if you allow the zero-inflation to vary with parameters.
>
> I would try these models if there are 8 uniquely coded locations
> m1 <- glmmTMB(Biomass ~ Protection * Exposure +(1|Location),
> data=dataGLMMADMB, family=Gamma(link="log"))
>
> m2 <- glmmTMB(Biomass ~ Protection * Exposure +(1|Location),
> zi =~ Protection * Exposure,
> data=dataGLMMADMB, family=Gamma(link="log"))
>
> On Fri, Oct 20, 2017 at 1:51 PM, Mollie Brooks <mollieebrooks at gmail.com>
> wrote:
>
>> Hi Andreu,
>>
>> A zero-inflated Poisson distribution is not appropriate because biomass is
>> not count data. I would recommend checking what distribution other
>> researchers in your field are using. Maybe you want to first model zero vs
>> non-zero and then model the non-zero biomasses separately. The log of
>> non-zero biomasses could be modeled with a normal distribution. Or on the
>> natural scale, they could be Gamma or Tweedie. Or maybe a zero-inflated
>> continuous positive distribution (e.g. Gamma or Tweedie) makes sense for
>> all of the biomasses. These zero-inflated models could be fit in glmmTMB.
>>
>> cheers,
>> Mollie
>>
>> On Thu, Oct 19, 2017 at 2:03 PM, andreu blanco <andreu.blanco at gmail.com>
>> wrote:
>>
>>>  Dear list members, I am starting with generalized mixed models and I am
>>> having some trouble I hope someone could help me with.
>>>
>>> We are trying to understand the invasiveness of algae inside and outside
>>> MPA, to do so our sampling was set with a nested desing:
>>>
>>> Protected vs nonProtected
>>> 4 Locations (protected) vs 4 Locations (nonProtected)
>>> Exposed vs Semiexposed at each location
>>> 1 transect per sampling point (total 16)
>>> 5 quadrants per transect
>>>
>>> str(dataGLMMADMB)
>>> 'data.frame':   80 obs. of  4 variables:
>>>  $ Location: Factor w/ 4 levels "Cies1","Cies2",..: 1 1 1 1 1 1 1 1 1 1
>>> ...
>>>  $ Protection: Factor w/ 2 levels "Control","Protected": 1 1 1 1 1 2 2 2 2
>>> 2 ...
>>>  $ Exposure: Factor w/ 2 levels "Exposed","Semiexposed": 1 1 1 1 1 1 1 1 1
>>> 1 ...
>>>  $ Biomass: num  124.8 104.8 139.2 102.6 62.9 ...
>>>
>>>
>>> First I ran it as a Poission distribution (after round the Biomass values)
>>> to be able to fit a zeroInflation model:
>>> > Model_ADMB_P<-glmmadmb(Biomass~Protection+Exposure+Protectio
>>> n:Exposure+(1|
>>> Protection/Location),data=GLMMADMB_P, zeroInflation=TRUE,
>>> family="Poisson")
>>> 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(Biomass ~ Protection + Exposure + Protection:Exposure +
>>> :
>>>   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
>>> Además: Warning message:
>>> comando ejecutado 'C:\WINDOWS\system32\cmd.exe /c glmmadmb -maxfn 500
>>> -maxph 5 -noinit -shess' tiene estatus 1
>>>
>>> Then I though that since my data is continuous I'd better run the model
>>> with a gamma family, however, when I do run it with gamma I got the
>>> following error:
>>> > Model_ADMB_G<-glmmadmb(Biomass~Protection+Exposure+Protectio
>>> n:Exposure+(1|
>>> Protection/Location),data=GLMMADMB_P, family="gamma")
>>>
>>> Error in glmmadmb(Biomass ~ Protection + Exposure + Protection:Exposure +
>>> :
>>>   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
>>> Además: Warning message:
>>> comando ejecutado 'C:\WINDOWS\system32\cmd.exe /c glmmadmb -maxfn 500
>>> -maxph 5 -noinit -shess' tiene estatus 1
>>>
>>> However, when I run it as a Poisson distribution with zeroInflated values
>>> but with no nested design and Location effect either, it ran ok
>>> > Model_ADMB_P1<-glmmadmb(Biomass~Protection*Exposure,data=GLMMADMB_P,
>>> zeroInflation=TRUE, family="Poisson")
>>> > summary(Model_ADMB_P1)
>>>
>>> Call:
>>> glmmadmb(formula = Biomass ~ Protection * Exposure, data = GLMMADMB_P,
>>>     family = "Poisson", zeroInflation = TRUE)
>>>
>>> AIC: 1570.7
>>>
>>> Coefficients:
>>>                                          Estimate Std. Error z value
>>> Pr(>|z|)
>>> (Intercept)                              4.71e+00   3.18e-02   148.0
>>>  <2e-16
>>> ProtectionProtected                     -5.53e-01   5.00e-02   -11.1
>>>  <2e-16
>>> ExposureSemiexposed                     -3.83e+01   2.22e+05     0.0
>>> 1
>>> ProtectionProtected:ExposureSemiexposed  3.64e+01   2.22e+05     0.0
>>> 1
>>>
>>> (Intercept)                             ***
>>> ProtectionProtected                     ***
>>> ExposureSemiexposed
>>> ProtectionProtected:ExposureSemiexposed
>>> ---
>>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>>>
>>> Number of observations: total=80
>>> Zero-inflation: 0.30908  (std. err.:  0.071433 )
>>>
>>> Log-likelihood: -780.37
>>> >
>>>
>>>
>>> I can not understat the solutions to these errors, can anyone please help
>>> me out?
>>> I really appreciate it!
>>>
>>> Thanks in advance,
>>>
>>> --
>>> Andreu Blanco Cartagena
>>>
>>>
>>>
>>> Si no és imprescindible, no imprimeixis aquest e-mail. Estalviar paper
>>> ajuda a protegir el medi ambient.
>>>
>>> Si no es imprescindible, no imprimas este e-mail. Ahorrar papel ayuda a
>>> proteger el medio ambiente.
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-mixed-models at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
>>
>>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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