Moving Average

Moving averages and means to smoothen noisy (time series) data, unearthing the underlying trends. The process is also known as filtering the data.

Moving averages (MA) are a series of averages estimated on a pre-defined number of consecutive data. For example, MA5 contains the set of all the averages of 5 successive members of the original series. The following relationship represents how a centred or two-sided moving average is estimated.

MA5 = (Xt-2 + Xt-1 + Xt + Xt+1 + Xt+2)/5

‘t’ represents the time at which the moving average is estimated. t-1 is the observation just before t, and t+1 means one observation immediately after t. To illustrate the concept, we develop the following table representing consecutive 10 points (electric signals) in a dataset.

DateSignal
172.5052
270.6720
362.4502
457.4714
555.3151
658.0904
762.6202
863.2485
960.5846
1056.3154

The centred MA starts from point 3 (the midpoint of 1, 2, 3, 4, 5). The value at 3 is the mean of the first five points (72.5052 + 70.6720 + 62.4502 + 57.4714 + 55.3151) /5 = 63.68278.

DateSignalAverage
172.5052
270.6720
362.450263.68278
457.4714
555.3151
658.0904
762.6202
863.2485
960.5846
1056.3154

This process is continued – MA on point 4 is the mean of points 2, 3, 4, 5 and 6, etc.

DateSignalMA
172.5052
270.6720
362.450263.68278
[1-5]
457.471460.79982
[2-6]
555.315159.18946
[3-7]
658.090459.34912
[4-8]
762.620259.97176
[5-9]
863.248560.17182
[6-10]
960.5846
1056.3154

The one-sided moving average is different. It estimates MA at the end of the interval.
MA5 = (Xt-4 + Xt-3 + Xt-2 + Xt-1 + Xt)/5

DateSignalMA
172.5052
270.6720
362.4502
457.4714
555.315163.68278
[1-5]
658.090460.79982
[2-6]
762.620259.18946
[3-7]
863.248559.34912
[4-8]
960.584659.97176
[5-9]
1056.315460.17182
[6-10]

We will look at the impact of moving averages in the next post.