ma_decomp {deseats}R Documentation

Decomposition of Time Series Using Moving Averages

Description

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.

Usage

ma_decomp(yt, k_trend = 4, k_season = 5, season = NULL)

Arguments

yt

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

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 yt; by default, the seasonal period is obtained automatically from yt.

Details

Apply moving averages to estimate trend and seasonality in a given time series. This approach results in missings NA at boundary points.

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.

k_trend

the same as the input argument k_trend.

k_season

the same as the input argument k_season.

Author(s)

Examples

est <- ma_decomp(log(EXPENDITURES), k_trend = 6, k_season = 7)
est


[Package deseats version 1.1.0 Index]