The measure is calculated as the average of the squared Pearson residuals

dispersion(observed, fitted, variance)

Arguments

observed

the observed values

fitted

the fitted values

variance

the variance of the fitted values

See also

Examples

library(INLA)
#> Loading required package: Matrix
#> Loading required package: sp
#> This is INLA_18.07.12 built 2018-07-20 09:17:00 UTC. #> See www.r-inla.org/contact-us for how to get help. #> To enable PARDISO sparse library; see inla.pardiso()
set.seed(20181202) model <- inla( poisson ~ 1, family = "poisson", data = data.frame( poisson = rpois(20, lambda = 10), base = 1 ), control.predictor = list(compute = TRUE) ) dispersion( observed = get_observed(model), fitted = fitted(model), variance = fitted(model) )
#> [1] 0.7807657