Learn R Programming

MARSS (version 3.4)

residuals.marssMLE: MARSS standardized residuals

Description

Calculates the standardized (or auxilliary) residuals sensu Harvey, Koopman and Penzer (1998). This is a utility function in the MARSS-package.

Usage

## S3 method for class 'marssMLE':
residuals(object,...)

Arguments

object
An object of class marssMLE. This object must have $par, $model and $kf elements containing MLE parameter estimates from e.g.
...
Not used.

Value

  • A list with the following components
  • vthatThe smoothed model residuals y(t)-E(y(t)|y(1:T),Theta), where Theta is the set of model parameters (Z, A, R, etc). Sometimes called the smoothations. This is different than the Kalman filter innovations which are y(t)-E(y(t)|y(1:t-1),Theta).
  • wthatThe smoothed stated residuals E(x(t)|y(1:T))-E(x(t)|E(x(t-1)|y(1:T))).
  • etThe model residuals as a (n+m) x TT matrix with vthat on top and wthat below. et is hat(eta_t) on page 112 of Harvey, Koopman and Penzer (1998).
  • var.etThe variance of the model residuals as a (n+m) x (n+m) x TT matrix. This is var(hat(eta_t)).
  • std.etThe standardized model residuals as a (n+m) x TT matrix. This is et divided by the square root of var.et --- although the code is using the matrix equivalent of that equation.

Details

Uses the algorithm on page 112 of Harvey, Koopman and Penzer (1998) to compute the standardized model residuals.

References

Harvey, A., S. J. Koopman, and J. Penzer. 1998. Messy time series: a unified approach. Advances in Econometrics 13: 103-144 (see page 112). Koopman, S. J., N. Shephard, and J. A. Doornik. 1999. Statistical algorithms for models in state space using SsfPack 2.2. Econometrics Journal 2: 113-166. (see pages 147-148).

See Also

MARSSkem marssMLE

Examples

Run this code
dat = t(harborSeal)
  dat = dat[c(2,11),]
  MLEobj = MARSS(dat)
  
  #not standardized model residuals
  residuals(MLEobj)$model.residuals

  #standardized (by variance) model & state residuals
  residuals(MLEobj)$std.residuals

Run the code above in your browser using DataLab