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 |
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 |
boundary_method |
a single character value; it indicates, what bandwidth
method to use at boundary points; for |
season |
the seasonal period in |
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)
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn University),
Author and Package Creator
Examples
est <- llin_decomp(log(EXPENDITURES), bwidth_trend = 4, bwidth_season = 28)
est