Filters may be applied to a time series for a variety of reasons. Suppose that a time series consists of a long-term movement, a trend, upon which is superimposed an irregular component. A moving average filter will smooth the series revealing the trend more clearly.
Assume that is the filtered version of the series. Then
The weights of a moving average filters add up to one i.e. . The simplest such filter is the uniform moving average for which:
The gain of such filter is
The Moving Average filter removes a cycle of period n together with its harmonics.
The corresponding detrended series is
The weights sum up to zero ( thus
Bear also in mint that
is the seasonal weight function.
If is an process with the a.c.g.f. of is given by
where is the spectrum of
and thus we can show that
which for the complement of a simple moving average filter equals
Example: Detrended Random Walk