Repository navigation
fix(stats): use consistent population moments for DSR - #100
Merged
Merged
Conversation
Fisher skewness and Pearson kurtosis were divided by the sample standard deviation. Their numerators already use the 1/n central moments, so short samples understated both inputs to the deflated Sharpe ratio. Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short return samples mixed population third/fourth moments with sample standard deviation, understating the skewness and kurtosis passed to DSR. Use population moments consistently for those two statistics while retaining sample standard deviation for Sharpe.
Refs #89. Keep that tracking issue open until all companion fixes land.
Current head: 2448ba3, based on main d7da592. Stable patch ID 9bb1068eb621b99cad88092d21608ce44df1da7e proves the focused diff is unchanged from the tested implementation below. Fresh current-head moments/statistics tests passed 169 cases (1 benchmark case deselected by configured markers); the full locked suite passed 5478 tests with 7 skips on Linux/Python 3.14.3. Ruff check/format, ty, all-file hooks, strict MkDocs, 9643 links/20 external destinations, and wheel/sdist build passed. Current-base hosted CI remains required.
Verification:
Compatibility: short-sample skewness, kurtosis, and downstream DSR inference change numerically. Sharpe remains defined using sample standard deviation. This is a correction to mixed moment divisors, not a change to the separate unbiased distribution-moments API.
Attribution: preserves original Git authorship for @quantum-like's PR #90 commit 7237b26. Codex added a regression through public deflated_sharpe_ratio, split the branch, and ran checks. AI assistance includes the original Cursor Agent commit and Codex's review, test, and this description. Maintainer review and accountability remain required.