Apply a 3-month moving average to a noisy monthly series and explain what smoothing does.
Apply a 3-month moving average to a noisy monthly series and explain what smoothing does.
pandas rolling(window=3).mean() is a simple moving average.
Smoothing reduces short-term fluctuation so the underlying movement is easier to see. A moving average replaces each point by the mean of neighbouring points. It can hide sudden genuine shocks.
Constructed 12 monthly values with noise. Teaching data.
A table of original and smoothed values. End points of a centred MA are missing. The smoothed line is less jagged.
The moving average follows the rise but damps month-to-month jumps. Students should notice lost sharpness at turning points.
A moving average reduces short-term fluctuations but may hide sudden changes.