ChainLadder-package: Methods and Models for Claims Reserving

Description Author(s) References Examples

Description

ChainLadder provides methods and models which are typically used in insurance claims reserving.

The package grew out of presentations given at the Stochastic Reserving Seminar at the Institute of Actuaries in 2007 and 2008 and followed by talks at CAS meetings in 2008 and 2010.

More information is available on the project web site https://github.com/mages/ChainLadder

For more financial packages see also CRAN Task View 'Emperical Finance' at https://CRAN.R-project.org/view=Finance.

Author(s)

Maintainer: Markus Gesmann <markus.gesmann@gmail.com>

References

Thomas Mack. Distribution-free calculation of the standard error of chain ladder reserve estimates. Astin Bulletin. Vol. 23. No 2. 1993. pp.213:225

Thomas Mack. The standard error of chain ladder reserve estimates: Recursive calculation and inclusion of a tail factor. Astin Bulletin. Vol. 29. No 2. 1999. pp.361:366

Gerhard Quarg and Thomas Mack. Munich Chain Ladder. Blatter DGVFM 26. Munich. 2004.

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

B. Zehnwirth and G. Barnett. Best Estimates for Reserves. Proceedings of the CAS. Volume LXXXVII. Number 167.November 2000.

Clark, David R., "LDF Curve-Fitting and Stochastic Reserving: A Maximum Likelihood Approach," CAS Forum, Fall 2003.

Zhang Y. A general multivariate chain ladder model.Insurance: Mathematics and Economics, 46, pp. 588:599, 2010.

Zhang, Y. Likelihood-based and Bayesian Methods for Tweedie Compound Poisson Linear Mixed Models, Statistics and Computing, forthcoming.

Bardis, Majidi, Murphy. A Family of Chain-Ladder Factor Models for Selected Link Ratios. Variance. Pending. Variance 6:2, 2012, pp. 143-160.

Modelling the claims development result for solvency purposes. Michael Merz, Mario V. Wüthrich. Casualty Actuarial Society E-Forum, Fall 2008.

Claims Run-Off Uncertainty: The Full Picture. Michael Merz, Mario V. Wüthrich. Swiss Finance Institute Research Paper No. 14-69. https://www.ssrn.com/abstract=2524352. 2014

Markus Gesmann. Claims Reserving and IBNR. Computational Actuarial Science with R. Chapman and Hall/CRC. 2014

Examples

1
2
3
4
## Not run: 
  demo(ChainLadder)
  
## End(Not run)

Example output

Welcome to ChainLadder version 0.2.11

Type vignette('ChainLadder', package='ChainLadder') to access
the overall package documentation.

See demo(package='ChainLadder') for a list of demos.

More information is available on the ChainLadder project web-site:
https://github.com/mages/ChainLadder

To suppress this message use:
suppressPackageStartupMessages(library(ChainLadder))



	demo(ChainLadder)
	---- ~~~~~~~~~~~

> ## Demos for the ChainLadder package
> ## See also the demos for:
> ## demo(MackChainLadder)
> ## demo(DatabaseExamples)
> ## demo(MSOffice)
> 
> ## Example triangle
> RAA
      dev
origin    1     2     3     4     5     6     7     8     9    10
  1981 5012  8269 10907 11805 13539 16181 18009 18608 18662 18834
  1982  106  4285  5396 10666 13782 15599 15496 16169 16704    NA
  1983 3410  8992 13873 16141 18735 22214 22863 23466    NA    NA
  1984 5655 11555 15766 21266 23425 26083 27067    NA    NA    NA
  1985 1092  9565 15836 22169 25955 26180    NA    NA    NA    NA
  1986 1513  6445 11702 12935 15852    NA    NA    NA    NA    NA
  1987  557  4020 10946 12314    NA    NA    NA    NA    NA    NA
  1988 1351  6947 13112    NA    NA    NA    NA    NA    NA    NA
  1989 3133  5395    NA    NA    NA    NA    NA    NA    NA    NA
  1990 2063    NA    NA    NA    NA    NA    NA    NA    NA    NA

> plot(RAA)

> plot(RAA, lattice=TRUE)

> MCL <- MackChainLadder(RAA, est.sigma="Mack")

> MCL
MackChainLadder(Triangle = RAA, est.sigma = "Mack")

     Latest Dev.To.Date Ultimate   IBNR Mack.S.E CV(IBNR)
1981 18,834       1.000   18,834      0        0      NaN
1982 16,704       0.991   16,858    154      206    1.339
1983 23,466       0.974   24,083    617      623    1.010
1984 27,067       0.943   28,703  1,636      747    0.457
1985 26,180       0.905   28,927  2,747    1,469    0.535
1986 15,852       0.813   19,501  3,649    2,002    0.549
1987 12,314       0.694   17,749  5,435    2,209    0.406
1988 13,112       0.546   24,019 10,907    5,358    0.491
1989  5,395       0.336   16,045 10,650    6,333    0.595
1990  2,063       0.112   18,402 16,339   24,566    1.503

              Totals
Latest:   160,987.00
Dev:            0.76
Ultimate: 213,122.23
IBNR:      52,135.23
Mack.S.E   26,909.01
CV(IBNR):       0.52

> plot(MCL)

> # plot developments by origin period
> plot(MCL, lattice=TRUE)

> # one year claims development result
> CDR(MCL)
            IBNR CDR(1)S.E.  Mack.S.E.
1981      0.0000     0.0000     0.0000
1982    153.9539   206.2201   206.2201
1983    617.3709   578.7123   623.3767
1984   1636.1422   396.1728   747.1752
1985   2746.7363  1304.8194  1469.4571
1986   3649.1032  1669.8645  2001.8569
1987   5435.3026  1188.0150  2209.2421
1988  10907.1925  4692.1851  5357.8693
1989  10649.9841  4707.4495  6333.1659
1990  16339.4425 23610.4763 24566.2879
Total 52135.2283 25181.9509 26909.0112

> # BootChainLadder
> B <- BootChainLadder(RAA, R=999, process.distr="gamma")

> B
BootChainLadder(Triangle = RAA, R = 999, process.distr = "gamma")

     Latest Mean Ultimate Mean IBNR IBNR.S.E IBNR 75% IBNR 95%
1981 18,834        18,834         0        0        0        0
1982 16,704        16,860       156      677      165    1,458
1983 23,466        24,042       576    1,191    1,041    2,738
1984 27,067        28,774     1,707    1,822    2,670    5,024
1985 26,180        29,077     2,897    2,396    4,094    7,510
1986 15,852        19,531     3,679    2,451    4,844    8,148
1987 12,314        17,892     5,578    3,267    7,361   11,698
1988 13,112        24,105    10,993    5,106   13,821   20,328
1989  5,395        16,134    10,739    5,995   14,269   22,101
1990  2,063        18,815    16,752   13,779   23,370   42,327

                 Totals
Latest:         160,987
Mean Ultimate:  214,064
Mean IBNR:       53,077
IBNR.S.E         18,607
Total IBNR 75%:  63,371
Total IBNR 95%:  85,940

> plot(B)

> # one year claims development result
> CDR(B)
            IBNR   IBNR.S.E  CDR(1)S.E  CDR(1)75% CDR(1)95%
1981      0.0000     0.0000     0.0000     0.0000     0.000
1982    155.5929   677.1283   677.1283   165.0283  1458.308
1983    576.2719  1190.5278  1015.0077   943.6077  2667.193
1984   1707.1330  1822.0990  1388.6815  2307.6838  4522.718
1985   2897.1069  2396.0480  1591.6785  3577.4449  5798.283
1986   3678.9434  2451.0593  1795.9199  4598.6555  7279.643
1987   5577.7933  3267.2336  2171.3378  6534.0104  9504.156
1988  10993.0493  5106.4432  3404.4754 12810.8133 17421.717
1989  10739.2404  5995.3107  4482.3641 13458.3705 18893.353
1990  16752.2997 13779.4802 11251.7617 22479.6024 37212.841
Total 53077.4308 18607.0249 14850.2264 60452.4288 80068.171

> # fit a log-normal distribution
> library(MASS)

> # fit a log-normal distribution
> fit <-  fitdistr(B$IBNR.Totals, "lognormal")

> fit
     meanlog         sdlog    
  10.817342085    0.361706371 
 ( 0.011443883) ( 0.008092047)

> plot(ecdf(B$IBNR.Totals))

> curve(plnorm(x,fit$estimate["meanlog"], fit$estimate["sdlog"]), col="red", add=TRUE)

> # Munich Chain Ladder
> MCLpaid
      dev
origin    1    2    3    4    5    6    7
     1  576 1804 1970 2024 2074 2102 2131
     2  866 1948 2162 2232 2284 2348   NA
     3 1412 3758 4252 4416 4494   NA   NA
     4 2286 5292 5724 5850   NA   NA   NA
     5 1868 3778 4648   NA   NA   NA   NA
     6 1442 4010   NA   NA   NA   NA   NA
     7 2044   NA   NA   NA   NA   NA   NA

> MCLincurred
      dev
origin    1    2    3    4    5    6    7
     1  978 2104 2134 2144 2174 2182 2174
     2 1844 2552 2466 2480 2508 2454   NA
     3 2904 4354 4698 4600 4644   NA   NA
     4 3502 5958 6070 6142   NA   NA   NA
     5 2812 4882 4852   NA   NA   NA   NA
     6 2642 4406   NA   NA   NA   NA   NA
     7 5022   NA   NA   NA   NA   NA   NA

> MCL <- MunichChainLadder(MCLpaid, MCLincurred, est.sigmaP="Mack", est.sigmaI="Mack")

> MCL
MunichChainLadder(Paid = MCLpaid, Incurred = MCLincurred, est.sigmaP = "Mack", 
    est.sigmaI = "Mack")

  Latest Paid Latest Incurred Latest P/I Ratio Ult. Paid Ult. Incurred
1       2,131           2,174            0.980     2,131         2,174
2       2,348           2,454            0.957     2,385         2,443
3       4,494           4,644            0.968     4,554         4,634
4       5,850           6,142            0.952     6,070         6,182
5       4,648           4,852            0.958     4,879         4,958
6       4,010           4,406            0.910     4,599         4,672
7       2,044           5,022            0.407     7,505         7,655
  Ult. P/I Ratio
1          0.980
2          0.976
3          0.983
4          0.982
5          0.984
6          0.984
7          0.980

Totals
            Paid Incurred P/I Ratio
Latest:   25,525   29,694      0.86
Ultimate: 32,121   32,720      0.98

> plot(MCL)

> # Working with triangles
> # RAA is a matrix with additional class attribute 'triangle'
> class(RAA)
[1] "triangle" "matrix"  

> # default plot for a triangle
> plot(RAA)

> # plot developments by origin period
> plot(RAA, lattice=TRUE)

> # Triangles can easily be converted into data.frames via
> X=as.data.frame(RAA)

> X
        origin dev value
1981-1    1981   1  5012
1982-1    1982   1   106
1983-1    1983   1  3410
1984-1    1984   1  5655
1985-1    1985   1  1092
1986-1    1986   1  1513
1987-1    1987   1   557
1988-1    1988   1  1351
1989-1    1989   1  3133
1990-1    1990   1  2063
1981-2    1981   2  8269
1982-2    1982   2  4285
1983-2    1983   2  8992
1984-2    1984   2 11555
1985-2    1985   2  9565
1986-2    1986   2  6445
1987-2    1987   2  4020
1988-2    1988   2  6947
1989-2    1989   2  5395
1990-2    1990   2    NA
1981-3    1981   3 10907
1982-3    1982   3  5396
1983-3    1983   3 13873
1984-3    1984   3 15766
1985-3    1985   3 15836
1986-3    1986   3 11702
1987-3    1987   3 10946
1988-3    1988   3 13112
1989-3    1989   3    NA
1990-3    1990   3    NA
1981-4    1981   4 11805
1982-4    1982   4 10666
1983-4    1983   4 16141
1984-4    1984   4 21266
1985-4    1985   4 22169
1986-4    1986   4 12935
1987-4    1987   4 12314
1988-4    1988   4    NA
1989-4    1989   4    NA
1990-4    1990   4    NA
1981-5    1981   5 13539
1982-5    1982   5 13782
1983-5    1983   5 18735
1984-5    1984   5 23425
1985-5    1985   5 25955
1986-5    1986   5 15852
1987-5    1987   5    NA
1988-5    1988   5    NA
1989-5    1989   5    NA
1990-5    1990   5    NA
1981-6    1981   6 16181
1982-6    1982   6 15599
1983-6    1983   6 22214
1984-6    1984   6 26083
1985-6    1985   6 26180
1986-6    1986   6    NA
1987-6    1987   6    NA
1988-6    1988   6    NA
1989-6    1989   6    NA
1990-6    1990   6    NA
1981-7    1981   7 18009
1982-7    1982   7 15496
1983-7    1983   7 22863
1984-7    1984   7 27067
1985-7    1985   7    NA
1986-7    1986   7    NA
1987-7    1987   7    NA
1988-7    1988   7    NA
1989-7    1989   7    NA
1990-7    1990   7    NA
1981-8    1981   8 18608
1982-8    1982   8 16169
1983-8    1983   8 23466
1984-8    1984   8    NA
1985-8    1985   8    NA
1986-8    1986   8    NA
1987-8    1987   8    NA
1988-8    1988   8    NA
1989-8    1989   8    NA
1990-8    1990   8    NA
1981-9    1981   9 18662
1982-9    1982   9 16704
1983-9    1983   9    NA
1984-9    1984   9    NA
1985-9    1985   9    NA
1986-9    1986   9    NA
1987-9    1987   9    NA
1988-9    1988   9    NA
1989-9    1989   9    NA
1990-9    1990   9    NA
1981-10   1981  10 18834
1982-10   1982  10    NA
1983-10   1983  10    NA
1984-10   1984  10    NA
1985-10   1985  10    NA
1986-10   1986  10    NA
1987-10   1987  10    NA
1988-10   1988  10    NA
1989-10   1989  10    NA
1990-10   1990  10    NA

> # Tables can also be converted into triangles
> triangle <- as.triangle(X, origin="origin", dev="dev", value="value")

> triangle
      dev
origin    1     2     3     4     5     6     7     8     9    10
  1981 5012  8269 10907 11805 13539 16181 18009 18608 18662 18834
  1982  106  4285  5396 10666 13782 15599 15496 16169 16704    NA
  1983 3410  8992 13873 16141 18735 22214 22863 23466    NA    NA
  1984 5655 11555 15766 21266 23425 26083 27067    NA    NA    NA
  1985 1092  9565 15836 22169 25955 26180    NA    NA    NA    NA
  1986 1513  6445 11702 12935 15852    NA    NA    NA    NA    NA
  1987  557  4020 10946 12314    NA    NA    NA    NA    NA    NA
  1988 1351  6947 13112    NA    NA    NA    NA    NA    NA    NA
  1989 3133  5395    NA    NA    NA    NA    NA    NA    NA    NA
  1990 2063    NA    NA    NA    NA    NA    NA    NA    NA    NA

> # One may also create triangles from data "by hand"
> triangle("2012" = c(100, 150, 175, 180, 200),
+          "2013" = c(110, 168, 192, 205),
+          "2014" = c(115, 169, 202),
+          "2015" = c(125, 185),
+          "2016" = 150)
      dev
origin   1   2   3   4   5
  2012 100 150 175 180 200
  2013 110 168 192 205  NA
  2014 115 169 202  NA  NA
  2015 125 185  NA  NA  NA
  2016 150  NA  NA  NA  NA

> # Quick, simplified usage with a single vector of data
> triangle(c(100, 150, 175, 180, 200,
+            110, 168, 192, 205,
+            115, 169, 202,
+            125, 185,
+            250))
      dev
origin   1   2   3   4   5
     1 100 150 175 180 200
     2 110 168 192 205  NA
     3 115 169 202  NA  NA
     4 125 185  NA  NA  NA
     5 250  NA  NA  NA  NA

> ## More for a laugh - 3d plot of a triangle and MackChainLadder output
> if(require(rgl)){ #provides interactive 3d plotting functions
+     MCL=MackChainLadder(GenIns/1e6, est.sigma="Mack")
+     FT <- MCL$FullTriangle
+     FTpSE <- FT+MCL$Mack.S.E
+     FTpSE[which(MCL$Mack.S.E==0, arr.ind=TRUE)] <- NA
+     FTmSE <- FT-MCL$Mack.S.E
+     FTmSE[which(MCL$Mack.S.E==0, arr.ind=TRUE)] <- NA
+     zr <- round(FT/FT[1,10]*100)
+     zlim <- range(zr, na.rm=TRUE)
+     zlen <- zlim[2] - zlim[1] + 1
+     colorlut <- terrain.colors(zlen) # height color lookup table
+     cols <- colorlut[ zr -zlim[1]+1 ] # assign colors to heights for each point
+     x <- as.numeric(dimnames(FT)$origin)
+     y <- as.numeric(dimnames(FT)$dev)
+     persp3d(x, y=y, z=(FT), col=cols, xlab="origin", ylab="dev", zlab="loss",back="lines")
+     mSE <- data.frame(as.table(FTmSE))
+     points3d(xyz.coords(x=as.numeric(as.character(mSE$origin)), y=as.numeric(as.character(mSE$dev)),z=mSE$Freq), size=2)
+     pSE <- data.frame(as.table(FTpSE))
+     points3d(xyz.coords(x=as.numeric(as.character(pSE$origin)), y=as.numeric(as.character(pSE$dev)),z=pSE$Freq), size=2)
+ }
Loading required package: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 

ChainLadder documentation built on Jan. 9, 2022, 5:06 p.m.