Skip to content

Disposal rate method#1022

Open
henrydingliu wants to merge 25 commits into
mainfrom
disposal_rate_method
Open

Disposal rate method#1022
henrydingliu wants to merge 25 commits into
mainfrom
disposal_rate_method

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Implement the disposal rate method

Related GitHub Issue(s)

closes #931

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Medium Risk
New reserving logic touches IBNR allocation and LDF derivation with required ultimate alignment; scope is additive with tests but actuarial correctness is business-critical.

Overview
Adds DisposalRate, a Friedland-style adjustment that forecasts future emergence as a share of an external ultimate passed via sample_weight (e.g. incurred ultimate to drive a paid payment pattern).

fit builds observed disposal rates from cumulative X / ultimate, applies TriangleWeight drop rules (with documented order that differs from Development for rank vs range drops), and fits a cumulative disposal_ / incremental incr_disposal_ pattern through DevelopmentBase. transform / fit_transform reallocate IBNR using that pattern and refresh ldf_ / full_triangle_; sample_weight is required on fit and transform.

DisposalRate is exported from chainladder.adjustments and the top-level package; public API tests include it. MethodBase.validate_weight is now a @staticmethod with type hints so DisposalRate can validate ultimates without a full method fit.

New tests cover Friedland sample fidelity, missing-weight errors, parity with volume-weighted Chainladder, and sparse-backend output.

Reviewed by Cursor Bugbot for commit 7459e8e. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread chainladder/adjustments/disposal.py Outdated
Comment thread chainladder/adjustments/tests/test_disposal.py Outdated
Comment thread chainladder/adjustments/disposal.py Outdated
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.31%. Comparing base (468f11a) to head (7459e8e).

Files with missing lines Patch % Lines
chainladder/adjustments/disposal.py 96.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1022      +/-   ##
==========================================
- Coverage   89.38%   89.31%   -0.07%     
==========================================
  Files          91       91              
  Lines        5266     5232      -34     
  Branches      678      666      -12     
==========================================
- Hits         4707     4673      -34     
  Misses        391      391              
  Partials      168      168              
Flag Coverage Δ
unittests 89.31% <97.05%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread chainladder/adjustments/disposal.py
Comment thread chainladder/adjustments/disposal.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 87857fe. Configure here.

Comment thread chainladder/adjustments/disposal.py
@henrydingliu henrydingliu marked this pull request as ready for review June 21, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Disposal Rate Method from Friedland FreqSev Approach #3

1 participant