Deflated Sharpe Ratio
workflow.run_dsrDeflated Sharpe Ratio (Bailey & Lopez de Prado): given how many strategy variants you tried (and how correlated they are), what Sharpe ratio would the best of N clear by luck alone, and does your actual strategy still clear that higher bar? Use when user asks "is my backtested Sharpe ratio real, or did I get lucky trying many variants?" or "how many independent trials does this really represent?". Provide either trial_sharpes[] (the N trials' own observed Sharpe ratios, most rigorous) or n_trials (+ optional avg_correlation to correct for correlated trials via Kish's design effect). Returns: expected_max_sharpe (the luck-alone threshold), dsr (probability your strategy's true Sharpe exceeds it, 0-1), n_trials_effective.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| returns | Yes | The candidate strategy's own return series | |
| n_trials | No | Number of strategy variants tried, if trial_sharpes were not tracked individually | |
| trial_sharpes | No | Observed Sharpe ratios of all N trials tried, if tracked. Takes priority over n_trials if both are given. | |
| avg_correlation | No | Average pairwise correlation between trials, 0-1 (default 0 = independent). Only used with n_trials; lowers the effective trial count via Kish's design effect. |