Moving Averages and Time-series Forecasting
One of the well known approaches to forecasting is the use of the Moving Averages. But what is the Moving Average and what effects does it have on time series?
What is a Moving Average
A Moving Average (MA) is a mathematical sum carried over the time series. In general the MA is a weighted MA in the sense that each term of the sum bears a weight that is used in the sum itself that thus becomes a weighed sum. In mathematical terms an m period MA of the time-series y with weighting coefficient for lag s is the following expression:
This is the most general equation for a MA whichever the subtype is; it is thus valid for Exponential Moving Averages, Triangular MA, Parabolic MA, etc… the only things that varies is how the weights are calculated. If the weighting coefficients are uniform that is:
we obtain the classical and overused Simple Moving Average. This is a simple yet effective algorithm that has been used for ages in forecasting and even today with so much computing power these are (or variations of these) are the algorithms that are used everywhere to produce forecasts and predictions in every human field. But what are the statistical effects of applying the Moving Average algorithm to the time-series?
Statistical Effects of the Moving Average and the Convolution Theorem
To explain the statistical effects of the MA we need to introduce a little bit of math that may not be familiar to many of you. Lets consider the Discrete Fourier Transform (DFT) of the original time-series y:
and suppose the original time-series were replaced with an m period MA over past values as defined before:
The DFT of the obtained time-series would then be (using the Convolution Theorem):
where
If we use the uniform weighting introduced in the previous paragraph (i.e. we use the Simple Moving Average) then the previous equation becomes (after some math):
The value of this expression
will then be zero!
Thus, taking an m period Simple Moving Average of the time-series has completely destroyed the evidence for an m period periodicity. So if we take a 12 month Simple Moving Average of our time-series then this will completely destroy the evidence of a yearly periodicity in the smoothed time-series. This is not evident until we write some basic math like we did here and if you go further down analyzing the results of the Convolution Theorem you will notice also other values where the periodicity is completely distorted not only in amplitude like in this case but also in phase.
This effect is usually ignored and you will find a lot of “statisticians” that have never studied enough mathematics to understand this effect and that are still using this algorithm (or some of the family like Exponential Moving Averages) for time-series predictions.
The only thing that can be accomplished using Simple Moving Averages is to make the graph of our time-series look better at our poor human eye and the time-series less usable by a computer program.