Learn R Programming

tfarima (version 0.4.1)

ucm: Unobserved Components Time Series Models

Description

ucm creates an S3 object representing an UC model:

Usage

ucm(
  z,
  bc = FALSE,
  uc = NULL,
  xreg = NULL,
  cform = TRUE,
  fit = TRUE,
  s = 12,
  ...
)

Value

An object of class ucm and class ssm.

Arguments

z

an object of class ts.

bc

logical. If TRUE, logs are taken.

uc

list of objects of class uc or a character with the name of a predefined model: "llm" local linear model, "lltm" local linear trend model, "bsm" basic structural model, "bsmd" basic structural model with dummy seasonality.

xreg

optional design matrix of regressors.

cform

logical. If TRUE, observation equation is given in contemporaneous form (j = 0); otherwise it is written in lagged form (j = 1).

fit

logical. If TRUE, model is fitted.

s

integer, seasonal period. Optional argument to create a UC model without providing a time series.

...

additional parameters for the fit.ssm function.

Details

z(t) = b'*x(t) + T(t - j) + S(t - j) + C(t - j) + AR(t - j) + I(t),

where z(t) is a time series; x(t) is a set of regressors; T(t - j), S(t - j), C(t - j), AR(t - j) and I(t) are the trend, seasonal, cycle, autoregressive and irregular unobserved components; and i indicates whether the model is written in lagged form (j = 1) or contemporaneous form (j = 0). See uc and ssm for more details.

References

Durbin, J. and Koopman, S.J. (2012) Time Series Analysis by State Space Methods, 2nd ed., Oxford University Press, Oxford.

Harvey, A.C. (1989) Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge University Press, Cambridge.

Examples

Run this code
# Local level model
ucm1 <- ucm(Nile, uc = "llm")
ucm1

Run the code above in your browser using DataLab