Calculates a posterior dispersion metric.
dispersion(model, summary = FALSE, seed = 10)
An object of class bayesnecfit
whose distribution
family is either poisson
or
binomial
.
Logical. Should summary stats be returned instead of full vector? Defaults to FALSE.
Change seed for reproducible purposes.
A numeric
vector. If summary
is FALSE, an
n-long vector containing the dispersion metric, where n is the number of post
warm-up posterior draws from the brmsfit
object. If
TRUE, then a data.frame
containing the summary stats
(mean, median, 95% highest density intervals) of the dispersion metric.
This function calculates a dispersion metric which takes the ratio between the observed relative to simulated Pearson residuals sums of squares.
Zuur, A. F., Hilbe, J. M., & Ieno, E. N. (2013). A Beginner's Guide to GLM and GLMM with R: A Frequentist and Bayesian Perspective for Ecologists. Highland Statistics Limited.