distribution_check: Use simulations to compare the observed distribution with the...

distribution_checkR Documentation

Use simulations to compare the observed distribution with the modelled distribution

Description

Use simulations to compare the observed distribution with the modelled distribution

Usage

distribution_check(object, nsim = 1000, seed = 0L)

## S4 method for signature 'inla'
distribution_check(object, nsim = 1000, seed = 0L)

Arguments

object

the INLA model

nsim

the number of simulation

seed

See the same argument in ?inla.qsample for further information. In order to produce reproducible results, you ALSO need to make sure the RNG in R is in the same state, see example below. When seed is non-zero, num.threads is forced to "1:1" and parallel.configs is set to FALSE, since parallel sampling would not produce a reproducible sequence of pseudo-random numbers.

See Also

Other checks: dispersion_check(), fast_aggregation_check(), fast_distribution_check(), get_anomaly()

Examples


library(INLA)
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, seed = 20181202)


inbo/inlatools documentation built on Oct. 10, 2024, 8:11 a.m.