Last data update: 2014.03.03

R: Bootstrap distribution (the full cashflow) adding prior...
dcl.boot.priorR Documentation

Bootstrap distribution (the full cashflow) adding prior knowledge

Description

Provide the distribution of the IBNR, RBNS and total (RBNS+IBRN) reserves by calendar years and rows using bootstrapping.

Usage

dcl.boot.prior( Xtriangle , Ntriangle , sigma2 , mu , inflat.i , inflat.j , Qi , 
    Model = 2 , adj = 1 , boot.type = 2, B = 999 ,  
    Tail = TRUE , summ.by = "diag", Tables = TRUE, num.dec = 2 , n.cal = NA ,
    Fj.X = NA , Fj.N = NA )

Arguments

Xtriangle

The paid run-off triangle: incremental aggregated payments. It should be a matrix with incremental aggregated payments located in the upper triangle and the lower triangle consisting in missing or zero values.

Ntriangle

The counts data triangle: incremental number of reported claims. It should be a matrix with the observed counts located in the upper triangle and the lower triangle consisting in missing or zero values. It should has the same dimension as Xtriangle (both in the same aggregation level (quarters, years,etc.))

sigma2

Optional. The variance of the individual payments in the first underwriting period.

mu

Optional. The mean of the individual payments in the first underwriting period.

inflat.i

Optional. A vector with dimension m (the dimension of the input triangles) specifying the severity inflation in the underwriting direction.

inflat.j

Optional. A vector with dimension m specifying the severity inflation in the development direction. If not specified it will be assumed to be 1 and then the severity mean not depending on the development period.

Qi

Optional. A vector with dimension m specifying the probability of zero-claims for each underwriting period. If not specified then it will be assumed no zero-payments.

Model

Possible values are 0, 1 or 2 (default). See dcl.estimation for more in details.

adj

Method to adjust the estimated delay parameters for the distributional model. It should be 1 (default value) or 2. See dcl.estimation for more details.

boot.type

Choose between values 1, to provide only the variance process, or 2 (default), to take into account the uncertainty of the parameters.

B

The number of simulations in the bootstrap algorithm. The defaul value is 999.

Tail

Logical. If TRUE (default) the tail is provided.

summ.by

A character value such as "diag", "row" or "cell".

Tables

Logical. If TRUE (default) it is showed a table with the summary (mean, standard deviation, 1%, 5%, 50%, 95%, 99%) of the distribution of the outstanding liabilities in the future calendar periods (if summ.by="diag") or by underwriting period (if summ.by="row").

num.dec

Number of decimal places used to report numbers in the tables. Used only if Tables=TRUE

n.cal

Integer specifying the number of most recent calendars which will be used to calculate the development factors. By default n.cal=NA and all the observed calendars are used (classical chain ladder).

Fj.X

Optional vector with lentgth m-1 (m being the dimension of the triangles) with the development factors to calculate the chain ladder estimates from Xtriangle. See more details in clm.

Fj.N

Optional vector with lentgth m-1 with the development factors to calculate the chain ladder estimates from Ntriangle.

Details

If proper values are provided for the arguments sigma2, mu, inflat.i, inflat.j and Qi then, they will be considered fixed as prior knowledge. Otherwise, if not specified, inflat.j will be assumed to be a vector of ones, Qi a vector of zeros, and the rest will be estimated using dcl.estimation.

Value

array.rbns.boot

An array with dimensions (m,2m-1,B) (m being the dimension of the input triangles in DCL). Each array.rbns.boot[,,b] is a matrix, with m rows and 2m-1 columns, having the bootstrapped outstanding RBNS numbers as the entries (for b=1,...,B).

Mat.rbns

A matrix with B rows and 2m columns. Each Mat.rbns[b,] is a vector with elements being the outstanding liabilities for RBNS claims in the future calendar periods (sums by diagonals), and last value is the RBNS reserve (overall sum).

array.ibnr.boot

An array with dimensions (m,2m-1,B) (m being the dimension of the input triangles in DCL). Each array.ibnr.boot[,,b] is a matrix, with m rows and 2m-1 columns, having the bootstrapped outstanding IBNR numbers as the entries (for b=1,...,B).

Mat.ibnr

A matrix with B rows and 2m columns. Each Mat.ibnr[b,] is a vector with elements being the outstanding liabilities for IBNR claims in the future calendar periods (sums by diagonals), and last value is the RBNS reserve (overall sum).

Mat.total

A matrix with B rows and 2m columns. Each Mat.total[b,] is a vector with elements being the outstanding liabilities for total(=RBNS+IBNR) claims in the future calendar periods (sums by diagonals), and last value is the RBNS reserve (overall sum).

summ.rbns

A dataframe with the summary of the RBNS distribution. Only if Tables=TRUE.

summ.ibnr

A dataframe with the summary of the IBNR distribution. Only if Tables=TRUE.

summ.total

A dataframe with the summary of the total(=RBNS+IBNR) distribution. Only if Tables=TRUE.

Note

If boot.type=2 the function will take some time to perform the calculations. It increases with the dimension of the triangles and the specified number of simulations B.

Author(s)

M.D. Martinez-Miranda, J.P. Nielsen and R. Verrall

References

Martinez-Miranda, M.D., Nielsen, J.P., Verrall, R. and Wuthrich, M.V. (2013) Double Chain Ladder, Claims Development Inflation and Zero Claims. Scandinavian Actuarial Journal. In press.

See Also

Plot.cashflow, dcl.boot

Examples

## Data application by in Martinez-Miranda, Nielsen, Verrall and Wuthrich (2013)
data(NtrianglePrior)
data(NpaidPrior)
data(XtrianglePrior)

## Extract information about zero-claims and severity dev. inflation
my.priors<-extract.prior(XtrianglePrior,NpaidPrior,NtrianglePrior,Plots=FALSE)
my.inflat.j<-my.priors$inflat.j
my.Qi<-my.priors$Qi

## Bootstrap cashflow incorporating prior knowledge about
##      severity inflation and zero claims
# Only variance process
# Below only B=200 simulations for a fast example
dist.priorC.I<-dcl.boot.prior(NtrianglePrior,XtrianglePrior,
  inflat.j=my.inflat.j,Qi=my.Qi,adj=2,Tail=FALSE,boot.type=1,B=200)
Plot.cashflow(dist.priorC.I)

## Try to compare with DCL with no prior knowledge: 
# Only variance process
# dist.dcl.I<-dcl.boot.prior(NtrianglePrior,XtrianglePrior,adj=2,
#    Tail=FALSE,boot.type=1)
# Plot.cashflow(dist.dcl.I)

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/dcl.boot.prior.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dcl.boot.prior
> ### Title: Bootstrap distribution (the full cashflow) adding prior
> ###   knowledge
> ### Aliases: dcl.boot.prior
> ### Keywords: htest
> 
> ### ** Examples
> 
> ## Data application by in Martinez-Miranda, Nielsen, Verrall and Wuthrich (2013)
> data(NtrianglePrior)
> data(NpaidPrior)
> data(XtrianglePrior)
> 
> ## Extract information about zero-claims and severity dev. inflation
> my.priors<-extract.prior(XtrianglePrior,NpaidPrior,NtrianglePrior,Plots=FALSE)
> my.inflat.j<-my.priors$inflat.j
> my.Qi<-my.priors$Qi
> 
> ## Bootstrap cashflow incorporating prior knowledge about
> ##      severity inflation and zero claims
> # Only variance process
> # Below only B=200 simulations for a fast example
> dist.priorC.I<-dcl.boot.prior(NtrianglePrior,XtrianglePrior,
+   inflat.j=my.inflat.j,Qi=my.Qi,adj=2,Tail=FALSE,boot.type=1,B=200)
Warning: It is not possible to extract a suitable delay function. Check if the data follow the DCL model
[1] "Please wait, simulating the distribution..."
[1] "Done!"
   period mean.rbns  sd.rbns Q1.rbns  Q5.rbns Q50.rbns  Q95.rbns  Q99.rbns
1       1  19889.94 25758.86  358.26  1017.54 11743.52  66221.75  90698.97
2       2  20136.29 34615.22  121.47   868.29  9704.90  71810.22 191875.58
3       3   6705.61 22431.41    0.00     0.01   263.10  24340.10  97741.65
4       4   4590.64  9968.28    0.00     0.03   577.49  18902.09  53828.62
5       5    835.52  3250.38    0.00     0.00     0.33   4045.24  19646.57
6       6    800.58  3808.51    0.00     0.00     0.19   2405.68  16427.46
7       7    147.67   731.28    0.00     0.00     0.00    704.24   2796.96
8       8     89.92   393.45    0.00     0.00     0.00    590.87   2405.62
9       9    189.77  1027.34    0.00     0.00     0.00    407.45   6151.37
10     10    244.02  1192.62    0.00     0.00     0.00    996.87   4515.46
11     11    129.73  1157.73    0.00     0.00     0.00    259.91   1378.47
12     12     80.09   485.34    0.00     0.00     0.00    202.28   2346.93
13     13      0.00     0.00    0.00     0.00     0.00      0.00      0.00
14     14      0.00     0.00    0.00     0.00     0.00      0.00      0.00
15     15      0.00     0.00    0.00     0.00     0.00      0.00      0.00
16     16      0.00     0.00    0.00     0.00     0.00      0.00      0.00
17     17      0.00     0.00    0.00     0.00     0.00      0.00      0.00
18     18      0.00     0.00    0.00     0.00     0.00      0.00      0.00
19     19      0.00     0.00    0.00     0.00     0.00      0.00      0.00
20     20      0.00     0.00    0.00     0.00     0.00      0.00      0.00
21     21      0.00     0.00    0.00     0.00     0.00      0.00      0.00
22     22      0.00     0.00    0.00     0.00     0.00      0.00      0.00
23     23      0.00     0.00    0.00     0.00     0.00      0.00      0.00
24     24      0.00     0.00    0.00     0.00     0.00      0.00      0.00
25     25      0.00     0.00    0.00     0.00     0.00      0.00      0.00
26     26      0.00     0.00    0.00     0.00     0.00      0.00      0.00
27   Tot.  53839.79 48882.70 5736.20 12067.76 38812.58 169665.28 246661.54
   period mean.ibnr   sd.ibnr  Q1.ibnr   Q5.ibnr  Q50.ibnr  Q95.ibnr Q99.ibnr
1       1  38216.84  38286.94  2488.14   4672.47  24249.79 118943.11 179966.9
2       2  31048.12  36959.59   215.45    922.50  15401.37 109954.45 159313.3
3       3  37520.26  38304.65  1149.39   2090.71  26246.91 122167.88 173747.5
4       4  30634.77  47055.89     9.99    421.38  13833.07 114753.06 254217.9
5       5  29253.78  41275.00     2.29     48.14  14298.33  99651.79 182941.6
6       6  18513.34  33663.75     0.31      7.88   4665.14  87412.18 170364.3
7       7  17417.98  51705.24     0.01      0.80   2496.31  72097.82 115682.3
8       8  16368.17  35614.34     0.00      0.02   1584.95  97159.18 187432.4
9       9  12524.40  28823.15     0.00      0.00    666.03  74338.48 129377.5
10     10   9603.02  24870.45     0.00      0.00     31.07  54162.62 122733.4
11     11   7542.54  25715.27     0.00      0.00      0.31  48740.21 137616.3
12     12     86.67    678.84     0.00      0.00      0.00      7.82   1934.4
13     13      0.00      0.00     0.00      0.00      0.00      0.00      0.0
14     14      0.00      0.00     0.00      0.00      0.00      0.00      0.0
15     15      0.00      0.00     0.00      0.00      0.00      0.00      0.0
16     16      0.00      0.00     0.00      0.00      0.00      0.00      0.0
17     17      0.00      0.00     0.00      0.00      0.00      0.00      0.0
18     18      0.00      0.00     0.00      0.00      0.00      0.00      0.0
19     19      0.00      0.00     0.00      0.00      0.00      0.00      0.0
20     20      0.00      0.00     0.00      0.00      0.00      0.00      0.0
21     21      0.00      0.00     0.00      0.00      0.00      0.00      0.0
22     22      0.00      0.00     0.00      0.00      0.00      0.00      0.0
23     23      0.00      0.00     0.00      0.00      0.00      0.00      0.0
24     24      0.00      0.00     0.00      0.00      0.00      0.00      0.0
25     25      0.00      0.00     0.00      0.00      0.00      0.00      0.0
26     26      0.00      0.00     0.00      0.00      0.00      0.00      0.0
27   Tot. 248729.88 110730.54 63725.91 106643.03 237811.34 440753.96 520541.9
   period mean.total  sd.total  Q1.total  Q5.total Q50.total Q95.total
1       1   58106.78  45556.86   6918.98  10983.64  45146.35 139123.31
2       2   51184.41  52255.75   1765.81   5862.25  32282.52 146965.38
3       3   44225.87  43208.39   1187.87   5495.10  30509.19 129347.39
4       4   35225.41  47184.13    118.53   1056.77  19422.32 116134.36
5       5   30089.31  41393.56      4.09     69.93  15167.82 100345.55
6       6   19313.92  33827.71      0.89     19.56   5609.28  89061.24
7       7   17565.65  51689.32      0.08      1.31   2643.99  72197.88
8       8   16458.10  35605.75      0.00      0.04   1904.33  97159.18
9       9   12714.17  28806.46      0.00      0.01    952.41  74338.50
10     10    9847.03  24835.22      0.00      0.00    164.49  54162.62
11     11    7672.26  25709.13      0.00      0.00     12.02  48802.68
12     12     166.76    827.53      0.00      0.00      0.00    535.17
13     13       0.00      0.00      0.00      0.00      0.00      0.00
14     14       0.00      0.00      0.00      0.00      0.00      0.00
15     15       0.00      0.00      0.00      0.00      0.00      0.00
16     16       0.00      0.00      0.00      0.00      0.00      0.00
17     17       0.00      0.00      0.00      0.00      0.00      0.00
18     18       0.00      0.00      0.00      0.00      0.00      0.00
19     19       0.00      0.00      0.00      0.00      0.00      0.00
20     20       0.00      0.00      0.00      0.00      0.00      0.00
21     21       0.00      0.00      0.00      0.00      0.00      0.00
22     22       0.00      0.00      0.00      0.00      0.00      0.00
23     23       0.00      0.00      0.00      0.00      0.00      0.00
24     24       0.00      0.00      0.00      0.00      0.00      0.00
25     25       0.00      0.00      0.00      0.00      0.00      0.00
26     26       0.00      0.00      0.00      0.00      0.00      0.00
27   Tot.  302569.66 121564.53 107288.65 135357.69 285563.46 522066.02
   Q99.total
1  225538.43
2  245756.59
3  193243.68
4  254847.80
5  183022.09
6  170364.28
7  116066.66
8  187432.43
9  129646.72
10 122743.46
11 137616.35
12   4215.12
13      0.00
14      0.00
15      0.00
16      0.00
17      0.00
18      0.00
19      0.00
20      0.00
21      0.00
22      0.00
23      0.00
24      0.00
25      0.00
26      0.00
27 628660.71
> Plot.cashflow(dist.priorC.I)
> 
> ## Try to compare with DCL with no prior knowledge: 
> # Only variance process
> # dist.dcl.I<-dcl.boot.prior(NtrianglePrior,XtrianglePrior,adj=2,
> #    Tail=FALSE,boot.type=1)
> # Plot.cashflow(dist.dcl.I)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>