[R-sig-ME] Troubleshooting glmmTMB

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Apr 20 01:48:08 CEST 2020


On 4/19/20 9:59 AM, Matteo Sebastianelli wrote:
> Hi everyone!
>
> Hope to be clear enough since this is going to be my fist quest.
> I was running 3 sets of models with glmer, each set of models had a
> different response variable representing number of 3 different species of
> birds counted during transects.

    glmer with Poisson response?

> her.)No problem for the first 2 sets of models
> with glmer, which I then compared with AICc to get the best model. For the
> third species, by far the less counted during the transect, I found that
> the model was underdispersed (~0.6). I decided to switch to genpois glmmTMB
> model which can deal with underdispersed models. The response is not zero
> inflated according to DHARMa testZeroInflation.
    This is not a bad idea, but note that estimates of dispersion can be 
very imprecise (i.e., it may not be as necessary to move away from 
Poisson as you think).

    Do you have reason to suspect zero-inflation or are you just trying 
to cover your bases?

> I used the same approach
> i.e. a set of model with different combinations of predictors which i would
> then compare. The issue is that for few models i get the warning: extreme
> or very small eigenvalues detected. Continuous predictors are already
> scaled.

    Most often this is caused by an extreme parameter, e.g. if you are 
trying to fit zero-inflation with a data set that really doesn't have 
any, or a negative binomial model with equi- or underdispersion

> I then tried to run the function I found in the glmmTMB
> troubleshooting vignette (Example 3) to detect the parameters that
> contribute to the small eigenvalues but i get a warning:
>
> diagnose_vcov(mod2)
> Error in diagnose_vcov(mod2) : can't analyze vcov
> In addition: Warning message:
> In diagnose_vcov(mod2) : analyzing Hessian, not vcov
>
> Do you have any idea how I can overcome the problem?

   Try changing the missing(analyze_hessian)) clause to:


        if (missing(analyze_hessian)) {
             warning("analyzing Hessian, not vcov")
             analyze_hessian <- TRUE
         } else {
             if (!analyze_hessian) stop("can't analyze vcov")
         }

>
> I also have another question. In the models I have an observerID random
> factor with 2 levels, and I know the random factors should have at least
> 5-6 levels. Do you think is ok to include them in the model even though it
> creates a singular fit warning (in glmmTMB i get the non-positive-definite
> Hessian matrix warning)?

    I wouldn't, I'd include it as a fixed effect or leave it out.

>
> Looking forward to hear from you.
>
> Best,
>
> Matteo
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models using 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