Hi you all,
I am fitting zero-inflated negative binomial GLMs in BRMS and I wondered about two things.
The first one is the calculation of Pearson residuals: in Alain’s Zuur book about INLA, he actually adjusts residuals of a negative binomial GLM by dividing the difference between observed and expected values according to the hyperdispersion parameter:
#k.pd <- mod$marginals.hyperpar$`size for the nbinomial observations (1/overdispersion)`
#k.pm <- inla.emarginal(function(x) x, k.pd)
#mu3 <- mod$summary.fitted.values[,"mean"]
#E3 <- (d$obs - mu3)/sqrt(mu3 + mu3^2/k.pm)
Do I need to do something similar for residuals in brms, or are they already adjusted for this?
Best,
Jacopo Cerri