residuals.ssm: Residuals of fitted state space models

View source: R/stsm.R

residuals.ssmR Documentation

Residuals of fitted state space models

Description

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

Usage

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

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.

Value

A ts object containing the residuals of the SSM.

Examples


# 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)


tfarima documentation built on Nov. 5, 2025, 7:43 p.m.