Friedland Chapter 11#1079
Open
henrydingliu wants to merge 6 commits into
Open
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 #1079 +/- ##
==========================================
- Coverage 90.18% 90.13% -0.06%
==========================================
Files 91 91
Lines 5409 5300 -109
Branches 696 673 -23
==========================================
- Hits 4878 4777 -101
+ Misses 375 369 -6
+ Partials 156 154 -2
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:
|
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.
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.
Please go to experimental
Related GitHub Issue(s)
refers #588
closes #1073 #1024
Additional Context for Reviewers
other misc edits:
adding precision to several friedland datasets (use severity x count to get more decimals on loss)
removing friedland_xyz_disposal (redundant)
nan_triangleno longer returns full triangle for any patternw_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
Touches triangle masking, weighted regression, and development weighting on projected triangles—areas that drive reserve math—but changes are backed by Friedland notebook asserts and new unit tests.
Overview
Adds Friedland Chapter 11 documentation (notebook + TOC) that walks frequency–severity exhibits using
TriangleWeight,DisposalRate,WeightedRegression, and triangle arithmetic, with hardcodedassertchecks against textbook figures.Core behavior changes:
TriangleWeightcan applyn_periods(and related filters) on full triangles such asfull_triangle_via a newX.is_fullweight path;_drop_subtrianglesnow clears attachedw_.nan_triangleno longer treats pattern triangles like ultimates—onlyis_ultimategets an all-ones mask.WeightedRegressionuses weighted means in OLS and exposesrsq_.Data & tests: Friedland sample CSVs gain precision and columns (e.g.
Reported Claimson GL insurer);friedland_xyz_dispis removed from the manifest. Chapter 6/7 doctests and newTriangleWeighttests coverdrop_valuationand full-triangle weight parity.Reviewed by Cursor Bugbot for commit 44d0119. Bugbot is set up for automated code reviews on this repo. Configure here.