The measure is calculated as the average of the squared Pearson residuals
See also
Other statistics:
dgpoisson()
,
fitted,inla-method
,
get_observed()
,
residuals,inla-method
Examples
library(INLA)
#> Loading required package: Matrix
#> Loading required package: sp
#> This is INLA_24.06.27 built 2024-06-27 02:36:04 UTC.
#> - See www.r-inla.org/contact-us for how to get help.
#> - List available models/likelihoods/etc with inla.list.models()
#> - Use inla.doc(<NAME>) to access documentation
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.7825792