Last data update: 2014.03.03

R: Incurred data (BDCL example)
ItriangleBDCLR Documentation

Incurred data (BDCL example)

Description

Real motor data from a major insurer. It is a yearly run-off (incremental) triangle consisting of the incurred data during 19 years. These data were used in the empirical illustration provided by Martinez-Miranda, Nielsen and Verrall (2013).

Usage

data(ItriangleBDCL)

Format

Matrix with dimension 19 by 19: 19 undewriting years and 19 development years.

References

Martinez-Miranda, M.D., Nielsen, J.P. and Verrall, R. (2013) Double Chain Ladder and Bornhuetter-Fergusson. North American Actuarial Journal, 17(2), 101-113.

Examples

data(ItriangleBDCL)
data(XtriangleBDCL)
m<-nrow(XtriangleBDCL)

clm.I<-clm(ItriangleBDCL)
alpha.I<-clm.I$alpha
# The total paid for each accident year in the past
Ri.X<-rowSums(XtriangleBDCL,na.rm=TRUE)
# Incurred outstanding numbers
Ri.CL.incurred<-alpha.I-Ri.X
Total.CL.incurred<- sum(Ri.CL.incurred,na.rm=TRUE)

## Compare with CL on paid data
clm.X<-clm(XtriangleBDCL)
Xhat<-as.matrix(clm.X$triangle.hat)
Ri.CL.paid<-rowSums(Xhat)-rowSums(XtriangleBDCL,na.rm=TRUE)
Total.CL.paid<- sum(Ri.CL.paid,na.rm=TRUE)

# the predictions by rows
data.frame(underw.year=c(1:m,"Total"),CLM.paid=c(Ri.CL.paid,Total.CL.paid),
           CLM.incurred=round(c(Ri.CL.incurred,Total.CL.incurred),4))

# now the predictions by diagonals
inflat.factor<-Ri.CL.incurred/Ri.CL.paid
inflat.factor[Ri.CL.paid==0]<-1
# the lower triangle from incurred chain ladder is defined as:
Ihat<-Xhat
for (i in 1:m) Ihat[i,]<-Xhat[i,]*inflat.factor[i]
# now the sums by diagonals
Diag.CL.paid<-sapply(split(Xhat, row(Xhat)+col(Xhat)), sum, na.rm=TRUE)
Dclm.paid<-c(Diag.CL.paid[-(1:m)])
Total.CL.paid<- sum(Dclm.paid,na.rm=TRUE)
Dclm.paid<-c(Dclm.paid,Total.CL.paid)

Diag.CL.inc<-sapply(split(Ihat, row(Ihat)+col(Ihat)), sum, na.rm=TRUE)
Dclm.inc<-c(Diag.CL.inc[-(1:m)])
Total.CL.inc<- sum(Dclm.inc,na.rm=TRUE)
Dclm.inc<-c(Dclm.inc,Total.CL.inc)

# A table with the chain ladder predictions (paid and incurred data)
data.frame(Future.years=c(1:(m-1),'Tot.'),
    clm.paid=round(Dclm.paid),clm.incurred=round(Dclm.inc))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DCL)
Loading required package: lattice
Loading required package: latticeExtra
Loading required package: RColorBrewer
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DCL/ItriangleBDCL.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ItriangleBDCL
> ### Title: Incurred data (BDCL example)
> ### Aliases: ItriangleBDCL
> ### Keywords: datasets
> 
> ### ** Examples
> 
> data(ItriangleBDCL)
> data(XtriangleBDCL)
> m<-nrow(XtriangleBDCL)
> 
> clm.I<-clm(ItriangleBDCL)
> alpha.I<-clm.I$alpha
> # The total paid for each accident year in the past
> Ri.X<-rowSums(XtriangleBDCL,na.rm=TRUE)
> # Incurred outstanding numbers
> Ri.CL.incurred<-alpha.I-Ri.X
> Total.CL.incurred<- sum(Ri.CL.incurred,na.rm=TRUE)
> 
> ## Compare with CL on paid data
> clm.X<-clm(XtriangleBDCL)
> Xhat<-as.matrix(clm.X$triangle.hat)
> Ri.CL.paid<-rowSums(Xhat)-rowSums(XtriangleBDCL,na.rm=TRUE)
> Total.CL.paid<- sum(Ri.CL.paid,na.rm=TRUE)
> 
> # the predictions by rows
> data.frame(underw.year=c(1:m,"Total"),CLM.paid=c(Ri.CL.paid,Total.CL.paid),
+            CLM.incurred=round(c(Ri.CL.incurred,Total.CL.incurred),4))
   underw.year     CLM.paid CLM.incurred
1            1         0.00        0.000
2            2         0.00        0.000
3            3         0.00     4011.000
4            4         0.00    -9524.000
5            5     17311.64    20158.528
6            6     34620.31    13624.401
7            7    138113.39     8814.279
8            8    244857.75    91331.409
9            9    352247.12    52707.584
10          10    394267.39   155568.250
11          11    552382.66   175211.578
12          12    683886.55  -158077.339
13          13   1050407.91   930316.952
14          14   2536084.02  2028994.383
15          15   5736951.32  4432453.845
16          16  14088911.72  6255460.777
17          17  21005735.85 11683582.273
18          18  44687656.90 23119061.356
19          19  98972310.33 39152239.189
20       Total 190495744.87 87955934.464
> 
> # now the predictions by diagonals
> inflat.factor<-Ri.CL.incurred/Ri.CL.paid
> inflat.factor[Ri.CL.paid==0]<-1
> # the lower triangle from incurred chain ladder is defined as:
> Ihat<-Xhat
> for (i in 1:m) Ihat[i,]<-Xhat[i,]*inflat.factor[i]
> # now the sums by diagonals
> Diag.CL.paid<-sapply(split(Xhat, row(Xhat)+col(Xhat)), sum, na.rm=TRUE)
> Dclm.paid<-c(Diag.CL.paid[-(1:m)])
> Total.CL.paid<- sum(Dclm.paid,na.rm=TRUE)
> Dclm.paid<-c(Dclm.paid,Total.CL.paid)
> 
> Diag.CL.inc<-sapply(split(Ihat, row(Ihat)+col(Ihat)), sum, na.rm=TRUE)
> Dclm.inc<-c(Diag.CL.inc[-(1:m)])
> Total.CL.inc<- sum(Dclm.inc,na.rm=TRUE)
> Dclm.inc<-c(Dclm.inc,Total.CL.inc)
> 
> # A table with the chain ladder predictions (paid and incurred data)
> data.frame(Future.years=c(1:(m-1),'Tot.'),
+     clm.paid=round(Dclm.paid),clm.incurred=round(Dclm.inc))
   Future.years  clm.paid clm.incurred
21            1  61090913     29285275
22            2  48061355     22479555
23            3  36266482     16365450
24            4  22989797      9957189
25            5  10439464      4528013
26            6   4913941      2121672
27            7   2380121      1108042
28            8   1174087       575821
29            9    848056       442853
30           10    599856       305586
31           11    593718       291169
32           12    495823       226244
33           13    397095       169517
34           14    135553        61752
35           15    109485        43311
36           16         0            0
37           17         0            0
38           18         0            0
           Tot. 190495745     87961447
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>