Moving Average & Exponential Smoothing

Firstly, download the excel file called " HSI 900102 000915" from the "Sample Data" of Econ3600 homepage.

Second, open EVIEWS program in this way: click "file", "new", "workfile" commands, then the following "Workfile Range" will be appeared. Choose "undated and irregular" and type the dates for the "Start observation" and "End observation" in the dialogue box as follow. 

After click "OK" and get this "Workfile"

Next, click "Procs", "Import", and "Read Text-Lotus-Excel" to import the data from the external Excel file. And type series name and upper-left data cell in the dialogue boxes as following. Notice the "A2" in the dialogue box represents the sample data starts at the upper-left cell "A2" in the Excel file.

By clicking "OK" and get:

After click "OK", now it is ready to generate the Moving Average and Exponential Smoothing series for the Heng Seng Index (hsi) daily data.

For Simple Moving Average (SMA), for example, the forecasting model of SMA(4) is :

Ft =  (At-4 + At-3 + At-2 + At-1) / 4

The one-period SMA forecast (express in terms of graph) can be obtained by double click the "hsi", and get the following data table:

Click "View", "Line graph", it shows the time plot graph of the series of "hsi" as following: The "hsi" data is a random series and moves up and down without constant mean or constant variance which implies the "hsi" is random walk series.

Generating the simple moving average series:

If we want to generate a 25-periods moving average series, named SMA(25), to forecast of period 26, how can we do?

Simply: click "Genr" and type "smahsi25=@movav(hsi,25)" in the dialogue box:

After click the "OK", the "smahsi25" will be added into the "workfile".

Go through similar steps, some different period moving average series, such as SMA(50), SMA(100) and SMA(200), named"smahsi50", "smahsi100", "smahsi200" respectively, can be generated and added into the "workfile".

In order to make the work more easy to understand, we simply pick up the sample sizes from 2500 to 2794 by clicking "Sample" and type "2500  2754" in the dialogue box:

What are the different moving average series look like? Choose the selected moving series and click "Show", "View", "Line graph", and get the following time plot graph:

What conclusion can be drawn from the graph?

From the graph above, we can see that the longer moving-averages smooths the randomness of the series more. The SMAHSI200 line is smoother than the SMAHSI100 line. Moreover, for random walk series like the "hsi" data, a shorter-period moving average forecasted series would yield a lower error because the shorter-period moving average line is closer to the actual data when comparing with the others.

Generating the Double moving average series:

In order to generate the Double Moving Average (DMA) series, simply click the "Genr"  and type "dmahsi25=@movav(smahsi25,25)" in the dialogue box for the double moving average of 25-period series. (Do it in EVIEWS by yourself)

¡@

Generating exponential smoothing series:

For generating a Simple Exponential Smoothing (SES) series, the forecasting model is:

Where the alpha is between zero and 1. The value of alpha is arbitrary..

How to determine an optimal alpha? Try several different values of alpha and obtain the result for the forecasted value with a minimal Root Mean of Squared Error (RMSE), so as to choose the optimal model for SES.

The steps in EVIEWS are as follows:

First, change the sample range back to from 1 to 2794.

Double click "hsi" and pop up with the following data table,

Then, click the "Procs" and choose "Exponential Smoothing", get the following window:

Since we are want to find out the optimal SES to make prediction, we need to change the some options in the above dialogue box. For "Smoothing Method", chooses "Single"; for "Smoothing Parameters, Alpha", types "0.1" as an selected arbitrary smoothing constant; for "Cycle for Seasonal", changes the default setting "5" to "0" because we do not consider seasonality now. Then we get

After clicking "OK" and get

Then, we need to record the RMSE for this SES model, that is 447.1354  so as to compare with other SES model with different selected values of alphas.

Holding everything constant, if we choose another SES model by changing alpha from "0.1" to "0.5", the result is as follows:

Now, when the selected alpha is 0.5, the result shows that the RMSE is 219.73 which is smaller than the previous one where alpha is 0.1.

Further, if we choose another SES model by changing alpha from "0.1" to "0.9", the result is:

At this point, when the alpha is 0.9, the RMSE is 188.38 which is the smallest among the three selected SES models.

What conclusion can we reach?

Since we know  the "hsi" data is random walk series, if we want to use the Simple Exponential Smoothing model to make a forecast, we should choose a higher values of alpha to construct a better fitted SES model. (Remark: If the sample series is a autoregressive series and/or a more smoothed series, then we should choose a smaller value of alpha to construct a better fitted SES model)

The End