A pairs model whose label is "did the spread converge within ten days" will score well in ordinary cross-validation even if its features are noise, and the desk will fund it. Standard -fold cross-validation partitions the dataset into folds, trains on , and tests on 1, cycling through all folds. In finance this fails: financial returns are serially correlated and overlapping labels (returns spanning multi-day windows) create information leakage from the testing set into the training set. A classifier trained on observations that inadvertently share information with the test set will overestimate its out-of-sample performance — even if the test fold was never explicitly seen during training.
Purged -fold CV (López de Prado) fixes this with two operations: purging (removing training observations whose labels overlap with any testing label) and embargoing (removing training observations that immediately follow the test set, whose features still carry test-period information). The interval rule and the exclusion ledger were introduced in Purging and Embargoes. This note keeps that rule and works out what it means for a relative-value book: labels that run from a trade's entry to its exit, a panel in which every stock shares the same dates, and features estimated over a trailing window.
Learning objectives. By the end of this note you should be able to:
- identify the two sources of leakage in standard k-fold CV (label overlap, serial correlation);
- define purging and state which training observations are removed;
- define embargoing and select an appropriate embargo length ;
- implement the Purged K-Fold CV procedure algorithmically;
- apply both operations to a cross-sectional panel and to pair trades with variable holding periods;
- use the behaviour of the score as increases as a check for remaining leakage.
In this lesson
-
- Why standard k-fold CV fails in finance
-
- Purging
-
- Embargoing
-
- Purging a relative-value panel
-
- Effect on k-fold performance estimation
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or browse the Statistical Arbitrage syllabus.