Learn R Programming

tfarima (version 0.4.1)

decomp.ssm: Unobserved components decomposition

Description

Estimates the unobserved components of a time series (trend, seasonal, cycle, stationary, and irregular) based on the structure of an underlying model. The estimation can be carried out through the UCARIMA representation, the state-space model (SSM) form, or via forward/backward forecasts.

Usage

# S3 method for ssm
decomp(mdl, tol = 1e-05, ...)

# S3 method for tfm decomp( mdl, y = NULL, method = c("mixed", "forecast", "backcast"), envir = NULL, ... )

# S3 method for ucarima decomp(mdl, ...)

decomp(mdl, ...)

# S3 method for um decomp( mdl, z = NULL, method = c("ucarima", "ucarima0", "ssm", "ssm0", "mixed", "forecast", "backcast"), envir = parent.frame(), ... )

# S3 method for um decomp( mdl, z = NULL, method = c("ucarima", "ucarima0", "ssm", "ssm0", "mixed", "forecast", "backcast"), envir = parent.frame(), ... )

Value

A data.frame with the estimated unobserved components.

Arguments

mdl

An object of class um or tfm, representing a univariate ARIMA or transfer function model.

tol

numeric tolerance for classifying eigenvalues.

...

Additional arguments passed to internal methods.

y

an object of class ts.

method

Character string specifying the decomposition method. Options are:

  • "ucarima", "ucarima0" – using the UCARIMA representation, without or with the canonical requirement.

  • "ssm", "ssm0" – using the state-space model representation, with multiple sources of error (MSOE) or a single source of error (SSOE), respectively.

  • "mixed" – combining forward and backward forecasts.

  • "forecast", "backcast" – using the forward or backward eventual forecast function. The last three options are deprecated and will be removed in a future release.

envir

environment in which the function arguments are evaluated. If NULL the calling environment of this function will be used.

z

an object of class ts.

Details

The function applies the corresponding internal routines to estimate the components depending on the chosen method. For UCARIMA-based methods, the Wiener–Kolmogorov filter is used. For state-space approaches, a Kalman smoother is applied.

Examples

Run this code
Z <- AirPassengers
um1 <- um(Z, i = list(1, c(1, 12)), ma = list(1, c(1, 12)), bc = TRUE)
uc1 <- decomp(um1, method = "ucarima")

Run the code above in your browser using DataLab