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
mid-year valuations not working #225
Comments
a triangle with just latest diagonal works as expected: i..e replace the first line with the following, results in development periods at 6, 18, 30 etc
|
This is definitely a gap in the library. OYDY grains with support for ages other than ages 12, 24, 36, etc. is spotty. This is a big problem, particularly for reinsurance or consulting where get pre-aggregated data is common. Its definitely an enhancement we need to tackle. |
Can you please help me understand, why it even cares what the ages are? Provided the ages are consistent between development and the triangle that is being transformed / fitted, then shouldn't the ages themselves be irrelevant? What am I not understanding? |
It shouldn't, but thats not the tricky part. The tricky part is that we need to accomodate two different use cases here.
Ensuring that enough information is obtained from the data and user to support both is something that needs to be thought out. By the way, this one is a duplicate of #188, so it's on the list of things to do. We should close one of the duplicates out. |
I'm actually facing this very problem right now in attempting to apply this library to my work as a reinsurer. The industry benchmarks that I'm provided are evaluated each March, with the first evaluation for a given accident year starting at 15 months. I can't for the life of me get the cl.Triangle() to produce a triangle on a 15/27/39 etc. basis. It keeps overwriting my development entries and assuming annual evaluation delays. Any advice or solutions would be greatly appreciated. |
@AuldKingCole, unfortunately I don't have a solution that isn't completely janky. I run into the same problem using industry data at those same valuations. I appreciate you sharing your pain point as well. The only consolation I can give is that the higher number of people wanting this functionality definitely influences its prioritization. We can prioritize it for the next release. Unfortunately that is not days/weeks in the making. Realistically it would be more like late December. |
@jbogaardt , thanks for the response. While I see so much potential for this library in some projects I would like to establish down the line, in the meantime I only need a crisp means of batch calculating link ratios and averages. I suppose for now it won't matter if I allow the triangles to default to 12-24-36 etc? I will be very very interested in utilizing this library further if the mid-year issue ever gets worked out. |
@AuldKingCole, It makes me cringe that anyone would have to do that, but that should be fine for estimating LDFs. |
A solution has been pushed to master that handles both the case where origin periods end in December and when they end at any other arbitrary month. import chainladder as cl
import pandas as pd
raa = cl.load_sample('raa').dev_to_val().to_frame(keepdims=True).reset_index()
#adjust valuations to mid-year
raa['valuation'] = raa['valuation'] - pd.DateOffset(months=6)
print('This produces desired behavior:')
tri = cl.Triangle(raa, origin='origin', development='valuation', columns='values', cumulative=True)
print(tri)
print('Valuation Date:', tri.valuation_date, 'Close Month:', tri.origin_close)
print('What if we want our origns to run from July through June?')
raa['origin2'] = raa['origin'] - pd.DateOffset(months=6)
tri = cl.Triangle(raa, origin='origin2', development='valuation', columns='values', cumulative=True)
print(tri)
print('Valuation Date:', tri.valuation_date, 'Close Month:', tri.origin_close) Did some lightweight testing and it all seems reasonable with no regressions on existing tests. Will do more testing over the next several weeks prior to release, but feel free to install from github if you want to play with the new functionality.
|
see code example below:
The text was updated successfully, but these errors were encountered: