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

MackChainladder with malformed triangle #221

Closed
jbogaardt opened this issue Oct 22, 2021 · 4 comments
Closed

MackChainladder with malformed triangle #221

jbogaardt opened this issue Oct 22, 2021 · 4 comments
Labels

Comments

@jbogaardt
Copy link
Collaborator

Another bug I found has to do with the Mack Standard Error, it works when RAA is used but if you delete the lastest origin period being 1990 and Dev year 1990. Version 0.8.8 creates a much larger standard error compared to 0.8.2. I’m not sure why but I’m assuming it has to do with the triangle not being a perfect nxn, Here’s the code that I used after putting RAA data on excel and deleting Origin 1990:

raa_df = table.range('A1').options(pd.Series,index=False, header=True, expand='table').value
raa = cl.Triangle(raa_df, cumulative = True, origin="origin", development="development", columns="value")
mack = cl.MackChainladder().fit(raa)
mack.summary_
mack.total_mack_std_err_.values[0, 0]
Version 0.8.2 Produces : 10009.022070082632
Version 0.8.8 Produces : 76362.26020670775

Originally posted by @rbreen2 in #219 (comment)

@jbogaardt jbogaardt added the Bug label Oct 22, 2021
@jbogaardt
Copy link
Collaborator Author

@rbreen2, thanks for finding this. I've put this in a separate issue since it is not related to the BootstrapODPSample estimator. This looks like a bug and I trust release 0.8.2 figures more than release 0.8.8.

@jbogaardt
Copy link
Collaborator Author

Offending code:

import chainladder as cl
a = cl.load_sample('raa')
b = a.iloc[:,:, :-1]
# Should produce zeros for all origins except for the last.
cl.MackChainladder().fit(a).parameter_risk_ - cl.MackChainladder().fit(b).parameter_risk_

@rbreen2
Copy link

rbreen2 commented Oct 22, 2021

Thank you, do you believe this will be fixed in the next version?

@jbogaardt
Copy link
Collaborator Author

Yes, bugs are given precedence over enhancements so this should be resolved in 0.8.9

jbogaardt added a commit that referenced this issue Oct 23, 2021
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