What's the most efficient way to test for multiple volume averages? #465
contenrico
started this conversation in
General
Replies: 1 comment 3 replies
-
I hate to give out hacks, but its better than fighting with perfomance. We should look into the performance issues (and bug you raised) as soon as we can. One way to achieve the described workflow is to just hack a new triangle that omits the periods you want dropped. import chainladder as cl
raa = cl.load_sample('raa')
tri_hack = cl.Development(drop=[('1982', 12), ('1989', 24)]).fit_transform(raa)
tri_hack = tri_hack * tri_hack.nan_triangle # nan_triangle is undocumented feature and may chang in future
ldf_hack = cl.Development(n_periods=3).fit(tri_hack).ldf_ |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm running many scenarios on many reserving classes to test sensitivities. These scenarios are mostly varying the averaging period, so in the context of the Development method, I'm looping in a similar way:
drop = my_long_list
for i in range(2, 12):
cl.Development(n_periods=i, drop=my_long_list).fit(triangle).ldf_
The drop argument always takes the same input, but because it's a very long list of exclusions, every iteration takes over a second to run, so running a lot of classes becomes quite slow.
Is there a way to fit the triangle with a drop input first, and then vary the n_periods to obtain different volume averages (so that it doesn't have to re-fit the triangle every time with all the exclusions)?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions