Learn R Programming

tfarima (version 0.4.1)

residuals.ssm: Residuals of fitted state space models

Description

residuals.ssm generates the residuals of a fitted ssm object.

Usage

# S3 method for ssm
residuals(object, method = c("exact", "cond"), ...)

Value

A ts object containing the residuals of the SSM.

Arguments

object

an object of class ssm.

method

character. Either "exact" or "conditional" residuals.

...

additional arguments.

Details

These residuals are calculated by first converting the ssm object to a um object and then using the residuals.um function.

Examples

Run this code

# Local level model
b <- 1
C <- as.matrix(1)
ssm1 <- ssm(Nile, b, C, S = diag(c(irr = 15127.7, lvl = 1453.2)))
u <-residuals(ssm1)

Run the code above in your browser using DataLab