mages / ChainLadder

Claims reserving models in R
https://mages.github.io/ChainLadder/
75 stars 62 forks source link

Weighted matrix for Mack CDR #83

Closed GioChi12 closed 2 years ago

GioChi12 commented 2 years ago

The CDR function does not seem to work as intended when using the weighted Mack. In the CDR, the development factor and sigma are weighted, whereas the alpha factor is calculated on the unweighted cumulative payments. The CL_MSEPs function also does not adequately take the weights into account when calculating the correction factor for the aggregate value (res [ , 5, ]). Many thanks!

mages commented 2 years ago

Thanks for your contribution. I have merged this into the main branch now.

GioChi12 commented 2 years ago

Hi! I'm a new GitHub user and I think I did something wrong when uploading the commit😅. In fact, when I placed the commit on the MW weight matrix I had not set the account on the desktop correctly and so it appears to have been done by "unknown". Unfortunately, as a result of this misalignment, I am not even listed as a contributor. I thank you anyway for mentioning me in the thanks and news!!!🙂 I have now fixed the GitHub desktop set up and was wondering if it would be possible to revert the committ back to my correct name.

Thanks for your patience!!

[image: image.png]

Giorgia Chieruzzi +39 3779892732


Il giorno ven 10 giu 2022 alle ore 23:01 Markus Gesmann < @.***> ha scritto:

Thanks for your contribution. I have merged this into the main branch now.

— Reply to this email directly, view it on GitHub https://github.com/mages/ChainLadder/pull/83#issuecomment-1152735434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZR3MEK4ASH3YUIQFHGDL2TVOOUI7ANCNFSM5YNB3KLA . You are receiving this because you authored the thread.Message ID: @.***>

mages commented 2 years ago

Hi Giorgia,

Can I please ask you to add a test for the new functionality into the folder ChainLadder/inst/unitTests ? See https://github.com/mages/ChainLadder/blob/master/inst/unitTests/runit.MackChainLadder.R for examples.

Basically you have to create an R file with a simple example with a given data set and weights for which you know the output. The first test in the file above should give you the idea.

This will ensure that we know if future edits of the file break your code. Let me know if you need assistance.

Committing a test should add you as a contributor as well.

Thanks