View source: R/fitting_functions.R
llin_decomp | R Documentation |
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.
llin_decomp(
yt,
bwidth_trend = 4,
bwidth_season = 5,
kernel_par = 1,
boundary_method = c("extend", "shorten"),
season = NULL
)
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 |
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.
An S4 object with the following elements is returned.
an object of class "mts"
that consists of the
decomposed time series data.
the object name of the initially provided time series object.
the frequency of the time series.
the same as the input argument bwidth_trend
.
the same as the input argument bwidth_season
.
the same as the input argument boundary_method
.
the same as the input argument kernel_par
.
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn
University),
Author and Package Creator
est <- llin_decomp(log(EXPENDITURES), bwidth_trend = 4, bwidth_season = 28)
est
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.