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

BerquistSherman class paid adjustment causes NaN's[BUG] #537

Open
cdietrich215 opened this issue Jul 17, 2024 · 0 comments
Open

BerquistSherman class paid adjustment causes NaN's[BUG] #537

cdietrich215 opened this issue Jul 17, 2024 · 0 comments
Assignees
Labels

Comments

@cdietrich215
Copy link

cdietrich215 commented Jul 17, 2024

Describe the bug
I believe the BerquistSherman class's paid adjustment has a bug (this probably some lesser used functionality again). This error occurs in the lookup array defined in line 127.

The procedure selects regression parameters (a and b) within the same AY, based on how close the adjusted closed claim count is to the raw closed claim counts in the row, as described in the Friedland paper, page 289. However, in this implementation, if the adjusted closed count is higher than the max of the AY row's unadjusted closed counts, this lookup produces a value that extends into the "lower triangle". This causes nan values for the a and b parameters, as well as the resulting paid loss values.

There should be a ceiling on the lookup values corresponding to the final regression in the AY row. This can be done after lookup is defined in line 143:

n = lookup.shape[-1]
for j in range(n - 1):
    lookup[:, :, j, :] = np.clip(lookup[:, :, :, j], 0,  n - j - 1)

Hope this makes sense - will try to produce an example at some point. Happy to help implement this.

@cdietrich215 cdietrich215 changed the title BerquistSherman class paid adjustment NaN's[BUG] BerquistSherman class paid adjustment causes NaN's[BUG] Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants