This article is in continuation with classical decomposition. Simple Moving Averages (MA) are part of classical decomosition when Exponential MA are the next level of classical decomposition. Overall, MA smoothes the data around its fluctuations. Just like the classical one, these MA also can be used to forescast the data for short term.
a) Simple Moving Average
Mean, median, geometric mean are all also measures of central tendancy but cannot be used in a data with trend. An alternative way to summarize the past data is to compute the mean of successive smaller sets of numbers of past data as follows (NIST/SEMATECH, 2012),
Here, X is the time series variable. Mt is the moving average at period t. N is the order of the moving average. The order of moving average must be calculated based on the length of seasonality. For a monthly data, the order is 12; for a weekly data the order can be four or five; for a daily data the order is seven. This method is called Simple Moving Average (SMA) and the process is called “smoothing” (i.e., some form of averaging). This smoothing process is continued by advancing one period and calculating the next average of N numbers, dropping the first number. Take a look at Figure 1. When the order increases the smoothing also increases.
The figure below presents the Time series data with 20 data points or index. Moving average of order 3 is calculated using MS Excel Data analysis. An error in general is the difference between actual data and forecast or prediction. Absolute error (IeI) is caculated by using the 'ABS' function. An average of Absolute error is called as Mean Absolute Average (MAE). The mean of error square is called as Mean Squared error (MSE). Note that MSE is not calculated with absolute error. MSE and MAE is highlighted with blue colour. The order of MA which provides the least error value is the best fitting order. Different measures of error will soon be uploaded in this website. The cell highlighted in green colour is the forecast for 21st data point which itself is a MA(3) of last three data points [(465.33+310.33+591)/3)].
Fig.2
b) Centered Moving Averages
In case of even order MA, one more step have to be followed to centre the MA. Consider, a monthly data whose order is an even number (12). Now, one more second order moving average (2-MA) step have to be followed. By this step, the MA results will be centered. For the same 20 years data, CMA is applied and presented below. The initial order of MA is 4 which is an even number. Hence, once again, a MA of order 2 is calculated to centre the data. Excel always places the MA at the last row of the order. The interpretation and calculations of forecast & errors are similar to SMA.
Fig.3
c) Exponential Moving Averages
Exponential moving averages (EMAs) operates on the assumption that the value in a data point is highly influenced by the recent past values and lesser by the past values farther to it. Becasue of this assumption, EMA reduces the influence of lags by applying more weight to recent values. The weighting applied to the most recent value depends on the number of periods in the moving average. There are three steps in calculating an EMA.
First, calculate the simple moving average for the initial EMA value. An exponential moving average (EMA) has to start somewhere, so a simple moving average is used as the previous period's EMA in the first calculation.
Second and third step is to calculate the weighting multiplier and apply into EMA equation.
As EMA uses the previous value of the EMA in its calculation, the impact of all the past data will be included within its current value. However, the newest data has the most impact on the Moving Average and the oldest data has only a minimal impact. Interpreting EMA is similar to that of SMA. On one side, it can help you identify trends earlier than an SMA would. On the flip side, the EMA will probably experience more short-term changes than a corresponding SMA. All moving averages, including the EMA, are not designed to forecast at the exact bottom and top. Moving averages may help in the general direction of a trend, but with a delay at the entry and exit points. The EMA has a shorter delay than the SMA with the same period. EMA is slightly different from Single Exponential Smoothing in the way the current year value (Xt) is considered for EMAt calculation and assumption for initial values (EMA t-1). EMA is calculated for the same example data and presented in Figure 4.
d) Weighted Moving Average
Weighted Moving Average is similar to EMA only the weights are not based on a formula but by judgement. The total weights must be equal to one. The order of MA is based on the seasonal duration. If the order of MA is 3, then three weights will be assigned, W1, W2 and W3. W3 is the weight of recent past data and the weight will be higher for W3. The weights decreases in the order W3 >W2>W1. However, W3+W2+W1 should be equal to one. WMA is calculated for the same example data and presented in Figure 5.
Verdict
So which is best model: choose the best moving average model for the example data based on the least error value. The error value is least in EMA model. Hence EMA model is chosen for this example data. For a multiplicative model or a data with exponential trend line, EMA is the best fitting moving average. The best fitting trend line for a particular data is the one with highest R squared value.
Moving Averages in Tools
MA can be computed in menu driven format even in MS Excel. MS Excel --> Data Analysis --> Moving Average. Moving Average graph also can be drawn in Excel. Insert a simple line graph --> Add a trend line --> Moving Average --> enter the order and click ok.
Moving Averages can be run in most of econometric software tools.
Well, if this article helps you to understand, why don't you test it by attempting a short quiz.
Comments