Actuarial Outpost MackChainLadder problem for claim count development triangle
 Register Blogs Wiki FAQ Calendar Search Today's Posts Mark Forums Read
 FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

 DW Simpson International Actuarial Jobs Canada  Asia  Australia  Bermuda  Latin America  Europe

 General Actuarial Non-Specific Actuarial Topics - Before posting a thread, please browse over our other sections to see if there is a better fit, such as Careers - Employment, Actuarial Science Universities Forum or any of our other 100+ forums.

#11
04-12-2018, 09:58 PM
 Marcie Member CAS Join Date: Feb 2015 Posts: 7,916

Quote:
 Originally Posted by Peter T.W. Chen Actually, I modified my triangle as an square. (add 2018/1/1 and 2018/2/1). However, I got this error: Error in lm.wfit(x, y, w, offset = offset, singular.ok = singular.ok, : NA/NaN/Inf in 'x' It seems that the problem is not related to square or not.
Why do you say this?

You got a new error after squaring the triangle. That suggests the former error in fact was due to the triangle being the wrong shape (a trapezoid).

I suspect the new error is from having zeroes for the effective months in 2018 - particularly having 0 for both development months 1 and 2 for 2018/1 as this probably causes a 0/0 division by 0 error. Just a guess.
#12
04-12-2018, 10:01 PM
 Peter T.W. Chen CAS SOA Non-Actuary Join Date: Oct 2017 Posts: 15

Dear All,

I figure out the problem.
It seems that we can ignore period 1 and 2 because the last effective month is Dec 2017, so we can remove them. We just need to consider period 3 as 1 and use cumulative triangle first and directly run MackChainLadder.
Finally, it works and the LDF are the same as the correct one. And we add original period 1 and 2 back. Tansforming back to incremental. Problem solved!!!

I think this is the way for others to figure out when they meet in the future.

Thanks all again.
Appreciate.

But I think MackChainLadder is just a quick way to forecast. There are still other better ways.

Last edited by Peter T.W. Chen; 04-12-2018 at 10:06 PM..
#13
04-12-2018, 10:13 PM
 Marcie Member CAS Join Date: Feb 2015 Posts: 7,916

Quote:
 Originally Posted by Peter T.W. Chen Dear All, I figure out the problem. It seems that we can ignore period 1 and 2 because the last effective month is Dec 2017, so we can remove them. We just need to consider period 3 as 1 and use cumulative triangle first and directly run MackChainLadder. Finally, it works and the LDF are the same as the correct one. And we add original period 1 and 2 back. Tansforming back to incremental. Problem solved!!! I think this is the way for others to figure out when they meet in the future. Thanks all again. Appreciate. But I think MackChainLadder is just a quick way to forecast. There are still other better ways.
Well, I suppose that's one way to square the triangle while avoiding a division by zero error. Congrats, Peter.

Last edited by Marcie; 04-12-2018 at 11:54 PM..
#14
04-13-2018, 01:15 PM
 AMedActuary Member SOA Join Date: May 2007 College: UCLA Alumni Posts: 389

Quote:
 Originally Posted by Peter T.W. Chen I use data.table rather than dplyr because my origional raw data has more than 6500000 observations. data.table can manipulate raw data quickly than dplyr. And, the melt I used is data.table::melt.
Ok yeah data.table is faster for this situation. Also, doesn't "fread" create a data.table object? So I don't think you need the "as.data.table" command but not sure on that.