Skip to content

Combinatorial Purged Cross-Validation

Financial observations often overlap in time. A position opened today may depend on prices observed several days later, so a random split can allow the training sample to contain information connected to the test sample. Combinatorial purged cross-validation builds several train and test arrangements, then removes observations whose information intervals overlap.

The central construction

Suppose the ordered sample is divided into NN groups and each test set contains kk groups. The number of distinct train and test combinations is

(Nk)=N!k!(N−k)!.{N \choose k} = \frac{N!}{k!(N-k)!}.

Here, NN is the number of ordered groups, kk is the number selected for testing, and !! denotes the factorial. The construction produces

ϕ(N,k)=kN(Nk)=(N−1k−1)\phi(N,k)=\frac{k}{N}{N \choose k}={N-1 \choose k-1}

complete test paths when the combinations are arranged so that every group appears equally often. The symbol ϕ(N,k)\phi(N,k) is the number of paths, not a performance score.

Combinatorial train and test pathsSix ordered groups are reused across three example paths. Blue blocks are training groups, orange blocks are test groups, and narrow gray gaps show purged observations.Ordered groups reused across validation pathsPath AG1G2G3G4G5G6Path BG1G2G3G4G5G6Path CG1G2G3G4G5G6traintest

A compact view of three validation paths. Actual purging is determined by observation intervals, not merely by the visible distance between groups.

Purging and the embargo

Purging removes a training observation when its information interval intersects a test interval. An embargo adds a short exclusion period after a test group. These two operations address different forms of temporal connection: direct interval overlap and unusually close observations near a test boundary.

StepWhat changesPurpose
GroupingOrdered observations are placed into NN groupsPreserve time order
Combinationkk groups form each test setCreate varied test conditions
PurgingOverlapping training observations are removedReduce direct information overlap
EmbargoNearby observations after a test group are excludedReduce boundary dependence
Path assemblyTest predictions are joined in time orderCompare several complete histories

This procedure supplies a distribution of validation outcomes. It does not guarantee future profitability, remove every source of dependence, or repair a poorly stated prediction problem.

Validation paths after purging and embargo

The notebooks show both the construction of the splits and the results obtained from them. The first figure shows six of the fifteen train and test combinations used in the example.

Six combinatorial validation splits with training observations in blue, test observations in red, and removed observations in orange.

Blue observations are used for training, red observations for testing, and the narrow orange intervals are removed by purging or the embargo. The removals change with the location of each test set.

The next figure uses public BTC/USDT observations. It compares path accuracy for the standard, bagged, and adaptive versions of the procedure.

Accuracy for standard, bagged, and adaptive combinatorial validation across five paths in a public BTC and USDT example.

Accuracy changes across the five paths, while all three methods remain close to one half. The example illustrates why the variation across paths matters; it is not evidence of future trading performance.

Reading the results

The examples use RiskLabAI 3.2.0 to construct the splits. Each notebook shows the exclusions and path diagnostics directly, making it possible to compare the full set of validation paths instead of relying on one summary score.

Notebooks

All three notebooks are public and have passed full execution checks.

1. Enumerate valid group combinations — Split and path counts
2. Remove temporal overlap and assemble paths — Path-level diagnostics
3. Compare validation paths with a public data example — Figures and summary tables