chainladder-python icon indicating copy to clipboard operation
chainladder-python copied to clipboard

Bugs in drop_high and drop_low

Open kennethshsu opened this issue 3 months ago • 0 comments

Discussed in https://github.com/casact/chainladder-python/discussions/514

Originally posted by graciepii May 13, 2024 Hello, I am currently using the below line of code, which works completely as expected for grain OYDY triangles.

dev = cl.Development(n_periods=-1, drop_high=False, drop_low=False).fit_transform(tri)

However when I use OYDM it displays the below error:

ValueError: all keys need to be the same shape

Could anyone help?

Test:

tri = cl.load_sample("prism")["Paid"].sum().grain("OYDQ")
no_drop = cl.Development().fit_transform(tri).cdf_.to_frame().values
drop_high = cl.Development(drop_high = True).fit_transform(tri).cdf_.to_frame().values
drop_low= cl.Development(drop_low = True).fit_transform(tri).cdf_.to_frame().values
assert (drop_low >= no_drop).all()
assert (no_drop >= drop_high).all()

kennethshsu avatar May 17 '24 00:05 kennethshsu