Statistics Quest

Moving averages

Averages over a sliding window of consecutive observations that smooth out short-term noise; trailing windows use only the past, centred windows estimate the trend.

MAt=1k∑j=0k−1yt−j\text{MA}_t = \frac{1}{k}\sum_{j=0}^{k-1} y_{t-j}
Trailing moving average of order k
yty_t
observation at time tt
kk
window length (order); the first k−1k - 1 positions have no value
T^t=1m∑j=−(m−1)/2(m−1)/2yt+j    (m odd),T^t=12myt−m/2+1m∑j=−m/2+1m/2−1yt+j+12myt+m/2    (m even)\hat T_t = \frac{1}{m}\sum_{j=-(m-1)/2}^{(m-1)/2} y_{t+j} \;\; (m \text{ odd}), \qquad \hat T_t = \frac{1}{2m}y_{t-m/2} + \frac{1}{m}\sum_{j=-m/2+1}^{m/2-1} y_{t+j} + \frac{1}{2m}y_{t+m/2} \;\; (m \text{ even})
Centred moving average; for even m the 2×m-MA
mm
window length; set it to the seasonal period to remove seasonality
T^t\hat T_t
estimated trend-cycle at time tt; missing at both ends of the series

When to use

  • Trailing MA: monitoring the recent level (e.g. 7-day average of daily sales) or as a naive forecast — it uses only data available at time tt.
  • Centred MA: estimating the trend in a historical series, and as the first step of classical decomposition. With mm equal to the seasonal period (12 for monthly, 4 for quarterly) the seasonal pattern averages out; even periods need the 2×m-MA so the window is centred.

How to interpret

  • Larger windows give smoother curves but react more slowly to genuine changes; a trailing MA lags the series by about (k−1)/2(k-1)/2 periods.
  • The values at the ends are missing by construction: no data exist beyond the end of the series to centre the window.

Common mistakes

  • Using a centred MA in a forecasting or monitoring setting: it looks into the future.
  • A window that is not a multiple of the season, which leaves seasonal ripples in the "trend".
  • Reading the smoothed peak as the actual peak: smoothing flattens peaks and troughs.

Example

Series 12, 15, 14, 18, 17, 21, 20, 24.

  • Trailing 3-MA at t=3t = 3: (12+15+14)/3=13.67(12 + 15 + 14)/3 = 13.67; at t=8t = 8: 21.67.
  • Centred 3-MA at t=2t = 2: 13.67 (same window, placed in the middle).
  • 2×4-MA at t=3t = 3: (12/2+15+14+18+17/2)/4=15.375(12/2 + 15 + 14 + 18 + 17/2)/4 = 15.375; it exists only for t=3,…,6t = 3, \ldots, 6.