Time Series Forecasting
Decompose, fit small, validate honestly
Forecasting is time-series craft: decompose into trend, seasonality, noise; fit the smallest honest model; produce intervals; and validate on a holdout with error metrics.
What you will learn
- Decompose a series into trend, seasonality, noise
- Compare forecasting models with a holdout
- Report error metrics next to every forecast
What is this?
Time series forecasting treats history as a signal: trend (direction), seasonality (repeat pattern), and noise (the wiggles). The craft is decomposing those, fitting the smallest honest model (moving average, exponential smoothing, or a proper ARIMA-family model where the structure demands it), producing an interval, and validating against a holdout so the error metric is real — every forecast comes with its measured miss.
Why do you need it?
- Forecasts without decomposition are mood, not math.
- Small honest models beat grand ones on data scarcity — classic BI reality.
- Holdout validation is what stops the overfit worship.
- Forecasting is a demanded skill in analytics and BI interviews.
Mental model
A tide table (astronomy) vs a surf report (weather)
Deterministic vs stochastic forecast
Tides are near-deterministic — physics pins them; surf is stochastic — waves ride weather noise. Time-series work must first ask which kind of forecast the series supports: the repeatable part (tide = seasonality) versus the noisy part (surf = residual). Forecasting = decompose the tame, measure the wild.
How it works
- Decompose: separate trend, season, remainder (moving average or STL-style).
- Model fit: choose by structure — naive baseline, smoothing, or ARIMA-family with tuned orders.
- Interval: standard error on the residual → a range, not a line.
- Holdout: fit on a training window, measure on unseen — honest error.
- Report: error metric (MAE/MAPE) next to the forecast; drift watch for model degradation.
The forecast pipeline, validated.
Examples
Model selection discipline
SERIES monthly orders, 24 mo, weekly seasonDECOMPOSE trend up, seasonal repeat (Dec spike), remainder smallMODELS naive -> MAE 11% (carry last value) smooth -> MAE 6% (exp smoothing, alpha tuned) ARIMA(1,1,1)-> MAE 5.7% (marginally better)CHOOSE smooth + season — small, stable, cheap to runREPORT 6% MAE on holdout; range ±8% for 3 mo out; re-validate each month (drift alert).Compare against a naive baseline, pick the smallest model that earns its place, publish error and interval.
In production
- Demand forecasting for a warehouse: monthly + seasonality, holdout-MAE in the report header.
- A call-volume forecast sizes staffing by half-days with interval bands.
- A finance cadence forecasts cash by week with a drift re-check monthly.
Best practices
- Always beat the naive baseline, or don't ship the model.
- Report error on a holdout, never on the fit itself.
- Fit the smallest model that holds; ARIMA only where structure demands.
- Watch drift: recompute error rolling, alert when it regresses.
Common mistakes
- Validation on the training fit — everyone's error is fake, that day.
- Shiny ARIMA on 18 months of data that smoothing beats.
- Seasonality ignored because 'monthly data is simple' — Dec spikes eat the forecast.
- Never re-checking drift — good model decays into a hobby.
Debugging tips
- Holdout MAE doubles after a regime shift → drift re-fit; seasonality changed.
- Forecast smooth-then-undershoots spikes → additive season not capturing amplitude; check multiplicative.
- Error 'impossibly low' → leakage from the holdout into fitting; re-slice the split.
Interview checkpoint
Hands-on lab
- Decompose a short monthly series in SQL
- Fit a smoothing-style forecast on a training window
- Score both models on holdout and pick the winner
Compare Smoothing vs Naive on a Holdout
50 min · advanced
Quick quiz
Forecast validation should happen:
A smoothing model can beat a complex ARIMA on short series.