Following DHARMa diagnostic tests revealing zero-inflation (ratioObsSim = 32.663, p < 2.2e-16) and over-dispersion (ratioObsSim = 1.5757, p = 0.104)

I am attempting to run a zero-inflated negative binomial model using the glmmTMB function of the glmmTMB package in R. My model code is in the following format:

model<-glmmTMB(Y~X1 * X2 + (1|R1) + (1|R2), family = "nbinom1", ziformula = ~X1 * X2 + (1|R1) + (1|R2), data = dataset).

X1 and X2 are my fixed effects (one continuous and one categorical) and R1 and R2 are my two fully crossed random effects (one continuous and one categorical). My response variable is also continuous.

When I attempt to run this model the following error appears:

Warning message:
In fitTMB(TMBStruc) :
  Model convergence problem; non-positive-definite Hessian matrix. See vignette('troubleshooting')

I've tried looking at vignette('troubleshooting') to solve the problem however I am still relatively new to R and statistics in general so am not really sure how to proceed in fixing the problem. Any help would be greatly appreciated.

  • 1
    $\begingroup$ It's close to impossible to advise if you don't tell us about your study design, describe your variables and explain your research question(s) $\endgroup$ Aug 18, 2020 at 20:05
  • $\begingroup$ @RobertLong I can't be too specific as my work is part of someone else's project however I am basically looking at how both the magnitude and direction (e.g. increase/ decrease) of changes in certain weather parameters influences insect behaviours. My fixed effects consist of both the absolute change in (continuous variable) and the overall direction of change (categorical variable) in a particular weather parameter e.g. temperature over a given time period. $\endgroup$ Aug 21, 2020 at 21:29
  • $\begingroup$ @RobertLong (continuation of above comment) The majority of insect behaviours looked at are counts of the number of times each behaviour occurs in a given time following a time period of exposure (normally a number of hours prior and up to the behaviour trial) to the changing weather parameter. My fixed effects data was formed from Met Office data that was collected for each day the different insect behaviours were recorded (as part of unrelated experiments). The aim of this work is to determine if insects change their behaviour based on recent experience of changing weather conditions. $\endgroup$ Aug 21, 2020 at 21:31
  • $\begingroup$ But what are R1 and R2 ? It doesn't make sense to have a continuous variable as a grouping factor for random intercepts. $\endgroup$ Aug 21, 2020 at 21:44
  • $\begingroup$ @RobertLong My mistake R1 and R2 are both categorical random effects and correspond to the day on which the behaviours were recorded and treatment. The latter is not necessarily relevant to my weather parameters work but was part of the original experiments in which the behaviours were originally recorded. Most of the behaviour data I am analysing comes from other unrelated studies conducted across a number of years. $\endgroup$ Aug 21, 2020 at 21:58


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.