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)
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
.
a time series object of class "ts"
or an object that can be
transformed to that class using as.ts
.
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.
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.
the seasonal period in yt
; by default, the seasonal
period is obtained automatically from yt
.
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn
University),
Author and Package Creator
Apply moving averages to estimate trend and seasonality
in a given time series. This approach results in missings NA
at
boundary points.
est <- ma_decomp(log(EXPENDITURES), k_trend = 6, k_season = 7)
est
Run the code above in your browser using DataLab