Deflated Sharpe ratio calculator
Compute the probabilistic Sharpe ratio, the minimum track record length and the deflated Sharpe ratio from per-period inputs. The calculation runs in your browser, and the inputs stay on your device.
Calculator
Enter each figure per period: one period is the interval of one return in the track record, such as a day or a month. The default inputs are the worked example of the DSR paper.
The inputs in the link were not read, so the fields keep the paper's example. Each fault is listed below.
Results
- Annual Sharpe ratio, SR · sqrt(periods per year)
- PSR at the benchmark SR*
- MinTRL, in observations
- MinTRL, rounded up to the next observation
- MinTRL, in years
- Standard deviation of the trials' Sharpe ratios, σ(SR) = sqrt(V), per period
- σ(SR) per year, σ(SR) · sqrt(periods per year)
- SR0, the expected maximum Sharpe ratio of N trials with no skill, per period
- DSR, the PSR at the benchmark SR0
Assumptions behind the DSR
- Null dispersion V
- Number of trials
- How N was counted
- Version of the method
Each field needs a number, except V, which can be left empty.
T must be at least 2 observations.
Kurtosis must be at least 1 + skewness². Normal returns have kurtosis 3, an excess kurtosis of 0.
For these inputs, 1 − γ3 · SR + (γ4 − 1) / 4 · SR² is 0 or negative, so PSR, MinTRL and DSR are not defined.
The confidence level must lie strictly between 0.5 and 1.
MinTRL is defined when SR exceeds SR*. With SR at or under SR*, no track record length reaches the confidence level.
N must be an integer of at least 1.
V must be 0 or positive, or left empty.
Periods per year must be a positive number.
The note on how N was counted takes at most 120 characters, without control or text-direction characters.
Link to these inputs
The link carries the numbers in the fields above, the note on N and the version of the method in its address. It holds no return series.
Sensitivity of the DSR to N
The curve holds SR, T, skewness, kurtosis and V at the values entered above and computes the DSR for N from 1 to 10,000 on a log scale, or up to the next power of ten above a larger entered N. The marked point is the entered N. The table and the CSV file carry the same points as numbers.
With the inputs above and V = 0.002 per period, the DSR is 0.999997 at N = 1, 0.9004 at the entered N = 100 (the marked point), and 0.3389 at N = 10,000. SR0 rises with N, so the DSR falls as N grows.
| N | SR0 per period | DSR |
|---|---|---|
| 1 | 0.0000 | 0.999997 |
| 2 | 0.0232 | 0.9999 |
| 5 | 0.0533 | 0.9986 |
| 10 | 0.0704 | 0.9939 |
| 20 | 0.0850 | 0.9816 |
| 50 | 0.1018 | 0.9462 |
| 100 (entered) | 0.1132 | 0.9004 |
| 200 | 0.1237 | 0.8374 |
| 500 | 0.1365 | 0.7314 |
| 1,000 | 0.1456 | 0.6399 |
| 2,000 | 0.1542 | 0.5449 |
| 5,000 | 0.1649 | 0.4229 |
| 10,000 | 0.1727 | 0.3389 |
Formulas
SR is the mean of the returns divided by their standard deviation, over one period. The annual figure multiplies it by the square root of the periods per year, which assumes returns independent from one period to the next.
SR = mean(r) / std(r)
annual SR = SR · sqrt(periods per year)
The probabilistic Sharpe ratio (PSR) is Eq. 11 of Bailey and López de Prado (2012). γ3 is the skewness of returns and γ4 their raw kurtosis.
PSR(SR*) = Φ( (SR − SR*) · sqrt(T − 1) / sqrt(1 − γ3 · SR + (γ4 − 1) / 4 · SR²) )
The minimum track record length (MinTRL) is Eq. 13 of the same paper. It gives the number of observations at which the PSR reaches the confidence level.
MinTRL = 1 + (1 − γ3 · SR + (γ4 − 1) / 4 · SR²) · (Φ⁻¹(confidence) / (SR − SR*))²
The deflated Sharpe ratio (DSR) is Eq. 2 of Bailey and López de Prado (2014): the PSR at a benchmark SR0. SR0 is the expected maximum Sharpe ratio of N independent trials with no skill, whose Sharpe ratios have variance V.
SR0 = sqrt(V) · ((1 − γ) · Φ⁻¹(1 − 1/N) + γ · Φ⁻¹(1 − 1/(N·e))), γ ≈ 0.5772
DSR = PSR(SR0)
Here γ is the Euler-Mascheroni constant and e is Euler's number. With N = 1, no selection takes place: the calculator sets SR0 = 0, the DSR equals the PSR at SR* = 0, and the assumptions line for N reads "PSR only; no trial-count deflation."
V is an assumption about your search. Left empty, V takes the value 1/T. Under the null of the DSR each trial has a true Sharpe ratio of 0, and with independent returns the variance of a Sharpe ratio estimated on T returns approaches 1/T as T grows, for any skewness and kurtosis: the variance factor of the PSR equals 1 at SR = 0. This default leaves out any spread of true skill across trials, and the variance measured across your own trials replaces it. The assumptions under the results state which V the DSR used.
SR0 grows with sqrt(V), so the calculator prints σ(SR) = sqrt(V) next to the results, per period and per year.
Kurtosis must be at least 1 + skewness² for any distribution. A smaller value usually means an excess kurtosis entered as raw kurtosis.
Φ follows West (2005), within 1e-15 in absolute error. Φ⁻¹ follows algorithm AS 241 of Wichura (1988), within 1e-15 in relative error. Both bounds come from tests against the Python 3.12 standard library.
Worked example from the DSR paper
The example of Bailey and López de Prado (2014, pp. 9-10) is a strategy with an annual Sharpe ratio of 2.5. It is measured on 1,250 daily returns, five years at 250 a year.
Its returns have skewness −3 and kurtosis 10. It is the best of N = 100 trials, whose annual Sharpe ratios have a variance of 0.5.
SR = 2.5 / sqrt(250) = 0.1581 per period
V = 0.5 / 250 = 0.002, σ(SR) = 0.0447 per period (0.7071 per year)
SR0 = 0.1132 per period (1.7894 per year)
DSR = PSR(SR0) = 0.9004
The default inputs of the calculator are this example, and its DSR of 0.9004 is the value printed in the paper.
With N = 46 trials the DSR is 0.9505. From N = 47 it falls under 0.95, at 0.9494.
With normal returns (skewness 0, kurtosis 3), the DSR stays above 0.95 up to N = 88, at 0.9505. N = 89 gives 0.9498.
For MinTRL, take an annual Sharpe ratio of 2 against an annual benchmark of 1, with normal returns and 95% confidence. At 252 or 250 periods a year, MinTRL is 2.73 years.