How to use drop in Development #166
Replies: 1 comment 2 replies
-
This is a good question as its not straight forward. Dropping just in the triangle, without Development estimatorThis doesn't work, because broadcasting takes priority over label matching: import chainladder as cl
raa = cl.load_sample('raa')
# Exclude only 1984 - Fail
raa - raa[raa.origin=='1984'] But if I eliminate more than one origin and bring back the ones I want to keep, then label matching takes priority. This works: # Exclude only 1984 - Success
raa - raa[raa.origin>'1984'] + raa[raa.origin>'1985'] This all assumes you want to retain the origin period, just have it zero/blank. If you want to completely eliminate even the placeholder for the origin period, then you can do this: # Exclude only 1984 - Success with consequences?
raa[raa.origin<'1984'] + raa[raa.origin>'1985'] However, the last one will almost certainly make any of the estimators of the package fail. Dropping in the development estimator itself:There is no import chainladder as cl
raa = cl.load_sample('raa')
cl.Development(drop=list(zip(['1984']*6, range(12, 84, 12)))).fit(raa).ldf_ Final thought - I fully expect that dropping the origin before creating the triangle should produce identical results. I am bothered by the fact that this is not the case for you. |
Beta Was this translation helpful? Give feedback.
-
What's a convenient way to drop an entire origin from a development?
Currently dropping from the raw data before loading to a triangle, but this can cause some bugs.
Beta Was this translation helpful? Give feedback.
All reactions