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

Mack valuation correlation test - no exception raised when p_critical is outside [0, 1]

Open genedan opened this issue 3 years ago • 1 comments

While looking into #320, I noticed you can input values lower than 0 and higher than 1 for the critical value in the Mack valuation correlation test, without raising an exception:

import chainladder as cl

abc = cl.load_sample('abc')


abc.valuation_correlation(p_critical=200, total=False).z_critical
abc.valuation_correlation(p_critical=-10000, total=False).z_critical

I can offer take this on - I'd like to open a single pull request to handle this, #320, as well as anything else that might pop up along the way regarding these tests. I have some ideas for further enhancements which would include the ability to access intermediate calculations like looking at the development factor ranks.

genedan avatar Oct 07 '22 12:10 genedan

Great catch, thanks @genedan. @jbogaardt has been busy, so I hope you don't mind that I jump in.

I'm curious, what would be the use case for the development factor ranks used for? I believe we had to use ranking in the heatmap() function. Would it be more helpful to code it as a private helper function?

kennethshsu avatar Oct 12 '22 14:10 kennethshsu

@kennethshsu I think it would be pretty cool to be able to extract, since curious readers who are both reading the chainladder docs and the Mack paper would be able to see that the two are consistent. If you'd like to keep the memory footprint small we can definitely do it in a way that doesn't save the data as an attribute.

closed via https://github.com/casact/chainladder-python/commit/61f65b0bf04debdee66e99ab04d47954b0be7570

genedan avatar Oct 30 '22 01:10 genedan