Repository navigation
fix(distribution): estimate Hill loss tails without gains - #102
Merged
Merged
Conversation
The lower-tail order statistics used absolute returns, so large gains entered the loss tail and could dominate the tail index. Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
Negated order statistics are the right loss tail, but a positive sample has no strictly negative threshold. The both-tail path now uses the upper tail in that case instead of failing the log transform. 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.
The lower Hill tail included large gains because it sorted absolute returns. Estimate it from negated returns instead. For tail="both", use whichever tail has enough observations when only one tail is estimable; this supports both positive-only and negative-only return samples.
Refs #89. Keep that tracking issue open until all companion fixes land.
Current head: e5e93df, based on main bb9591a. Stable patch ID be18ef40ffd9dd496ea9bf6d6ae169b76bbaab27 proves the focused diff is unchanged from the tested implementation below. All 98 current-head distribution cases passed again; the full locked suite passed 5482 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. Fresh current-base hosted CI remains required.
Verification:
Compatibility: lower/both tail estimates change when large gains previously entered the loss tail. Samples lacking either estimable tail still fail rather than produce an unsupported estimate.
Attribution: preserves original Git authorship for @quantum-like's PR #90 commits 1d72278 and 8779ad5. Codex added the symmetric negative-only repair and failing regression, split the branch, and ran checks. AI assistance includes the original Cursor Agent commits and Codex's work and description. Maintainer review and accountability remain required.