An exponentially weighted moving average (EWMA) gives recent observations more influence than older ones. It can smooth a time series for short-term forecasting or track a process mean so that small shifts are easier to detect. section 7.4 section 14.3.5
To update an EWMA, combine the current observation with the previous EWMA: new EWMA = λ × current observation + (1 − λ) × previous EWMA. Initialize it with the first measurement. The smoothing constant λ determines how strongly the latest observation affects the result; the contribution of earlier observations diminishes with each update. Simple exponential smoothing uses the same recent-observation emphasis, with a smoothing parameter α between 0 and 1. section 14.3.5 section 7.4.3
For forecasting, choose the smoothing model to match the patterns visible in the series:
- Simple exponential smoothing (SES) suits data without a clear trend or seasonal pattern. section 7.4.4
- Double exponential smoothing adds a trend component. section 7.4.6
- Holt–Winters adds seasonality as well as trend; its additive and multiplicative variations address different seasonal behavior. section 7.4.4
>>> from statsmodels.tsa.holtwinters import SimpleExpSmoothing >>> ses_model = SimpleExpSmoothing(train).fit()
Fit SES to a time-ordered training series with statsmodels when neither trend nor seasonality is apparent. section 7.4.6
>>> hw_model = ExponentialSmoothing(train, >>> trend = 'add', >>> seasonal = 'add', >>> seasonal_periods = 5).fit()
Fit a Holt–Winters model with additive trend and seasonality. The five-period setting assumes a recurring pattern every five observations; that assumption should be checked against the data. section 7.4.7
Validate forecasts against later observations rather than relying on a smooth-looking fit. In a stock-price example, models are fitted to six months of closing prices and forecast the following month; Holt–Winters and ARIMA are compared using AIC and BIC, then forecasted prices are plotted against actual prices. Stock-price volatility and unpredictable influences limit forecast accuracy. section 7.2.3 section 7.4.7
Figure 14.9 This EWMA chart displays the exponentially weighted moving average of piston ring diameters across 40 samples. The chart shows how the process mean evolves over time, with recent data points having more influence on the chart’s trajectory than older ones. The CL represents the overall EWMA mean, whereas the UCL and LCL indicate the expected range of variation. Data points within these limits suggest the process is under control, whereas any point outside may signal a shift or trend that requires further investigation.
An EWMA chart tracks piston-ring diameters across 40 samples. Its center line and control limits provide context: a crossing may signal a process shift that warrants investigation. section 14.3.5
