Use simulations to check for overdispersion or underdispersion
Source:R/dispersion_check.R
dispersion_check.Rd
Use simulations to check for overdispersion or underdispersion
Usage
dispersion_check(object, nsim = 1000)
# S4 method for class 'inla'
dispersion_check(object, nsim = 1000)
See also
Other checks:
distribution_check()
,
fast_aggregation_check()
,
fast_distribution_check()
,
get_anomaly()
Examples
library(INLA)
set.seed(20181202)
model <- inla(
poisson ~ 1,
family = "poisson",
data = data.frame(
poisson = rpois(20, lambda = 10),
base = 1
),
control.predictor = list(compute = TRUE)
)
dc <- dispersion_check(model)
str(dc)
#> List of 2
#> $ data : num 0.784
#> $ model: num [1:1000] 0.599 1.043 0.646 0.862 0.993 ...
#> - attr(*, "class")= chr "dispersion_check"