get_anomaly: Get a set of anomalies of the model

get_anomalyR Documentation

Get a set of anomalies of the model

Description

Returns a named list with an element called observations and one element for every random effect. The random effect components use the name of the random effect.

Usage

get_anomaly(object, n = 10)

## S4 method for signature 'inla'
get_anomaly(object, n = 20)

Arguments

object

the INLA model

n

the number of anomalies per criterion. Defaults to 10.

Details

observations is a subset of the original data.frame. It contains the rows with the n largest and n smallest values of the Pearson residuals. The random effect components contain a subset of the random effects. Here we select the rows with the n largest and n lowest values of the mean.

See Also

Other checks: dispersion_check(), distribution_check(), fast_distribution_check()

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 <- get_anomaly(model, n = 2)
str(dc)

inbo/inlatools documentation built on Sept. 17, 2022, 2:13 p.m.