View source: R/fitting_functions.R
ma_decomp | R Documentation |
Trend and seasonality are modelled in a two-step approach, where first the trend is being estimated using moving averages and then trend + seasonality are being estimated using moving averages. The difference is then the estimated seasonality.
ma_decomp(yt, k_trend = 4, k_season = 5, season = NULL)
yt |
a time series object of class |
k_trend |
the complete absolute bandwidth (in years); represents the data of how many years to use around the estimation time point to consider for trend smoothing. |
k_season |
the complete absolute bandwidth (in years); represents the data of how many years (only from the same quarter, month, etc.) to use around the estimation time point for trend + seasonality smoothing. |
season |
the seasonal period in |
Apply moving averages to estimate trend and seasonality
in a given time series. This approach results in missings NA
at
boundary points.
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 k_trend
.
the same as the input argument k_season
.
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn
University),
Author and Package Creator
est <- ma_decomp(log(EXPENDITURES), k_trend = 6, k_season = 7)
est
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.