Skip to contents

Use simulations to check for overdispersion or underdispersion

Usage

dispersion_check(object, nsim = 1000)

# S4 method for class 'inla'
dispersion_check(object, nsim = 1000)

Arguments

object

the INLA model

nsim

the number of simulation

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"