Overview
ChainLadder (google code name chainladder) is an R package that grew out of presentations the author gave at the Stochastic Reserving Seminar at the Institute of Actuaries in November 2007 and 2008. The package provides the Mack-, Munich- and Bootstrap-chain-ladder models. ChainLadder is also available via CRAN.
New version 0.1.2-12 provides utility functions to convert: triangles <-> tables; incremental <-> cumulative triangles. See also some examples here.
Installation
From CRAN
Start R on your computer and type:
install.packages('ChainLadder')From Google Code
R under Windows
- Go to the "Downloads" tab on this site and download the most recent zip-file (Windows binary) to your hard drive.
- Open R and select from the "Packages" menu at the top of the R console "Install package(s) from local zip files...".
- Naviagate to the folder where you saved the zip-file, select the zip-file and click open.
R under UNIX
- Go to the "Downloads" tab on this site and download the most recent tar.gz-file (source code) to your hard drive.
- Open a terminal window and navigate to the folder where you saved the tar.gz-file and type: R CMD INSTALL ChainLadder_x.x.x.tar.gz (subsitute x.x.x with the version number)
Using ChainLadder
After you installed the package type into R:
library('ChainLadder')Documentation
Examples
- To get an idea of the ChainLadder package check out some examples here.
- The ChainLadder package provides also an example spreadsheet, which shows you how you can access the ChainLadder R functions from Excel via the RExcel-Addin. After you installed the package you will find the spreadsheet in the ChainLadder library folder. The R command searchpaths()[grep('ChainLadder', searchpaths())] tells you the path to the Excel-folder; alternatively you can download it here.
- Using the rcom package it is possible to put your R output directly into PowerPoint or Word, see here for an example.
Presentations
- The ChainLadder package, working with databases and MS Office interfaces, presentation at the "R you ready?" workshop, Institute of Actuaries, 24 July 2009
- The ChainLadder package at the London R user group meeting 31 March 2009
- Introduction to R, Loss Reserving with R at the Stochastic Reserving and Modelling Seminar, 2 -- 3 December 2008, Institute of Actuaries, London
- Loss Reserving with R, together with Vincent Goulet and Daniel Murphy at the annual CAS meeting in Seattle November 2008
- ChainLadder at R-user conference Dortmund August 2008
- Screencast: How to install R and Rtools under Windows
Useful links
- Introduction to R for Actuaries by Nigel de Silva
- If you are also interested in loss distributions modeling, risk theory (including ruin theory), simulation of compound hierarchical models and credibility theory check out the actuar package by C. Dutang, V. Goulet and M. Pigeon.
- If have trouble with your IT department to get R on your machine this document might help you to put some good arguments forward. The report "An Actuarial Toolkit" was presented at the GIRO convention 2006 in Vienna.
- The RToolkit web page has a lot of examples, tips and tricks with R in an actuarial context.
- Here is a video showing how to build R packages under MS Windows
- There is a half hour long video demo about using R via Excel (RExcel) at http://rcom.univie.ac.at/RExcelDemo/
- R-SIG-insurance -- Special Interest Group on using R in actuarial science and insurance
News
Version 0.1.2.12
================
NEW FEATURES
o New triangle class with S3 methods for plot, print and conversion from triangles to data.frames and vis versa
o New utility functions 'incr2cum' and 'cum2incr' to convert incremental triangles into cumulative triangles
and vis versa. Thanks to Chritophe Dutang.
o New logical argument lattice for plot.MackChainLadder (and plot.triangle), which allows to plot developments
by origin period in separate panels.
BUG FIXES
o 'MunichChainLadder': tail factors were not accepted. Thanks to Stefan Pohl for reporting this issue.
Version 0.1.2-11
===============
BUG FIXES
o 'MackChainLadder': 'F.se'[ultimate] was calculated of the ultimate column instead of the latest paid.
Version 0.1.2-10
===============
USER-VISIBLE CHANGES
o 'MackChainLadder' has new arguments 'tail.sigma' and 'tail.se' to provide estimates
of the variability for a given tail factor.
BUG FIXES
o 'MackChainLadder': calculation of 'Mack.S.E' did not use an ultimate sigma factor to estimate
'Mack.S.E' when a tail factor > 1 was provided (Thanks to Mark Hoffmann for reporting this issue).
Version 0.1.2-9
===============
USER-VISIBLE CHANGES
o Updated documentation to work with new Rd-file parser (R version >= 2.9.0)
o Updated documentation for 'ABC' data (Thanks to Glen Barnett)
Version 0.1.2-8
===============
USER-VISIBLE CHANGES
o Updated documentation for 'MackChainLadder' (Thanks to Daniel Murphy)
Version 0.1.2-7
===============
USER-VISIBLE CHANGES
o 'MackChainLadder' gives two more elements back: 'Mack.ProcessRisk' and 'Mack.ParameterRisk'
for the process and parameter risk error (Thanks to Daniel Murphy)
o In the sumumary output of'MackChainLadder' the label 'CV' changed to 'CV(IBNR)' to clarify
that we show the coefficient of variance of the IBNR.
o 'MackChainLadder' provides new example plots for CV(IBNR) vs. origin period and CV(Ultimate) vs. origin period
o Updated documentation
Version 0.1.2-6
===============
USER-VISIBLE CHANGES
o Updated documentation
Version 0.1.2-5
===============
NEW FEATURES
o New function 'BootChainLadder', based on papers by England and Verrall,
and Barnett and Zehnwirth
o 'MackChainLadder' and 'MunichChainLadder' allow for tail factors
o 'MackChainLadder' estimates the overall standard error for the total IBNR
o New arguments 'tail' and 'est.sigma' for MackChainLadder, to control
the tail factor and the estimation of sigma_{n-1}
o New arguments 'tailP', 'tailI' and 'est.sigmaP', 'est.sigmaI' for
'MunichChainLadder', which are passed on to 'MackChainLadder' to control
the tail factor and the estimation of sigma_{n-1} for the Paid and
Incurred triangle
o 'Mack-, 'Munich-, and 'BootChainLadder' accept (mxn) matrices with m>=n,
e.g more accident years than development years
o New example data sets: 'ABC' (annual run-off triangle of a worker's
compensation portfolio of a large company), 'qpaid', 'qincurred' ('made-up'
data of a quarterly development triangle of annual origin period)
o Triangles with higher development period frequency (e.g quarterly) than
origin period frequency (e.g annual) can be used after being 'blown-up'
to a common period frequency, see the help of 'qpaid'
o 'Mack-, 'Munich- and 'BootChainLadder' accept 'blown-up' triangles of
higher development period frequency than origin period frequency filled
with 'NA', see the help of 'qpaid'
USER-VISIBLE CHANGES
o summary functions for 'Mack-, 'Munich-, 'BootChainLadder' give all a list
back with two elements: 'ByOrigin' and 'Totals'
o Change of labels: origin years -> origin period and development years ->
development origin
o Coefficient of Variance is abbreviate with 'CV' instead of 'CoV'
o The example spreadsheet 'ChainLadder_in_Excel.xls' has new examples,
including 'BootChainLadder'
o New greeting message after the R-call 'library(ChainLadder)'
o Improved documentation
BUG FIXES
o 'MunichChainLadder': calculation of 'lambdaP' and 'lambdI' was incorrect.
Thanks to Beat Huggler for reporting this issue.
2008-09-23 Markus Gesmann <markus.gesmann@gmail>
* R/BootstrapReserve.R Included all the functions for the BootChainLadder
function. The BootChainLadder procedure provides a predictive
distribution of reserves for a cumulative claims development
triangle.
* R/BootstrapReserve.R, MackChainLadder.R, MunichChainLadder The summary
methods for MackChainLadder, MunichChainLadder, BootChainLadder
give a list back with two elements "ByOrigin" and "Totals"
* R/zzz.R Included a .onLoad function to produce a little meassage
after the ChainLadder packge is loaded.
* Excel/ChainLadder_in_Excel.xls Added new examples for
BootChainLadder and how to use Rapply to call functions from the
ChainLadder package.
2008-09-18 Markus Gesmann <markus.gesmann@gmail.com>
* R/MackChainLadder.R Included tail factor estimation. The
function MackChainLadder has a new argument "tail" to either
estimate the tail factor via a log-linear regression or to set it manually.
* data/qpaid.RData, qincurred.RData Added examples of quarterly
development triangles
2008-09-08 Markus Gesmann <markus.gesmann@gmail.com>
* R/MackChainLadder.R Prepared the functions Mack.S.E and
Total.Mack.S.E to accept triangles with rows full of NA values.
This might be useful for non quadratic triangles
2008-05-19 Markus Gesmann <markus.gesmann@gmail.com>
* R/MackChainLadder.R Bug fix: Function Mack.S.E did not give F.se back,
which is needed by TotalMack.S.E.
Many thanks to Florian Leitenstorfer for reporting this issue.
2008-05-11 Markus Gesmann <markus.gesmann@gmail.com>
* inst/Excel/ChainLadder_in_Excel.xls uses now dynamic functions
and shows how to call 'plot' from Excel
* R/MackChainLadderFunctions.R: Changed labels Reserving to IBNR
(=Incurred But Not Reported)
2008-02-02 Markus Gesmann <markus.gesmann@gmail.com>
* R/MackChainLadderFunctions.R: Mack.S.E checks now which sigma>0 before log
linear regression of sigma to estimate sigma[n-1]
2008-02-11 Markus Gesmann <markus.gesmann@gmail.com>
* R/MackChainLadderFunctions.R: added function
TotalMack.S.E function to estimate the overall standard error for
the reserve. MackChainLadder gives now also the
Total.Mack.S.E. back plus the estimate standard error for all
individual age-to-age factors F.se.