Tuesday, 20 November 2012

Claims reserving in R: ChainLadder 0.1.5-4 released

Last week we released version 0.1.5-4 of the ChainLadder package on CRAN. The R package provides methods which are typically used in insurance claims reserving. If you are new to R or insurance check out my recent talk on Using R in Insurance.

The chain-ladder method which is a popular method in the insurance industry to forecast future claims payments gave the package its name. However, the ChainLadder package has many other reserving methods and models implemented as well, such as the bootstrap model demonstrated below. It is a great starting point to learn more about stochastic reserving.

Since we published version 0.1.5-2 in March 2012 additional functionality has been added to the package, see the change log, but in particular the vignette has come a long way.

Many thanks to my co-authors Dan Murphy and Wayne Zhang.



The vignette is still not finished and your feedback, comments and suggestions will help greatly to move it forward.

Should you find any issues or bugs with the package, then please drop us a line or add them to our issues list.

Here are the changes since the last CRAN release:


Version 0.1.5-4


NEW FEATURES
  • The function getLatestCumulative adds attributes to the result
    • names = origin (rownames) from the Triangle
    • rowsname = name of row dimension of Triangle
    • colnames = dev (colnames) from Triangle
    • colsname = name of the column dimension of Triangle
    The function has an additional argument, na.values, a vector of values (e.g., zero) that are synonymous with NA when searching for the rightmost non-NA value
  • as.triangle.data.frame now aggregates multiple data.frame records when more than one (origin, dev) observation is found (the previous version took the first observation).
Changes
  • The vignette has been updated with sections on Multivariate chain-ladder, Clark's method and Generalised linear model methods
  • MunichChainLadder no longer accepts triangles with more rows than columns as the function is not laid out for such data sets yet. Thanks to Ben Escoto for highlighting this issue.

Version 0.1.5-3 [not released on CRAN]


NEW FEATURES
  • The function glmReserve now simulates predictive distributions of the loss reserves when bootstrapping is used.
  • glmReserve allows the variance function of the compound Poisson distribution to be estimated from the data, using the estimation method provided by the cplm package.
  • We offer a new function MultiChainLadder2 to fit several commonly used multivariate chain ladder models, which is much easier to use.
Changes
  • The output from glmReserve is made to be of class glmReserve,instead of class glm used in previous versions.
  • Fix bugs when exposure is included in glmReserve. Thanks to Alessandro Carrato for reporting this bug.
  • The mse.method argument in glmReserve supports partial match.
  • Dramatic improvement on the documentation of MultiChainLadder.
  • Complete the sections of MultiChainLadder and glmReserve in the vignettes.

Bootstrap chain-ladder example


To illustrate one of the stochastic methods of the package, here is an example of the BootChainLadder function, which is based on a paper by England and Verrall [1].

The functions bootstraps the chain-ladder residuals R(=999) times and re-estimates the IBNR to provide an approximation of the full distribution.




The plot shows four graphs, starting with a histogram of the total simulated IBNRs over all origin periods, including a rug plot; a plot of the empirical cumulative distribution of the total IBNRs over all origin periods; a box-whisker plot of simulated ultimate claims costs against origin periods; and a box-whisker plot of simulated incremental claims cost for the latest available calendar period against actual incremental claims of the same period. In the last plot the simulated data should follow the same trend as the actual data, otherwise the original data might have some intrinsic trends which are not reflected in the model, see also Barnett and Zehnwirth [2].

References


[1] England, PD and Verrall, RJ. Stochastic Claims Reserving in General Insurance (with discussion), British Actuarial Journal 8, III. 2002.

[2] Barnett and Zehnwirth. The need for diagnostic assessment of bootstrap predictive models, Insureware technical report. 2007

No comments:

Post a Comment