A forecast is a claim about the future, and the future is the one thing you cannot peek at. So the entire discipline rests on one habit: split in time, fit on the past, and score on data the model has never seen. Get that right and the models themselves form a short ladder, from a naive baseline you must beat, up through exponential smoothing and ARIMA, each adding one more piece of structure.
Never shuffle a time series. Train on the earlier part and test on the most recent part, so the evaluation mimics real forecasting. And always beat a baseline: if a fancy model cannot beat “same month last year”, it is not earning its complexity.
Backtesting, Baselines & the Horizon
Before any model, set up the test honestly and draw the line every model has to clear.
A baseline is the forecast a five-year-old could make. The naive method repeats the last value; the seasonal-naive method repeats the value from one season ago (same month last year). On our data the naive forecast scores a poor 13.6% MAPE while seasonal-naive, capturing the yearly wave for free, hits 4.1%, that 4.1% is the bar. Just as important is the horizon: a static (one-step-ahead) forecast quietly uses the real value at each step and looks great, while a dynamic (multi-step) forecast feeds its own predictions forward and its error grows the further out you look. Evaluate at the horizon you will actually forecast.
Moving Averages & Exponential Smoothing
The first real family builds a forecast from a fading average of the past, then adds back the structure a plain average throws away.
A moving average smooths the series but forecasts a flat line. Simple exponential smoothing (SES) improves on that by weighting recent points more, with weights that decay geometrically (one rate, alpha), yet it still has no trend or season and predicts a flat line too (13.6% MAPE here). Holt adds a trend term; Holt-Winters adds a seasonal term as well, and because this series' seasonal swing grows with its level, the multiplicative Holt-Winters wins outright at 2.8% MAPE. The lesson from the Components of a Time Series chapter returns: match additive vs multiplicative to the data.
ARIMA & SARIMA
The other great family does not smooth; it models the correlations directly, using exactly the stationarity and autocorrelation ideas from the last chapter.
ARIMA(p, d, q) stacks three ideas: AR(p) regresses on the p most recent values,
I(d) differences the series d times to make it stationary, and MA(q) regresses on the
q most recent forecast errors. SARIMA adds a seasonal copy (P, D, Q) at the season's
lag s. Fitting SARIMA(1,1,1)(1,1,1,12) forecasts our holdout at 3.7% MAPE, also beating
the baseline, and, being a full statistical model, it hands back a prediction interval that
Holt-Winters does not. Which of the two wins is usually a coin toss, so fit both and let the holdout decide.
Real-World Example: Forecasting Airport Passengers
The companion notebook runs the whole ladder on a ten-year passenger series, holding out the final year and scoring every model with MAPE.
Monthly passengers at a growing regional airport, 120 observations from
January 2014 to December 2023, with a clear upward trend and strong multiplicative yearly seasonality (summer peak,
winter trough). Columns: month and passengers. The last 12 months are the test set.
- ●Baseline: seasonal-naive scores 4.1% MAPE, the bar to beat (plain naive is 13.6%).
- ●Winner: Holt-Winters (multiplicative) at 2.8%, matching the growing seasonal swing.
- ●Close behind: SARIMA(1,1,1)(1,1,1,12) at 3.7%, and it comes with a 95% prediction interval.
- ●Horizon: the multi-step error grows from about 2% one month out to 3.4% a year out.
Forecasting in Machine Learning & AI
Classical models remain strong baselines, but modern forecasting reframes the problem as machine learning, and, more and more, as a job for large pre-trained models.
| Approach | Idea | Examples |
|---|---|---|
| Classical | Model the components after making the series stationary | Holt-Winters (ETS), ARIMA / SARIMA, this chapter |
| ML regression | Turn the past into columns (lags, rolling stats, calendar parts) and fit a tabular model | Lag features + XGBoost / LightGBM |
| Additive ML | A decomposable model robust to holidays, gaps, and changepoints | Prophet |
| Deep learning | Networks that learn temporal structure and forecast probabilistically | DeepAR, N-BEATS, Temporal Fusion Transformer |
| Foundation models | Pre-trained on many series; forecast a new one zero-shot | TimeGPT, Amazon Chronos, Google TimesFM |
Two shifts define the frontier. First, global models, a single model trained across thousands of related series (all stores, all SKUs) instead of one model per series, which usually wins at scale. Second, time-series foundation models that forecast an unseen series with little or no fine-tuning. Yet the winners of forecasting competitions are still often simple statistical models or their ensembles; the ideas here, baselines, seasonality, and honest backtesting, remain the yardstick every new method is measured against.
Fit the whole ladder in Python
The companion notebook splits the passenger series in time, sets naive and seasonal-naive baselines, fits a moving average and simple exponential smoothing, then Holt-Winters and SARIMA, scores every model with MAPE on the held-out year, draws the SARIMA prediction interval, and contrasts a static one-step forecast with an honest dynamic multi-step one, all with statsmodels.
View opens the rendered notebook instantly.
Open in Colab runs it live. To run locally, install numpy, pandas,
matplotlib, statsmodels, and openpyxl.
🎓 Key Takeaways
- ✓Split in time, never shuffle: fit on the past, test on the most recent stretch, and score with a scale-free metric like MAPE.
- ✓Beat a baseline or stop: seasonal-naive (same period last year) is the bar; here it is 4.1% MAPE.
- ✓Exponential smoothing builds up: SES (level) → Holt (+trend) → Holt-Winters (+season); the multiplicative version won here at 2.8%.
- ✓ARIMA/SARIMA model the correlations: AR values + I differencing + MA errors, plus a seasonal copy, and it returns a prediction interval.
- ✓Static vs dynamic: one-step-ahead flatters the model; multi-step is the honest test and its error grows with the horizon.
Practice Challenges
Five exercises on the passenger series. Full solutions are in the companion solutions notebook.
Baselines
Compute the naive, seasonal-naive, and drift baselines and their MAPE. Which is the bar to beat, and why?
The smoothing ladder
Fit SES, Holt, and Holt-Winters and compare. What does each added component buy you?
SimpleExpSmoothing, Holt, ExponentialSmoothing.Choosing SARIMA orders
Fit two candidate orders, pick by AIC, and forecast 12 months with a 95% interval.
Head to head
Compare Holt-Winters and SARIMA on the same holdout. Is there a universal winner?
The horizon matters
Show that multi-step forecast error grows the further ahead you predict.
Solutions notebook
All five challenges worked in code, baselines, the smoothing ladder, choosing SARIMA orders by AIC, a Holt-Winters versus SARIMA head-to-head, and how error grows with the forecast horizon, each with a short explanation.
Quiz: Test Yourself
Eight questions on baselines, smoothing, ARIMA, and the forecast horizon. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved.
These models assume a fairly steady variance. When the volatility itself moves, as in financial returns, you need more. Volatility & Advanced Models covers ARCH/GARCH, the ACF/PACF toolkit for order selection, unit-root tests, and Granger causality.