Walk-forward validation
Train on the past, test on a later period, then move forward.
Library note. Check the assumptions and further reading before applying a formula.
What Is This?
Walk-forward validation preserves time order. Fit the model on an earlier window, freeze the fitted choices and score it on a later window. Then move the windows forward and repeat. This gives several views of how a model behaves when conditions change, instead of one random split that mixes the past and future.
Try an example
Train using January to June and test on July. Next, train through July and test on August. If each label uses the following month of returns, leave enough space at the boundary to keep those outcomes out of training.
Where it needs care
Repeatedly tuning to the reported test windows turns them into training data. Overlapping labels can still leak information. Keep a record of each trial, account for dependence and reserve genuinely untouched evaluation data.
Historical Context
Forecasters developed the method by moving the forecast date forward and testing again. This is called rolling-origin evaluation. Walk-forward testing brings the same time order to trading and other predictive models.
Real-World Applications
- Evaluate forecasts across several market conditions.
- Compare a frozen rule with realistic retraining schedules.