get_anomaly | R Documentation |
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.
get_anomaly(object, n = 10)
## S4 method for signature 'inla'
get_anomaly(object, n = 20)
object |
the INLA model |
n |
the number of anomalies per criterion.
Defaults to |
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.
Other checks:
dispersion_check()
,
distribution_check()
,
fast_aggregation_check()
,
fast_distribution_check()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.