Use simulations to compare the observed distribution with the modelled distribution

distribution_check(object, nsim = 1000)

# S4 method for inla
distribution_check(object, nsim = 1000)

Arguments

object

the INLA model

nsim

the number of simulation

See also

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), control.compute = list(config = TRUE) ) distribution_check(model)
#> # A tibble: 28 x 6 #> x median lcl ucl n ecdf #> <int> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 0 0 0 0 0 #> 2 2 0 0 0.00125 0 0 #> 3 3 0 0 0.05 0 0 #> 4 4 0 0 0.1 0 0 #> 5 5 0.05 0 0.15 0 0 #> 6 6 0.05 0 0.25 1 0.05 #> 7 7 0.15 0 0.35 3 0.2 #> 8 8 0.2 0.05 0.45 0 0.2 #> 9 9 0.35 0.1 0.6 2 0.3 #> 10 10 0.45 0.2 0.75 3 0.45 #> # ... with 18 more rows