mages / ChainLadder

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

tweedieReserve : var.power=NULL not working #73

Open bru89dadou opened 4 years ago

bru89dadou commented 4 years ago

Hello,

The tweedieReserve function is not working when the var.power argument is NULL.

The documentation of the package says that "If NULL, it will be assumed to be in (1,2) and estimated using the cplm package.". I think it is a mistake in the documentation. Indeed, when analysing the code, I don't think the author has tried to implement any code that tackles a NULL value for the var.power argument.

This option is only available with the function glmReserve.

Is that correct ?

It could be nice to implement it within the tweedieReserve code since this function allows ODP model based on the calendar year which is not the case of the glmReserve.

Thank you in advance.

Regards,

BD

cryptoactuary commented 4 years ago

Hi BD In fact, when I wrote the tweedieReserve function, it was before the glmReserve implemented the tweedie library: the idea was exactly to "extend" the glmReserve function, to have the one-year view and the possibility to challenge the distribution using a tweedie model. At the time, this was designed to provide technical evidence that an ODP or Gamma model were suitable to model the data or not during the Internal Model Approval Process (IMAP) for the regulators who needed it

To this extent, the idea was to use in the first run the p.optim=TRUE parameter, specifying the design matrix: this will then allow you to pick the right var.power value and run your model. A concrete example is provided in the package vignette, Chapter 9

So you are right - no handle of NULL. Could you please let me know where this is in the documentation so we will fix it?

Many thanks Alessandro

bru89dadou commented 4 years ago

Hi Alessandro,

Thank you for your reply and sorry for the delay.

It is written page 107 of the documentation paper : https://cran.r-project.org/web/packages/ChainLadder/ChainLadder.pdf

Regarding your answer, it is clear to me. Nevertheless, it is sometimes difficult based on the graph generated with p.optim=TRUE to decide which is the best var.power value between 1 and 2. If you are interested, I have adapted easily the code in order to estimate var.power using the cplm package when such situation happens (and therefore when the user wishes to estimate it by specifying var.power=NULL).

Thank you very much.