|
|
|||||||||||||||||
|
This interactive tutorial visualizes Time Series Analysis using Holt-Winters Triple Exponential Smoothing. You can see how a model decomposes a signal into Level, Trend, and Seasonality, and then projects those components into the future with a confidence interval. Mathematical Foundation1. Time series decomposition A time series yt can be expressed as the sum of three components: yt = Levelt + Trendt + Seasonalt + Noiset The Level (L) is the baseline value, the Trend (T) is the slope (how much the series increases or decreases per step), and the Seasonal (S) component captures repeating cyclic patterns. Noise is the random component. 2. Holt-Winters (Triple Exponential Smoothing) The additive Holt-Winters method maintains three "state" variables that evolve over time, controlled by three smoothing parameters α, β, γ ∈ [0, 1]:
where m is the seasonal period (e.g. 12 steps for monthly data with yearly seasonality). 3. Smoothing parameters
4. Parameter estimation (Nelder-Mead) In practice, α, β, γ are not set by hand — they are estimated by the algorithm. The standard approach is to minimize the Sum of Squared Errors (SSE) between the fitted values and the observed data: (α*, β*, γ*) = argminα,β,γ ∑t (yt − Ft)² This simulation uses the Nelder-Mead (Downhill Simplex) algorithm, a derivative-free optimizer that maintains a simplex of 4 vertices in (α, β, γ) space. At each iteration, it evaluates the SSE at each vertex and applies one of four geometric operations to replace the worst vertex:
The simplex converges when all vertices have nearly equal SSE, meaning the algorithm has found the minimum. Use the Step Fwd/Bwd buttons to watch this process unfold, seeing each decision and its formula. 5. Confidence interval The 95% forecast confidence interval is estimated as Ft+k ± 1.96 × σresid × √(1 + 0.05k), where σresid is the standard deviation of the in-sample residuals. The interval widens with the forecast horizon, reflecting increasing uncertainty about the future. 6. Synthetic data generation The simulation generates synthetic data using: yt = trend × t + A × sin(2πt / m) + noise. By controlling trend, amplitude, and noise, you can see how well the Holt-Winters model captures known ground truth.
Historical
Fitted (HW)
Forecast
95% CI
Level
Level+Trend
Seasonal
Residuals (Actual − Fitted)
Holt-Winters Equations (Additive)
Level: Lt = α(yt − St−m) + (1−α)(Lt−1 + Tt−1)
Trend: Tt = β(Lt − Lt−1) + (1−β)Tt−1
Seasonal: St = γ(yt − Lt) + (1−γ)St−m
Forecast: Ft+k = Lt + k·Tt + St−m+k
Step-by-Step Parameter Estimation — —
Press Step Fwd to walk through the Nelder-Mead simplex optimization: each iteration chooses Reflect, Expand, Contract, or Shrink to find better (α, β, γ).
Data Synthesis
0.50
12
5
30
Model Parameters — Estimated (SSE-minimized)
0.40
0.15
0.30
MSE
—
MAE
—
Residual σ
—
Forecast End
—
How to read this: The blue line is the raw historical data. The amber/yellow line is the Holt-Winters fit. The red dashed line is the forecast, surrounded by a shaded 95% confidence band. Click “Show Components” to see the decomposed Level (green), Level+Trend (orange), and Seasonal (purple) components.
Auto-Fit: The model parameters α, β, γ are automatically estimated by minimizing the Sum of Squared Errors (SSE) using the Nelder-Mead simplex algorithm. When you change the data, parameters are re-estimated. Dragging a slider manually enters “Manual Override” mode — click “Re-estimate” to return to automatic fitting.
UsageUse the controls to explore how Holt-Winters decomposes and forecasts time series data:
Visualizations
Summary Panel
Key Insights
|
|||||||||||||||||