llin_decomp {deseats}R Documentation

Decomposition of Time Series Using Local Linear Regression

Description

Trend and seasonality are modelled in a two-step approach, where first the trend is being estimated using local linear regression and then the seasonality is being estimated using various local linear regressions as well. In both cases a manually selected bandwidth is required.

Usage

llin_decomp(
  yt,
  bwidth_trend = 4,
  bwidth_season = 5,
  kernel_par = 1,
  boundary_method = c("extend", "shorten"),
  season = NULL
)

Arguments

yt

a time series object of class "ts" or an object that can be transformed to that class using as.ts.

bwidth_trend

half of the absolute bandwidth (in years); represents the amount of data to use around the estimation time point to consider for trend smoothing.

bwidth_season

half of the absolute bandwidth (in years); represents the amount of data (only from the same quarter, month, etc.) to use around the estimation time point for the seasonality estimation.

kernel_par

the smoothness parameter for the second-order kernel function used in the weighting process; for kernel_par = 0 a uniform kernel is used, for kernel_par = 1 an epanechnikov kernel, and so on.

boundary_method

a single character value; it indicates, what bandwidth method to use at boundary points; for "extend", the default, the smoothing window around boundary points will be extended towards the center of the data; for "shorten", the window width will keep decreasing at boundary points when approaching the very first and the very last observation.

season

the seasonal period in yt; by default, the seasonal period is obtained automatically from yt.

Details

Apply local linear regression to estimate trend and seasonality in a given time series y_t. Assume that y_t follows an additive component model with trend and seasonality components. First, a local linear regression with a first (absolute) bandwidth is conducted to estimate the trend from the series. If the seasonal period is s, then afterwards s local linear regressions (for each individual seasonal subseries of the detrended series) are conducted with a second (absolute) bandwidth to obtain seasonality estimates.

Value

An S4 object with the following elements is returned.

decomp

an object of class "mts" that consists of the decomposed time series data.

ts_name

the object name of the initially provided time series object.

frequency

the frequency of the time series.

bwidth_trend

the same as the input argument bwidth_trend.

bwidth_season

the same as the input argument bwidth_season.

boundary_method

the same as the input argument boundary_method.

kernel_par

the same as the input argument kernel_par.

Author(s)

Examples

est <- llin_decomp(log(EXPENDITURES), bwidth_trend = 4, bwidth_season = 28)
est


[Package deseats version 1.1.0 Index]