Skip to content
GetProfitable
Search
Dictionary

Cross-validation

Splitting data into several folds and repeatedly training on some while testing on the rest, so every observation gets used for testing once.

Standard cross-validation was designed for independent observations, which financial time series are not. Neighbouring days share overlapping information, and a label built from the next five days' returns overlaps the next four labels.

Applied naively this leaks. A model trained on Tuesday and tested on Wednesday has effectively seen most of Wednesday's answer. The fix is not to abandon cross-validation but to add purged-cross-validation and an embargo-period.

Even done properly, cross-validation on markets gives you variance estimates more than truth. Five folds all showing Sharpe between 0.8 and 1.2 is reassuring; five folds showing 2.1, 0.1, 1.4, minus 0.3, 0.9 tells you the average is not a stable number.

Related: k-fold-cross-validation, purged-cross-validation, embargo-period, data-leakage

Educational only, not advice. Spotted an error? Post in Site Feedback.