The Moving Average Smoothing
A moving average replaces each point with the average of nearby points inside a sliding window. It is the simplest way to see a trend through noisy data.
How the window works
- Choose a window size, such as seven days.
- For each position, average the values inside the window.
- Slide the window forward one step and repeat.
A larger window smooths more aggressively but reacts slowly to real changes. A smaller window stays responsive but leaves more noise.
Centered and trailing
- A centered moving average uses points before and after the current time, which is great for analysis but uses future data.
- A trailing moving average uses only past points, which is required when forecasting in real time.
What it is good for
Smoothing exposes the trend and dampens random spikes. It can also serve as a crude baseline forecast by carrying the last average forward. Be aware that it lags behind sharp turns and cannot capture seasonality on its own.
Key idea
A moving average trades responsiveness for smoothness, revealing the trend by averaging a sliding window of values.