Friedland Chapter 11 - #1176
Conversation
* WIP * making progress * promoting _param_property * fixing bug * full implementation w/ test * bugbot and tests * test fix * rubric * docstring and additional tests * bugbot proof * Update test_disposal.py * docstring and additional tests * bugbot proof * Update test_disposal.py * more bugbot fixes * bug fix * fix * forcing numpy after all * more fixes * more fixes * addressing reviewer comments * added missing dependencies * restructuring disposal attributes into mixin class * adding `is_disposal_rate` attribute to triangle * improving docstring and adding codecov coverage * chapter 11 prep * streamlining single dev weights * doctest fixes * additional tests
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): 0.0% fully typed (0 / 3)
Patch symbol details
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1176 +/- ##
==========================================
+ Coverage 91.14% 91.20% +0.06%
==========================================
Files 91 91
Lines 5365 5380 +15
Branches 681 683 +2
==========================================
+ Hits 4890 4907 +17
+ Misses 340 339 -1
+ Partials 135 134 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fe37feb. Configure here.

Summary of Changes
Adding a first draft of Chapter 11, which showcases the recently added
TriangleWeightandDisposalRateUnlike Chapter 6 and 7, we are using jupyter notebook, which provides richer formatting. Testing is achieved through asserts built into the notebook, though failing any assert only results in a warning.
RTD version here.
Related GitHub Issue(s)
refers #588
closes #1073 #1024
Additional Context for Reviewers
other misc edits:
adding precision to several gl insurer dataset (use severity x count to get more decimals on loss)
adding incremental paid severity to xyz dataset
removing friedland_xyz_disposal (redundant)
nan_triangleno longer returns full triangle for all patternsw_is now deleted inside_drop_subtrianglesTriangleWeightnow supports full trianglesfit_OLSis fixed insideWeightedRegression; r-squared is addedI 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
Changes to
nan_triangle, weighted OLS, andTriangleWeighton full triangles affect core triangle arithmetic and development weighting; large notebook adds maintenance surface but limited runtime risk.Overview
Adds Friedland Chapter 11 documentation (notebook + TOC) that chains existing estimators—
Development,Chainladder,TriangleWeight,DisposalRate,Trend,WeightedRegression—to reproduce frequency-severity exhibits, with notebookassertchecks against reference figures.Triangle / weights:
nan_triangleno longer treats pattern triangles like full triangles (onlyis_ultimategets the all-ones mask)._drop_subtrianglesalso clearsw_.TriangleWeightcan be fit on full triangles (full_triangle_, etc.) via anis_fullbranch inn_periodsweighting; sparse inputs are forced to numpy for fitting.Regression:
WeightedRegression.fit_OLSuses weighted means for slope/intercept and exposesrsq_.Sample data: Updates Friedland CSVs (reported claims, incremental paid severity, precision); merges disposal columns into
friedland_xyz_auto_biand removesfriedland_xyz_disp; manifest entries adjusted accordingly.Tests:
TriangleWeighttests for drop-all-valuations error and full-triangle weight parity with partial triangles.Reviewed by Cursor Bugbot for commit 901ded6. Bugbot is set up for automated code reviews on this repo. Configure here.