Learn R Programming

tfarima (version 0.4.1)

ucarima: Unobserved components ARIMA models

Description

ucarima creates an S3 object that combines two or more ARIMA models (objects of class um).

Usage

ucarima(
  z = NULL,
  bc = FALSE,
  ucm = NULL,
  ar = NULL,
  xreg = NULL,
  fit = TRUE,
  envir = parent.frame(),
  ...
)

Value

An object of class ucarima.

Arguments

z

an object of class ts or NULL to specify theoretical models.

bc

logical. If TRUE logs are taken.

ucm

a list of um objects specifying the ARIMA models for components such as trend, seasonality, and irregular terms. Alternatively, can be a character string: "ht" for Harvey-Todd seasonal decomposition, or NULL/missing for Harvey-Durbin seasonal decomposition (default when only time series z is provided).

ar

list of stationary AR lag polynomials (lagpol objects).

xreg

matrix of explanatory variables.

fit

logical. If TRUE, model is fitted.

envir

environment.

...

additional arguments.

References

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

Examples

Run this code
trend <- um(i = "(1 - B)", sig2 = c(s2t = 1))
seas <- um(i = "(1+B)", sig2 = c(s2s = 0.05))
irreg <- um(sig2 = c(s2i = 0.75))
uca1 <- ucarima(ucm = list(trend = trend, seas = seas, irreg = irreg))
uca1

# Trigonometric seasonality
uca2 <- ucarima(AirPassengers, bc = TRUE)
uca2

# Dummy seasonality
uca3 <- ucarima(AirPassengers, bc = TRUE, ucm = "ht")
uca3

Run the code above in your browser using DataLab