Learn R Programming

deseats (version 1.1.0)

trend,decomp-method: Obtain Individual Components of a Decomposed Time Series

Description

The provided methods work for decomposition objects created within this package. They allow the user to retrieve individual components among the estimated ones.

Usage

# S4 method for decomp
trend(object, ...)

# S4 method for decomp season(object, ...)

# S4 method for decomp fitted(object, ...)

# S4 method for decomp residuals(object, ...)

# S4 method for decomp deseasonalize(object, ...)

# S4 method for decomp detrend(object, ...)

Value

These methods return time series objects of class "ts" that represent the corresponding estimated component in the time series originally used in the estimation process.

Arguments

object

the estimation / decomposition object, for example of class "deseats".

...

without further use; implemented for compatibility only.

Details

Apply these functions directly to an estimation object, i.e. the result of a decomposition of a seasonal time series, in order to retrieve individual estimated components.

Examples

Run this code
# \donttest{
Xt <- log(EXPENDITURES)
smoothing_options <- set_options(order_poly = 3)
est <- deseats(Xt, smoothing_options = smoothing_options)
trend_e <- trend(est)           # Trend estimates
season_e <- season(est)         # Seasonality estimates
trend_season_e <- fitted(est)   # Trend + seasonality estimates
resid_e <- residuals(est)       # Residuals (observ. - trend - seasonality)
ts_adj <- deseasonalize(est)    # Seasonally adjusted series
ts_notrend <- detrend(est)      # Detrended series
# }

Run the code above in your browser using DataLab