Documentation |
On this page… |
---|
You can use a seasonal filter (moving average) to estimate the seasonal component of a time series. For example, seasonal moving averages play a large role in the X-11-ARIMA seasonal adjustment program of Statistics Canada [1] and the X-12-ARIMA seasonal adjustment program of the U.S. Census Bureau [2].
For observations made during period k, k = 1,...,s (where s is the known periodicity of the seasonality), a seasonal filter is a convolution of weights and observations made during past and future periods k. For example, given monthly data (s = 12), a smoothed January observation is a symmetric, weighted average of January data.
In general, for a time series x_{t}, t = 1,...,N, the seasonally smoothed observation at time k + js, j = 1, ...,N/s – 1, is
$${\tilde{s}}_{k+js}={\displaystyle \sum _{l=-r}^{r}{a}_{l}{x}_{k+(j+l)s}},$$ | (2-1) |
with weights $${a}_{l}$$ such that $${\sum}_{l=-r}^{r}{a}_{l}=1.$$
The two most commonly used seasonal filters are the stable seasonal filter and the S_{n × m} seasonal filter.
Use a stable seasonal filter if the seasonal level does not change over time, or if you have a short time series (under 5 years).
Let n_{k} be the total number of observations made in period k. A stable seasonal filter is given by
$${\tilde{s}}_{k}=\frac{1}{{n}_{k}}{\displaystyle \sum _{j=1}^{(N/s)-1}{x}_{k+js},}$$
for k = 1,...,s, and $${\tilde{s}}_{k}={\tilde{s}}_{k-s}$$ for k > s.
Define$$\overline{s}=(1/s){\displaystyle {\sum}_{k=1}^{s}{\tilde{s}}_{k}}.$$ For identifiability from the trend component,
Use $${\widehat{s}}_{k}={\tilde{s}}_{k}-\overline{s}$$ to estimate the seasonal component for an additive decomposition model (that is, constrain the component to fluctuate around zero).
Use $${\widehat{s}}_{k}={\tilde{s}}_{k}/\overline{s}$$ to estimate the seasonal component for a multiplicative decomposition model (that is, constrain the component to fluctuate around one).
To apply an S_{n × m} seasonal filter, take a symmetric n-term moving average of m-term averages. This is equivalent to taking a symmetric, unequally weighted moving average with n + m – 1 terms (that is, use $$r=(n+m-1)/2$$ in Equation 2-1).
An S_{3×3} filter has five terms with weights
$$\left(1/9,2/9,1/3,2/9,1/9\right).$$
To illustrate, suppose you have monthly data over 10 years. Let Jan_{yy} denote the value observed in January, 20yy. The S_{3×3}-filtered value for January 2005 is
$$\widehat{J}a{n}_{05}=\frac{1}{3}\left[\frac{1}{3}\left(Ja{n}_{03}+Ja{n}_{04}+Ja{n}_{05}\right)+\frac{1}{3}\left(Ja{n}_{04}+Ja{n}_{05}+Ja{n}_{06}\right)+\text{\hspace{0.17em}}\frac{1}{3}\left(Ja{n}_{05}+Ja{n}_{06}+Ja{n}_{07}\right)\right].$$
Similarly, an S_{3×5} filter has seven terms with weights
$$\left(1/15,2/15,1/5,1/5,1/5,2/15,1/15\right).$$
When using a symmetric filter, observations are lost at the beginning and end of the series. You can apply asymmetric weights at the ends of the series to prevent observation loss.
To center the seasonal estimate, define a moving average of the seasonally filtered series, $${\overline{s}}_{t}={\displaystyle {\sum}_{j=-q}^{q}{b}_{j}{\tilde{s}}_{t+j}}.$$ A reasonable choice for the weights are$${b}_{j}=1/4q$$ for j = ±q and $${b}_{j}=1/2q$$ otherwise. Here, q = 2 for quarterly data (a 5-term average), or q = 6 for monthly data (a 13-term average).
For identifiability from the trend component,
Use $${\widehat{s}}_{t}={\tilde{s}}_{t}-{\overline{s}}_{t}$$ to estimate the seasonal component of an additive model (that is, constrain the component to fluctuate approximately around zero).
Use $${\widehat{s}}_{t}={\tilde{s}}_{t}/{\overline{s}}_{t}$$ to estimate the seasonal component of a multiplicative model (that is, constrain the component to fluctuate approximately around one).
[1] Dagum, E. B. The X-11-ARIMA Seasonal Adjustment Method. Number 12–564E. Statistics Canada, Ottawa, 1980.
[2] Findley, D. F., B. C. Monsell, W. R. Bell, M. C. Otto, and B.-C. Chen. "New Capabilities and Methods of the X-12-ARIMA Seasonal-Adjustment Program." Journal of Business & Economic Statistics. Vol. 16, Number 2, 1998, pp. 127–152.