Learn R Programming

MARSS (version 3.9)

residuals.marssMLE: MARSS Standardized Residuals

Description

Calculates the standardized (or auxilliary) residuals sensu Harvey, Koopman and Penzer (1998).

Usage

# S3 method for marssMLE
residuals(object,...)

Arguments

object

An object of class marssMLE.

...

Not used.

Value

A list with the following components

model.residuals

The smoothed model residuals y(t)-E(y(t)|y(1:T),Theta), where Theta is the set of model parameters. Sometimes called the smoothations. This is different than the Kalman filter innovations which are y(t)-E(y(t)|y(1:t-1),Theta).

state.residuals

The smoothed stated residuals E(x(t)|y(1:T))-E(x(t)|E(x(t-1)|y(1:T))).

residuals

The model residuals as a (n+m) x TT matrix with model.residuals on top and model.residuals below. model.residuals is hat(eta_t) on page 112 of Harvey, Koopman and Penzer (1998).

var.residuals

The variance of the model residuals as a (n+m) x (n+m) x TT matrix. This is var(hat(model.residuals)).

std.residuals

The standardized model residuals as a (n+m) x TT matrix. This is residuals divided by the square root of var.residuals --- 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
# NOT RUN {
  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