The deflated Sharpe ratio and backtest overfitting
Skill positionModule 4 of 4 · Topic 2 of 3
4.2 The deflated Sharpe ratio and backtest overfitting
—Lab score— / 100Total XP—Streak—
A great Sharpe ratio, found among hundreds
The Sharpe ratio is the mean excess return divided by its standard deviation. From daily data it is annualised by 252: a daily mean of 0.05% and daily volatility of 1% give a daily ratio of 0.05 and an annual ratio of 0.05252≈0.79. Like any estimate it has a standard error, roughly (1+SR2/2)/T for T years of data: even a true Sharpe of 0.8 measured over four years is only known to about ±0.57, so two strategies with Sharpe 0.8 and 0.3 are statistically hard to tell apart.
Now try N strategies. Even if every one has zero true Sharpe, the estimates scatter around zero with spread σSR, and the best of them is positive and grows with N, roughly σSR2lnN. With a spread of 0.5 and 100 trials, the best is expected near 0.52ln100≈1.52 from luck alone. This is backtest overfitting. The deflated Sharpe ratio (Bailey and López de Prado) corrects the observed best Sharpe for the number of trials, the skewness and kurtosis of returns and the sample length. In this topic's simplified form: subtract the expected best-of-N noise before believing the number.
Sharpe numbersDaily mean 0.05% and daily volatility 1%: SR=0.05252≈0.794. With SR=0.8 over T=4 years, SE≈(1+0.32)/4≈0.574. Among 100 strategies with noise spread 0.5, the expected best is 0.52ln100≈1.517. If your best backtest shows SR=1.5, the deflated value is about 1.5−1.0=0.5 when the expected best-of-N noise is 1.0: half of the headline number is explained by luck.
Sharpe ratio: mean excess return over volatility; annualise daily data by 252.
Best of N: noise alone gives a best Sharpe near σSR2lnN.
Defences: record every trial, keep a final holdout, prefer simple ideas with a reason, deflate the winner.
A backtest is a hypothesis, not a resultThe only clean test of a strategy is data that played no part in choosing it: a final holdout you look at once, or live trading. Everything else, however carefully cross-validated, has been looked at repeatedly by someone choosing among ideas. State how many ideas were tried, adjust for it, and be suspicious of any Sharpe above 2 on daily equity data with a short history.
Lab · what's graded
An annualised Sharpe ratio15 pts
The standard error of a Sharpe ratio15 pts
The best of many from noise15 pts
What to do with the winner15 pts
Defences against overfitting10 pts
A deflated Sharpe ratio15 pts
Why the best backtest may be luck15 pts
0/ 7 answered
1Numeric answer15 ptsNot answered
Daily excess returns have mean 0.05% and standard deviation 1%. What is the annualised Sharpe ratio (multiply the daily ratio by the square root of 252)? Give it to three decimals.
SR=accepted: ± 0.005
2Numeric answer15 ptsNot answered
A strategy has an annual Sharpe ratio of 0.8 measured over T = 4 years. Use SE = sqrt((1 + SR^2/2)/T). Give it to three decimals.
SE=accepted: ± 0.005
3Numeric answer15 ptsNot answered
You test N = 100 strategies with no real skill and a noise spread of 0.5 in the Sharpe estimates. Use E[max] = 0.5 * sqrt(2 ln N). Give the expected best Sharpe to three decimals.
E[max]=accepted: ± 0.01
4Choice15 ptsNot answered
The best of 200 backtested strategies has an annual Sharpe of 1.0 over five years. What is the right response?
5Choice10 ptsNot answered
Select every good defence against backtest overfitting.
6Numeric answer15 ptsNot answered
Your best backtest shows a Sharpe ratio of 1.5, and the expected best Sharpe from pure noise with that many trials is 1.0. What is the deflated Sharpe ratio, observed minus expected?
SRd=accepted: ± 0.001
7Explain in words15 ptsNot answered
In two sentences, explain why the best Sharpe ratio among many tested strategies is inflated.
Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check