Is your backtest result real, or overfit? Statistical diagnostics for backtest overfitting.
Project description
skepsis
Is your backtest result real, or overfit?
skepsis takes the returns of a backtested strategy — and, ideally, the returns of every variant you tried along the way — and produces statistical evidence for or against the result being luck, plus a self-contained HTML report you can hand to a PM.
pip install skepsis
Quickstart
import skepsis
result = skepsis.evaluate(
returns, # per-period returns of the chosen strategy
trials=trials_df, # T x N returns of all variants tried (optional, unlocks DSR + PBO)
params=params_df, # one row of parameter values per trial (optional, unlocks sensitivity)
freq="daily",
)
print(result.summary())
result.save_html("skepsis_report.html")
More inputs unlock more diagnostics; the report states plainly which diagnostics could not run and why.
Docs: https://abhinay.github.io/skepsis · Demo: Deflating the Golden Cross
The diagnostics
| Diagnostic | Question it answers | Source |
|---|---|---|
| Probabilistic / Deflated Sharpe Ratio | Is the Sharpe distinguishable from zero once sample length, fat tails, and how many things you tried are priced in? | Bailey & López de Prado (2012, 2014) |
| Probability of Backtest Overfitting (CSCV) | How often does your in-sample winner land in the bottom half out-of-sample? | Bailey, Borwein, López de Prado & Zhu (2015) |
| Stationary block bootstrap | What does the Sharpe/drawdown distribution look like under resampling that preserves autocorrelation — and does a no-skill null explain it? | Politis & Romano (1994); Politis & White (2004) |
| Parameter sensitivity | Is the chosen configuration a plateau (robust) or an isolated spike (fitted to noise)? | — |
The implementations are verified against reference values in
tests/golden/ — including reproducing the published
numerical example of the Deflated Sharpe Ratio paper to all four printed
decimals (test_dsr_paper_example.py).
What skepsis is not
Not a backtester, not a data source, not a portfolio optimizer. It sits downstream of vectorbt, backtesting.py, zipline, or your homegrown engine, and it never silently repairs bad input: NaNs are rejected, strained assumptions are warned about, skipped diagnostics say why.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skepsis-0.1.0.tar.gz.
File metadata
- Download URL: skepsis-0.1.0.tar.gz
- Upload date:
- Size: 405.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dee0248e6e69c15702aa811dca09e5e18e95b98ef208ef83dd177549f096e8f4
|
|
| MD5 |
08e96913cfae8d2f5ad089292b420923
|
|
| BLAKE2b-256 |
613a7135f1bbf567e22520c2398178e0c2133cb81a86ee8b1c36e2cfa299f1dd
|
Provenance
The following attestation bundles were made for skepsis-0.1.0.tar.gz:
Publisher:
release.yml on abhinay/skepsis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skepsis-0.1.0.tar.gz -
Subject digest:
dee0248e6e69c15702aa811dca09e5e18e95b98ef208ef83dd177549f096e8f4 - Sigstore transparency entry: 2172521970
- Sigstore integration time:
-
Permalink:
abhinay/skepsis@22b7372e60c4601525e8c1781c2ea2c4b5013356 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abhinay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22b7372e60c4601525e8c1781c2ea2c4b5013356 -
Trigger Event:
release
-
Statement type:
File details
Details for the file skepsis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: skepsis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a63a62183a66a98d1f7f5a36f2f325d7f8a02ca1235caa5d38f78fdc5e60a16
|
|
| MD5 |
c0e821ea971ee1ddad7a2c1bbd03af2d
|
|
| BLAKE2b-256 |
27ccd6f0a803b9c32e4e1bd8297673ee471c1885b245cad0942693db7f970674
|
Provenance
The following attestation bundles were made for skepsis-0.1.0-py3-none-any.whl:
Publisher:
release.yml on abhinay/skepsis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
skepsis-0.1.0-py3-none-any.whl -
Subject digest:
6a63a62183a66a98d1f7f5a36f2f325d7f8a02ca1235caa5d38f78fdc5e60a16 - Sigstore transparency entry: 2172521979
- Sigstore integration time:
-
Permalink:
abhinay/skepsis@22b7372e60c4601525e8c1781c2ea2c4b5013356 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/abhinay
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22b7372e60c4601525e8c1781c2ea2c4b5013356 -
Trigger Event:
release
-
Statement type: