PART XIII · Chapter 104 · 589 / 660

Lesson 589. The error in the Sharpe ratio and multiple-testing corrections: the deflated Sharpe ratio

Chapter 104. Defeating Overfitting: Multiple Testing, Deflated Sharpe & Walk-Forward

In Lesson 587, the two-year Sharpe ratio of the same setting scattered widely from seed to seed, and in Lesson 588 the best of 1,000 rules with no edge came out well above 0. One is the swing in the Sharpe ratio itself as an estimate; the other is the inflation that comes from picking the best of many. This lesson looks at how to measure both with approximation formulas.

There are five numbers to cover. They are the standard error of the Sharpe ratio, the probabilistic Sharpe ratio, the expected maximum Sharpe ratio set by the number of trials, the deflated Sharpe ratio recomputed against that threshold, and the minimum track record length. All are approximation formulas that hold under some assumptions, and the numbers in the lesson were computed from hypothetical inputs. The definition of the Sharpe ratio was covered in Lesson 478 and Lesson 660, and the trial record in Lesson 306.

One thing should be clear first. These numbers are tools for measuring how reliable a past estimate is. They are not the probability that a rule will work in the future.

1. Telling the per-period Sharpe ratio from the annualized one

The approximation formulas take the per-period Sharpe ratio. If it was computed from daily returns, it is the daily average excess return ÷ the daily standard deviation, and the annualized value is that multiplied by √252. The number of observations n is also counted at the same frequency.

Assumptions: five years of daily returns, 1,260 observations, annualized Sharpe ratio 1.0. Converted to a per-period value, that is 1.0 ÷ √252 = about 0.063. Put this 0.063 into the formulas, and multiply the result by √252 again to read it in annualized terms.

If you put in the annualized 1.0 as it is, the standard error comes out per period at about 0.035. Reading this as the annualized standard error makes it about 13 times smaller than the correct value. For kurtosis, too, put in the raw kurtosis, which is 3 for a normal distribution. Putting in the excess kurtosis, with 3 subtracted, computes as if the tails were not fat.

2. The standard error: the Sharpe ratio is also an estimate that swings

If returns with the same properties are drawn again, the Sharpe ratio also comes out differently. The size of that swing is the standard error. Lo (2002) approximated the standard error as √((1 + SR² ÷ 2) ÷ n) when returns are independent and normally distributed. The formula that adds skewness and kurtosis for non-normal returns was written by Bailey and López de Prado (2014), citing a working paper by Mertens (2002).

The calculations in this course use that formula divided by the number of observations n − 1. Standard error ≈ √((1 − skewness × SR + (kurtosis − 1) ÷ 4 × SR²) ÷ (n − 1)), where SR is the per-period Sharpe ratio. For a normal distribution, skewness is 0 and kurtosis is 3, so it becomes almost the same as Lo's formula.

With the assumptions of section 1, the per-period standard error is about 0.0282, and about 0.45 annualized. This means that a five-year annualized 1.0 is a number that can range roughly over 1.0 ± 1.96 × 0.45, that is, from 0.12 to 1.88. For the two years of Lesson 587 (500 observations), whether the Sharpe ratio is 0.31 or 1.40, the annualized standard error is larger, at about 0.71. The wide scatter of the same setting's Sharpe ratio across seeds in Lesson 587 is a swing of this size.

Fat tails make the standard error larger, and the larger the Sharpe ratio, the bigger the difference. At an annualized 2.0 with 1,260 observations, it is about 0.45 for a normal distribution, but about 0.53 with skewness −3 and kurtosis 10.

3. The probabilistic Sharpe ratio: an approximation of the probability of exceeding a threshold

The probabilistic Sharpe ratio uses the standard error above to approximate the probability that the true Sharpe ratio is greater than a chosen threshold SR*. It was proposed by Bailey and López de Prado (2012).

Probabilistic Sharpe ratio = Φ((SR − SR*) × √(n − 1) ÷ √(1 − skewness × SR + (kurtosis − 1) ÷ 4 × SR²)). Φ is the cumulative probability of the standard normal distribution.

With the assumptions of section 1 and a threshold of 0, it is about 0.987. Raising the threshold to an annualized 0.5 lowers it to about 0.868. For the same annualized 1.0 with only one year of observations, 252, it is about 0.841 against a threshold of 0.

4. The expected maximum Sharpe ratio: a baseline set by the number of trials

If you picked the best of several settings, as in Lesson 588, the threshold cannot be 0. Even if every true Sharpe ratio is 0, the best of N comes out above 0. Bailey and López de Prado (2014) approximated the expected value of that best with extreme value theory.

Expected maximum Sharpe ratio ≈ √V × ((1 − γ) × Φ⁻¹(1 − 1 ÷ N) + γ × Φ⁻¹(1 − 1 ÷ (N × e))). V is the variance of the trials' Sharpe ratios, γ is the Euler-Mascheroni constant of about 0.5772, e is the base of the natural logarithm, and Φ⁻¹ is the inverse of the standard normal cumulative probability.

Assumptions: the standard deviation of the trials' annualized Sharpe ratios is 0.5, so per period V = 0.25 ÷ 252. Read in annualized terms, the expected maximum is about 0.79 at 10 trials, about 1.27 at 100, about 1.63 at 1,000 and about 1.93 at 10,000.

Four bars of the expected maximum Sharpe ratio by number of trials. Assuming a standard deviation of 0.5 for the trials' annualized Sharpe ratios, it is about 0.79 at 10 trials, about 1.27 at 100, about 1.63 at 1,000 and about 1.93 at 10,000. Each tenfold increase in trials raises it by 0.3 to 0.5.

V is found from a trial table like that of Lesson 588. Gather the in-sample Sharpe ratios of all trials in per-period terms and compute their variance. If the trials resemble each other, the number of independent trials is smaller than N. There are ways to estimate the number of independent trials by grouping similar trials, but record alongside that this number is also an estimate.

5. The deflated Sharpe ratio: raising the threshold for a picked result

The deflated Sharpe ratio is the probabilistic Sharpe ratio with its threshold SR* replaced by the expected maximum Sharpe ratio. It approximates the probability that the true Sharpe ratio is greater than "the best value that luck could produce at this number of trials."

Assumptions: the best setting picked from 100 trials, 1,260 daily observations, annualized 1.5, skewness −0.5, kurtosis 5, and the variance across trials the same as in section 4. The probabilistic Sharpe ratio against a threshold of 0 is about 0.999. The deflated Sharpe ratio would be about 0.94 with 10 trials, about 0.70 with 100, and about 0.39 with 1,000.

Three bars of the deflated Sharpe ratio, recomputed for an annualized Sharpe ratio of 1.5 according to the number of trials it was picked from. It is about 0.94 for 10 trials, about 0.70 for 100 and about 0.39 for 1,000. The more trials, the more room the same number leaves to be explained by luck.

The same 1.5 reads completely differently depending on how many trials it took to get it. The example of Bailey and López de Prado (2014) is an annualized 2.5 from five years of daily data (1,250 observations). The paper gives the deflated Sharpe ratio in this case as about 0.90. It also writes that with 46 trials it would be 0.9505, and that with normal returns the same 0.9505 would have come at 88 trials. In the public version of the paper available to this lesson, the number of trials, the variance across trials, the skewness and the kurtosis could not be read. So they were set again to reproduce the values the paper gives: 100 trials, an annualized variance across trials of 0.5, skewness −3 and kurtosis 10. Computed with these values, the threshold is about 0.1132 daily and the deflated Sharpe ratio is about 0.9004, and 46 trials give 0.9505, as do 88 trials under a normal distribution.

A deflated Sharpe ratio of 0.70 means the following. If the assumptions hold, the probability that the true Sharpe ratio is greater than the expected maximum, even after the picking is taken into account, is about 70%. It is not the probability that the rule will work in the future, and costs and fills (Lesson 585, Lesson 586) or regime changes (Lesson 590) are not in this number.

6. The minimum track record length and the assumptions these numbers rest on

The minimum track record length approximates how many observations are needed to say, with a chosen probability, that the Sharpe ratio exceeds a threshold. Minimum number of observations ≈ 1 + (1 − skewness × SR + (kurtosis − 1) ÷ 4 × SR²) × (Φ⁻¹(probability) ÷ (SR − SR*))².

To say with 95% probability that the annualized 1.0 of section 1 exceeds a threshold of 0 needs about 684 daily observations, that is, about 2.7 years. With skewness −1 and kurtosis 6 it is about 2.9 years. To say with 95% probability that the annualized 1.5 of section 5 exceeds the expected maximum for 100 trials, about 1.27, needs about 51.9 years. Raising the threshold for the number of trials makes the required record this much longer.

These numbers rest on the following assumptions.

  • Observations are independent of each other. If returns are autocorrelated or overlapping-period returns are used, the real amount of information is less than n.
  • The distribution of returns stays the same throughout the period. If the regime changes (Lesson 590), earlier estimates do not fit later periods.
  • Skewness, kurtosis and V are treated as known exactly. In reality they are estimates too.
  • The number of trials N was counted honestly. Leaving out thrown-away trials lowers the threshold.

The record for this lesson is the Sharpe ratio box. Write together the per-period Sharpe ratio and its frequency, the number of observations, and the skewness and kurtosis. Add the number of trials and V, the expected maximum, the probabilistic and deflated Sharpe ratios, and the minimum track record length, and state that they are values from approximation formulas.

Try it yourself

  1. Assumptions: three years of weekly returns, 156 observations, annualized Sharpe ratio 0.8 (52 weeks a year). Compute the per-period Sharpe ratio and the annualized standard error under a normal assumption.
  2. Assumptions: 756 daily observations, annualized Sharpe ratio 1.2, skewness 0, kurtosis 3. What is the probabilistic Sharpe ratio against a threshold of 0, approximately?
  3. Under the assumptions of section 4, if the number of trials rises tenfold from 100 to 1,000, how much does the annualized expected maximum Sharpe ratio rise?
  4. In the example of section 5, if there had been 1,000 trials, what would the deflated Sharpe ratio be approximately, and how should that number be read?

Answers

First, the per-period Sharpe ratio is 0.8 ÷ √52 = about 0.111. The standard error is √((1 + 0.111² ÷ 2) ÷ 155) = about 0.0806, and multiplied by √52 the annualized standard error is about 0.58. A three-year 0.8 is a number that is hard to call very different from 0.

Second, putting in the per-period 1.2 ÷ √252 gives about 0.981. It approximates the probability, under the same assumptions, that the true Sharpe ratio is greater than 0, and it does not reflect the number of trials.

Third, it rises by about 0.36, from about 1.27 to about 1.63. When the trials grow tenfold the threshold rises only a little, not tenfold, but that difference alone changes the deflated Sharpe ratio a lot.

Fourth, about 0.39. If the assumptions hold, this means that after the picking is taken into account, the probability that the true Sharpe ratio is greater than the expected maximum is less than half. Record that an annualized 1.5 picked from 1,000 trials leaves a lot of room to be explained by luck.

Related lessons