Next Up Previous Contents Index
Next: Weighted moving averages Up: Calculating moving averages Previous: Calculating moving averages

Simple moving averages

The n day simple moving average for day d is computed by:

A_d  =  \frac{\sum_{i=1}^{n} M_{(d-i)+1}}{n}, n\leq d

If we have ten measurements, M1 through M10, and we wish to compute a four day moving average, the moving averages for successive days are:

A_4 = (M_4+M_3+M_2+M_1)/4, A_5 = (M_5+M_4+M_3+M_2)/4, ... A_{10} = (M_{10}+M_9+M_8+M_7)/4

We can't compute a four day moving average until we have four days worth of data. That's why the first moving average in this example is A4.


By John Walker