我们通过对增量进行泊松回归,我们获得了与链梯法Chain Ladder方法完全相同的结果
> Y
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 3209 1163 39 17 7 21
[2,] 3367 1292 37 24 10 NA
[3,] 3871 1474 53 22 NA NA
[4,] 4239 1678 103 NA NA NA
[5,] 4929 1865 NA NA NA NA
[6,] 5217 NA NA NA NA NA
> summary(reg2)
Call:
glm(formula = y ~ as.factor(ai) + as.factor(bj), family = poisson,
data = base)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 8.05697 0.01551 519.426 < 2e-16 ***
as.factor(ai)2001 0.06440 0.02090 3.081 0.00206 **
as.factor(ai)2002 0.20242 0.02025 9.995 < 2e-16 ***
as.factor(ai)2003 0.31175 0.01980 15.744 < 2e-16 ***
as.factor(ai)2004 0.44407 0.01933 22.971 < 2e-16 ***
as.factor(ai)2005 0.50271 0.02079 24.179 < 2e-16 ***
as.factor(bj)1 -0.96513 0.01359 -70.994 < 2e-16 ***
as.factor(bj)2 -4.14853 0.06613 -62.729 < 2e-16 ***
as.factor(bj)3 -5.10499 0.12632 -40.413 < 2e-16 ***
as.factor(bj)4 -5.94962 0.24279 -24.505 < 2e-16 ***
as.factor(bj)5 -5.01244 0.21877 -22.912 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 46695.269 on 20 degrees of freedom
Residual deviance: 30.214 on 10 degrees of freedom
(15 observations deleted due to missingness)
AIC: 209.52
Number of Fisher Scoring iterations: 4
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 3155.7 1202.1 49.8 19.1 8.2 21.0
[2,] 3365.6 1282.1 53.1 20.4 8.8 22.4
[3,] 3863.7 1471.8 61.0 23.4 10.1 25.7
[4,] 4310.1 1641.9 68.0 26.1 11.2 28.7
[5,] 4919.9 1874.1 77.7 29.8 12.8 32.7
[6,] 5217.0 1987.3 82.4 31.6 13.6 34.7
[1] 2426.985
注意到泊松定律的变化太小
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.05697 0.02769 290.995 < 2e-16 ***
as.factor(ai)2001 0.06440 0.03731 1.726 0.115054
as.factor(ai)2002 0.20242 0.03615 5.599 0.000228 ***
as.factor(ai)2003 0.31175 0.03535 8.820 4.96e-06 ***
as.factor(ai)2004 0.44407 0.03451 12.869 1.51e-07 ***
as.factor(ai)2005 0.50271 0.03711 13.546 9.28e-08 ***
as.factor(bj)1 -0.96513 0.02427 -39.772 2.41e-12 ***
as.factor(bj)2 -4.14853 0.11805 -35.142 8.26e-12 ***
as.factor(bj)3 -5.10499 0.22548 -22.641 6.36e-10 ***
as.factor(bj)4 -5.94962 0.43338 -13.728 8.17e-08 ***
as.factor(bj)5 -5.01244 0.39050 -12.836 1.55e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for quasipoisson family taken to be 3.18623)
Null deviance: 46695.269 on 20 degrees of freedom
Residual deviance: 30.214 on 10 degrees of freedom
(15 observations deleted due to missingness)
AIC: NA
Number of Fisher Scoring iterations: 4
通常,通过构造皮尔逊残基的形式为
我们已经在定价过程中看到,分母的方差可以被预测代替,因为在泊松模型中,期望和方差是相同的。所以我们考虑
> round(matrix(base$erreur,n,n),1)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.9 -1.1 -1.5 -0.5 -0.4 0
[2,] 0.0 0.3 -2.2 0.8 0.4 NA
[3,] 0.1 0.1 -1.0 -0.3 NA NA
[4,] -1.1 0.9 4.2 NA NA NA
[5,] 0.1 -0.2 NA NA NA NA
[6,] 0.0 NA NA NA NA NA
值得关注的是,如果是渐近的良好估计,则在有限距离处不是这种情况,因为我们对方差有一个偏估计。另外,应该校正方差估计量
然后是应使用的皮尔逊残基。
> E
[1] 1.374976e+00 3.485024e-02 1.693203e-01 -1.569329e+00 1.887862e-01
[6] -1.459787e-13 -1.634646e+00 4.018940e-01 8.216186e-02 1.292578e+00
[11] -3.058764e-01 -2.221573e+00 -3.207593e+00 -1.484151e+00 6.140566e+00
[16] -7.100321e-01 1.149049e+00 -4.307387e-01 -6.196386e-01 6.000048e-01
[21] -8.987734e-15
通过对这些残基进行重采样。为简单起见,我们将生成一个小矩形
> round(matrix(Tb,n,n),1)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 3115.8 1145.4 58.9 46.0 6.4 26.9
[2,] 3179.5 1323.2 54.5 21.3 12.2 NA
[3,] 4245.4 1448.1 61.0 7.9 NA NA
[4,] 4312.4 1581.7 68.7 NA NA NA
[5,] 4948.1 1923.9 NA NA NA NA
[6,] 4985.3 NA NA NA NA NA
这样我们就可以做几件事
最后一点,我们将使用以下代码生成准定律,
> rqpois = function(n, lambda, phi, roundvalue = TRUE) {
+ b = phi
+ a = lambda/phi
+ r = rgamma(n, shape = a, scale = b)
+ if(roundvalue){r=round(r)}
+ return(r)
+ }
然后,我们将执行一个小函数,该函数将从三角形计算出未来的平均付款额或各付款场景的总和数,
它仍然会生成三角形的数据包。但是,可以生成负增量的三角形。简而言之,当我们支付负数时,将为空值。这样,对分位数的影响(先验)将可以忽略不计。
如果我们查看最佳估计的分布,我们得到
polygon(c(D$x[I],rev(D$x[I])),c(D$y[I],rep(0,length(I))),col="blue",border=NA)
但是,我们还可以在下面将基于泊松定律(等散)的情景可视化
在后一种情况下,我们可以扣除99%的未来付款额。
> quantile(VRq,.99)
99%
2855.01
因此,有必要将拨备金额增加约15%,以确保公司能够在99%的情况下履行承诺,
> quantile(VRq,.99)-2426.985
99%
428.025