Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#537 #546

Merged
merged 2 commits into from
Jan 14, 2025
Merged

#537 #546

merged 2 commits into from
Jan 14, 2025

Conversation

cdietrich215
Copy link
Contributor

This PR accomplishes two things:

  1. Ensures that the paid Berquist-Sherman adjustment continues to work when the lookup (based on the adjusted paid claim count) exceeds the maximum actual paid claim count in the row. It accomplishes this by capping the lookup value.
  2. Adds an additional Berquist-Sherman unit tests to ensure adjusted values are as expected on the Berquist Sherman dataset. This test passes both before and after the change.

To replicate the error in question:

import chainladder as cl
triangle = cl.load_sample("berqsherm").loc['MedMal']
xp = triangle.get_array_module()
# Purposefully cause negative closed development towards the end for demonstration
triangle.loc["MedMal", "Closed", "1969" , 84] = triangle.loc["MedMal", "Closed", "1969" , 72] * 0.9
triangle.loc["MedMal", "Closed", "1969" , 96] = triangle.loc["MedMal", "Closed", "1969" , 84] * 0.9
triangle.loc["MedMal", "Closed", "1970" , 84] = triangle.loc["MedMal", "Closed", "1970" , 72] * 0.9

berq = cl.BerquistSherman(
    paid_amount='Paid', incurred_amount='Incurred',
    reported_count='Reported', closed_count='Closed',
    trend=0.15)
# Transform triangle
berq_triangle = berq.fit_transform(triangle)

Copy link
Collaborator

@jbogaardt jbogaardt left a comment

Choose a reason for hiding this comment

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

@cdietrich215, welcome to the list of contributors to the chainladder-python package. Your improvements are very much welcome and appreciated. Thank you for your hard work on this. Impressively thorough for a first PR. Nicely done. We'll get a release going so that your code is in an official release. There are a couple minor issues I will need to resolve to get there, but be on the look out for a new version over the coming week.

@jbogaardt jbogaardt merged commit 2ea3c1d into casact:master Jan 14, 2025
0 of 5 checks passed
@cdietrich215
Copy link
Contributor Author

Thanks @jbogaardt . Of course, happy to help on the package!

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.

2 participants