stsm: Structural Time Series models

View source: R/stsm.R

stsmR Documentation

Structural Time Series models

Description

stsm creates an S3 object representing a time-invariant structural time series model.

Usage

stsm(y, b, C, fSv, s2v, s2u = 1, xreg = NULL, bc = FALSE, fit = TRUE, ...)

Arguments

y

an object of class ts.

b

vector of constants.

C

matrix of constants.

fSv

function to create the covariance matrix of v_t.

s2v

variances of the vector error v_t in the state equation.

s2u

variance of the error u_t in the observation equation.

xreg

matrix of regressors.

bc

logical. If TRUE logs are taken.

fit

logical. If TRUE, model is fitted.

...

other arguments.

Details

y_t = b'x_t + u_t (observation equation), x_t = Cx_t-1 + v_t (state equation).

Value

An object of class stsm.

References

Durbin, J. and Koopman, S.J. (2012) Time Series Analysis

Examples

# Local level model
b <- 1
C <- as.matrix(1)
stsm1 <- stsm(Nile, b, C, s2v = c(lvl = 0.5), s2u = c(irr = 1))
stsm1

tfarima documentation built on May 20, 2022, 5:06 p.m.