Forecasting
Pitfalls
Understand why forecasting models fail: from structural breaks that shatter assumptions to data leakage that inflates accuracy. Learn to spot, prevent, and fix these traps.
What Is Forecasting?
Forecasting uses historical data to predict future values. A simple model might say: the value at time \( t+1 \) depends on past observations:
Two Major Pitfalls
Why This Matters
Every business decision built on a forecast inherits its errors. If the forecast is silently broken, the decisions are too.
Structural Breaks Defined
Detecting Breaks: The Chow Test
The Chow Test checks whether a single regression fits two sub-periods, or whether separate regressions are needed. It compares residual sums of squares:
Data Leakage Defined
Breaks vs Leakage
| Structural Break | Data Leakage | |
|---|---|---|
| Root Cause | External event changes reality | Flawed data pipeline or design |
| When Detected | After deployment (model degrades) | During validation (model seems too good) |
| Effect on Accuracy | Accuracy drops suddenly | Accuracy appears inflated |
| Fix | Retrain, regime detection | Fix data split, remove leaked features |
| Preventable? | Not fully: world is unpredictable | Yes: proper methodology |
Types of Leakage
How to Prevent Pitfalls
Walk-Forward Validation
Example: Spotting a Structural Break
A retailer forecasts monthly sales using a linear trend model: \( \hat{y}_t = \beta_0 + \beta_1 t \). In March 2020, a lockdown occurs. Sales drop 40% overnight.
Example: Spotting Data Leakage
A student builds a model to predict next-quarter revenue. The feature set includes "annual revenue" which is computed after all four quarters are known.
Example: Temporal Leakage
Common Mistakes
Summary of Key Concepts
| Concept | Definition | Key Signal |
|---|---|---|
| Structural Break | Permanent change in the data-generating process | Sudden spike in forecast error |
| Target Leakage | Feature derived from the outcome | Near-perfect \( R^2 \) |
| Temporal Leakage | Shuffled time series split | Unrealistically high test accuracy |
| Feature Leakage | Proxy variable for the target | One feature dominates importance |
| Walk-Forward | Chronological expanding-window validation | Realistic error estimates |
Question 1 of 5
A model that predicts next-month sales uses "annual total sales" as a feature. Annual total includes the month being predicted. This is an example of:
Question 2 of 5
An analyst randomly shuffles daily stock data from 2015-2023 and splits 80/20 for train/test. She reports \( R^2 = 0.94 \). What is the most likely problem?
Question 3 of 5
A restaurant chain's demand model was accurate for years, then suddenly over-predicts by 35% starting March 2020. This is best described as:
Question 4 of 5
Which validation strategy is specifically designed to prevent temporal leakage in time series forecasting?
Question 5 of 5
An analyst normalizes the entire dataset (train + test) before splitting. What type of leakage does this cause?