FREE FINANCIAL EDUCATION
Nested parameter selection
Keep inner validation choices separate from outer evaluation results.
What you will learn
Prerequisites: Distinguish fitting, parameter selection and final evaluation within chronological data.
- Keep inner validation choices separate from outer evaluation results.
- Evaluate the parameter-selection procedure rather than a hindsight winning parameter.
- Compound only the chronological outer test segments.
Mechanism and decision rules
Nested evaluation places parameter selection inside an outer evaluation loop. Within each outer training span, inner training and validation splits choose the configuration using a declared criterion. The chosen pipeline is then refitted using eligible outer-training information and evaluated once on the next outer test segment. Feature transforms, variable selection and cost-model choices belong inside that selection process when they are learned from the data.
For time-ordered trading research, both inner and outer boundaries must respect availability, and overlapping labels require appropriate exclusions. A random-fold example from a general machine-learning library is not automatically an appropriate trading design. The resulting outer curve measures the specified selection procedure, which may choose different parameters over time. Replacing a chosen configuration after inspecting its outer result changes the procedure and contaminates the evaluation.
Worked example · synthetic data
In a hypothetical first outer fold, months 1–12 are available for selection and months 13–15 are held out. Two chronological inner validations give A scores 2% and 0%, versus B scores 1.5% and 1.5%. The declared arithmetic mean selects B, whose outer return is −1%. Even if A would later show +3% outside, that result cannot replace B retroactively. A second outer fold independently selects A from information then available and earns +2%. The actual chosen outer sequence compounds to 0.99×1.02−1=0.98%, rather than the return of the hindsight-best parameter in each segment.
Failure modes and limits
Nested evaluation can still be biased if researchers redesign the whole procedure after repeatedly reading its outer results. Small inner samples create unstable choices, while frequent refitting adds costs and operational risk. Report all outer periods, selected configurations and available data cutoffs. Averaging fold metrics may answer a different question from compounding an executable capital path, especially when periods differ in length or overlap.
Practice case
A new outer-training span supplies inner score pairs A=[0,2], B=[1.5,0.5] and C=[1.1,1.1], in percentage points. The predeclared criterion is the mean score. Which configuration is selected? Its outer return is −0.2%, while B’s retrospectively inspected outer return is +2%. State the result that belongs in the evaluated selection process.
Reveal the worked answer
A and B both average 1%; C averages 1.1%, so C is selected. The outer record must contain C’s −0.2% return. Substituting B’s +2% after seeing both outcomes would use the held-out period to make the selection. The disappointing observation remains useful evidence about the procedure that was actually specified.
Check your understanding
Sources and next steps
The lesson, calculations and synthetic cases are original educational material. References explain underlying contract or chart conventions; none validates the profitability of a trading rule. Actual contract specifications, settlement obligations and charges must be checked before trading.
Explore OHLCV data in the chart lab · Explore volume-at-price and TPO data · Practice library
