Skip to contents

Calculate the Residuals From an INLA Model

Usage

# S4 method for class 'inla'
residuals(
  object,
  type = c("pearson", "deviance", "working", "response", "partial"),
  ...
)

Arguments

object

An inla object.

type

Currently only Pearson residuals are available. Other types are only listed for compatibility with the default residuals function.

...

Currently ignored.

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)
)
residuals(model)
#>  [1]  0.58661542  1.48910067 -1.21835510 -0.31586984 -0.01504142 -1.21835510
#>  [7] -0.61669826 -1.51918351  0.28578700  1.18827225  0.28578700 -0.01504142
#> [13]  1.18827225  1.18827225 -0.31586984  0.88744384 -0.61669826  0.28578700
#> [19] -1.21835510 -0.31586984