Actuarial Outpost
 
Go Back   Actuarial Outpost > Actuarial Discussion Forum > General Actuarial
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

Actuarial Jobs by State

New York  New Jersey  Connecticut  Massachusetts 
California  Florida  Texas  Illinois  Colorado


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.

Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old 04-12-2018, 09:58 PM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 6,812
Default

Quote:
Originally Posted by Peter T.W. Chen View Post
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.
Reply With Quote
  #12  
Old 04-12-2018, 10:01 PM
Peter T.W. Chen Peter T.W. Chen is offline
CAS SOA Non-Actuary
 
Join Date: Oct 2017
Posts: 15
Default

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..
Reply With Quote
  #13  
Old 04-12-2018, 10:13 PM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 6,812
Default

Quote:
Originally Posted by Peter T.W. Chen View Post
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..
Reply With Quote
  #14  
Old 04-13-2018, 01:15 PM
AMedActuary AMedActuary is offline
Member
SOA
 
Join Date: May 2007
College: UCLA Alumni
Posts: 379
Default

Quote:
Originally Posted by Peter T.W. Chen View Post
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.
Reply With Quote
Reply

Tags
chainladder, mackchainladder, rstudio, triangle

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 11:10 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.19924 seconds with 11 queries