residuals.mpmm: residuals

View source: R/residuals.mpmm.r

residuals.mpmmR Documentation

residuals

Description

Extract one-step-ahead residuals

Usage

## S3 method for class 'mpmm'
residuals(
  object,
  method = "oneStepGaussianOffMode",
  trace = FALSE,
  parallel = TRUE,
  ncores = detectCores() - 1,
  ...
)

Arguments

object

an mpmm fit object

method

character naming the method to calculate one-step-ahead residuals

trace

logical; print progress to console

parallel

logical; compute in parallel

ncores

integer; number of cores to use (default = total cores detected - 1)

...

additional arguments to be ignored

Details

Wrapper function for modified oneStepPredict that calculates one-step-ahead residuals, which are residuals that account for temporal correlation in latent states. The modification allows easier parallel computation.

Value

a list with components

res

a tibble with one-step-ahead residuals for longitude and latitude

References

Thygesen, U. H., C. M. Albertsen, C. W. Berg, K. Kristensen, and A. Neilsen. 2017. Validation of ecological state space models using the Laplace approximation. Environmental and Ecological Statistics 24:317–339.

Examples

## Not run: 
data(ellie.ice)
fit <- mpmm(~ ice + (1 | id), data = ellie.ice)
summary(fit)
residuals(fit)

## End(Not run)

ianjonsen/mpmm documentation built on Dec. 7, 2022, 4:27 a.m.