I am trying to create a loss development triangle in R using the 'ChainLadder' package. What I am getting stuck is how to create a formula for the 'Development Period (Age)' variable. My dataframe consist of accident date (mm/dd/yyyy), accident year(yyyy), valuation date(mm/dd/yyyy) and valuation year(yyyy), in individual columns. While, I can easily create 'Age' for a 12 months period, for example,
Age = (ValuationYear - AccidentYear)*12
Using the formula, I can call the paid losses for the Accident Year 2005, evaluated on 12/31/2005 due to the 12 months development period. And the paid losses for the Accident Year 2003, evaluated on 12/31/2005 due to the 36 months development period.
However, I can't seem to create the right formula for a 6 months period, such as,
So, in this example, I am trying to call the paid losses for the Accident Year of 2005, as of 6/31/2005, corresponding to the 6 months interval. Also, I am trying to call the paid losses for the Accident Year of 2004, as of 12/31/2004, in reference to the 12 months interval. I don't know how to create a formula for such a development period.
Similarly, I am not sure how to create formulas for 3 or 4 months development period. So, pretty much apart from 12 months of development, I have no clue on how to proceed with other periods. Is there any other easier way to create loss triangles in R? Any help is appreciated! Thank you so much! :)