Formula used
N is the observation count. I is the initial training size. H is the test window, G is the effective gap, and S is the step size.
For rolling validation, each training start moves forward. Expanding validation keeps the original training start.
How to use this calculator
- Enter the observation count or upload a CSV file.
- Select an expanding, rolling, sliding, anchored, or prequential strategy.
- Set training, testing, horizon, step, gap, and embargo values.
- Choose the model, retraining policy, preprocessing, and primary metric.
- Optionally provide actual and predicted values for metric calculations.
- Review folds, leakage notices, charts, recommendations, and exports.
Example validation schedule
| Fold | Training indices | Testing indices | Purpose |
|---|---|---|---|
| 1 | 0–59 | 60–71 | Initial twelve-period forecast |
| 2 | 0–71 | 72–83 | Expanded training history |
| 3 | 0–83 | 84–95 | Later out-of-sample evaluation |
Frequently asked questions
What is walk-forward validation?
It evaluates time-ordered models using repeated training and future testing windows. The method imitates real forecasting more closely than random splitting.
When should I use an expanding window?
Use it when older observations remain informative. Every new fold adds more historical training data.
When should I use a rolling window?
Use it when recent behaviour matters more. It limits training history and can respond better to drift.
How should I choose the initial training size?
Include enough observations for stable fitting and seasonal coverage. Complex models usually require longer initial windows.
What does the step size control?
It controls how far the validation origin advances. Smaller steps create more folds and possible overlap.
Why add a train-test gap?
A gap helps separate training features from future labels. It can reduce leakage with delayed or overlapping targets.
What is an embargo period?
An embargo excludes nearby observations around validation boundaries. It is useful when target information overlaps through time.
Can this calculator train an ARIMA or LSTM model?
It plans validation and evaluates supplied predictions. Model training should run in your preferred machine-learning environment.
How are per-fold metrics assigned?
Complete dataset predictions use test indices directly. Shorter series are assigned sequentially when every fold horizon is present.