Formula for exponential smoothing -
St = a.Xt +(1-a).S(t-1)
- St is the value of the smoothed series at time t,
- St-1 is the value of the smoothed series at time t-1,
- Xt is the value of the smoothed series at time t,
- a is a constant between 0 and 1
Worked example, where a=0.3 & 1-a=0.7
|Raw data at time t
||Smoothed data at time t-1
||Smoothed data at time t
||0.3×30 + 0.7×(12) = 17.4
||0.3×25 + 0.7×17.4 = 19.7
||0.3×15 + 0.7×19.7 = 18.3
Notice that, because there are no earlier data, the first point (in this case 12), is unsmoothed - and has a far greater influence than all the other observations. This effect is obvious on the first graph of this set.
Notice also that, because only observations prior to time t are used, this form of smoothing tends to introduce a lag - the smaller a is, the greater this lag tends to be.
The following code produces much the same sort of result using R.