R 在精算中的应用

上传人:d****y 文档编号:98002155 上传时间:2019-09-07 格式:PPTX 页数:27 大小:272.49KB
返回 下载 相关 举报
R 在精算中的应用_第1页
第1页 / 共27页
R 在精算中的应用_第2页
第2页 / 共27页
R 在精算中的应用_第3页
第3页 / 共27页
R 在精算中的应用_第4页
第4页 / 共27页
R 在精算中的应用_第5页
第5页 / 共27页
点击查看更多>>
资源描述

《R 在精算中的应用》由会员分享,可在线阅读,更多相关《R 在精算中的应用(27页珍藏版)》请在金锄头文库上搜索。

1、R 在精算中的应用,第5届中国R会议,1,概述,统计 精算 寿险:定价、准备金、分类 非寿险:定价、准备金、分类 统计软件:R,SAS, 精算软件 Prophet,MoSes,VIP, IGLOO, EMBlem,2,统计软件在非寿险精算中的应用,Source Palisade 2006 ( Risk ): http:/ SAS:大型数据,强大的统计分析功能。 R:灵活性,扩展性,强大的统计计算和绘图功能 ,4,精算应用中的R包,利息理论和寿险精算:lifecontigencies 损失模型:actuar 非寿险准备金评估:ChainLadder 非寿险定价:glm,glm.nb (在MASS

2、包中), cplm,gamlss 数据处理和绘图:plyr,reshape,ggplot2,5,利息理论与寿险精算:lifecontigencies,功能: 人口统计、利息理论和精算数学的计算 寿险保单的定价、准备金评估 不足: 目前只能处理单减因表 不能处理连续时间。 Bug?,6,Lifecontigencies示例, library(lifecontingencies) nominal2Real(i=0.12, k = 12, type=“interest“) #现值计算 cf=c(10,20,30) #现金流 t=1:3 #付款时间 p=c(0.5,0.6,0.8) #付款概率 i=0

3、.03 #年实际利率 presentValue(cashFlows=cf, timeIds=t, interestRates=i, probabilities=p) 1 38.12892 #30岁,10年定期寿险,年利率4% Axn(soa08Act, 30, 10, i=0.04) 1 0.01577283,7,A bug?, library(lifecontingencies) cf=c(10,10,10,10,10,110) t=1:6 duration(cf, t, i=0.03,macaulay=F) #得到macaulay久期? 1 4.984214 sum(t*cf*1.03(-

4、t)/sum(cf*1.03(-t) #直接计算macaulay久期 1 4.984214 convexity(cf, t, i=0.03) #计算凸度 1 30.69613 sum(t*(t+1)*cf*(1+0.03)(-t-2)/sum(cf*1.03(-t) 直接计算凸度 1 30.69613,8,损失模型:actuar,分布计算和参数估计:d, p, q, r, m, lev 信度模型 累积损失的计算 破产概率的计算 分层损失模型的随机模拟 注:CAS的LSM可以模拟保险公司的损失发生过程及其进展:http:/www.casact.org/research/lsmwp/index.c

5、fm?fa=software,9,Actuar:BS信度模型示例, library(actuar) mydata policy loss1 loss2 loss3 w1 w2 w3 1 1 1738 1642 1794 7861 9251 8706 2 2 1364 1408 1597 1622 1742 1523 3 3 1759 1685 1479 1147 1357 1329 4 NA NA 1010 NA NA 348 myfit=cm(policy,mydata,ratios=loss1:loss3, weights=w1:w3),10, summary(myfit) Call: c

6、m(formula = policy, data = mydata, ratios = loss1:loss3, weights = w1:w3) Structure Parameters Estimators Collective premium: 1566.874 Between policy variance: 24189.8 Within policy variance: 34611317 Detailed premiums Level: policy policy Indiv. mean Weight Cred. factor Cred. premium 1 1722.485 258

7、18 0.9474905 1714.314 2 1452.297 4887 0.7735260 1478.246 3 1635.718 3833 0.7281780 1617.005 4 1010.000 348 0.1956350 1457.930,11,#分层信度模型 mydata1 type policy loss1 loss2 loss3 w1 w2 w3 1 A 1 1738 1642 1794 7861 9251 8706 2 B 2 1364 1408 1597 1622 1742 1523 3 A 3 1759 1685 1479 1147 1357 1329 4 B 4 NA

8、 NA 1010 NA NA 348 myfit1=cm(type+type:policy, mydata1, ratios=loss1:loss3, weights=w1:w3, method=iterative),12, summary(myfit1) Call: cm(formula = type + type:policy, data = mydata1, ratios = loss1:loss3, weights = w1:w3, method = “iterative“) Structure Parameters Estimators Collective premium: 156

9、0.691 Between type variance: 33970.18 Within type/Between policy variance: 5775.545 Within policy variance: 34611317 Detailed premiums Level: type type Indiv. mean Weight Cred. factor Cred. premium A 1694.319 1.2017108 0.8760556 1677.757 B 1404.139 0.5040669 0.7477794 1443.625 Level: policy type pol

10、icy Indiv. mean Weight Cred. factor Cred. premium A 1 1722.485 25818 0.81161277 1714.059 B 2 1452.297 4887 0.44918368 1447.520 A 3 1635.718 3833 0.39009799 1661.358 B 4 1010.000 348 0.05488322 1419.826,13,Actuar:累积损失计算示例,S = X1 + X2 + + XN library(actuar) fx=discretize(pgamma(x, 2, 1), from = 0, to

11、= 22, step = 0.5, method = “unbiased“, lev = levgamma(x, 2, 1) #单次损失分布的离散化 Fs=aggregateDist(“recursive“, model.freq = “poisson“, model.sev = fx, lambda = 10, x.scale = 0.5) #累积损失的计算 VaR(Fs,seq(0.9,1,0.02) 90% 92% 94% 96% 98% 100% 30.5 31.5 33.0 35.0 38.0 71.0 CTE(Fs,seq(0.9,1,0.02) 90% 92% 94% 96% 9

12、8% 100% 35.41874 36.30422 37.64626 39.45808 42.21550 NaN,14,par(mfrow=c(1,2) plot(Fs,verticals=T,do.points=F,col=2,main=分布函数) #分布函数 plot(diff(Fs),type=l,col=2,main=密度函数) #密度函数,15,非寿险准备金评估:ChainLadder,基于流量三角形 适用于常见的准备金评估方法: 确定性模型 随机模型:bootstrap,GLM,16,Chainladder:基于GLM的准备金评估示例, dat dev origin 1 2 3 4

13、 5 6 7 8 9 10 1981 501 827 1091 1181 1354 1618 1801 1861 1866 1883 1982 11 429 540 1067 1379 1561 1563 1630 1684 NA 1983 341 899 1387 1614 1873 2221 2286 2346 NA NA 1984 566 1156 1577 2127 2343 2609 2707 NA NA NA 1985 109 956 1583 2216 2595 2617 NA NA NA NA 1986 151 644 1170 1293 1585 NA NA NA NA NA

14、 1987 56 402 1095 1232 NA NA NA NA NA NA 1988 135 695 1311 NA NA NA NA NA NA NA 1989 313 539 NA NA NA NA NA NA NA NA 1990 206 NA NA NA NA NA NA NA NA NA fit=glmReserve(dat,var.power=2,mse.method=bootstrap),17,18,Coefficients: Estimate Std. Error t value Pr(|t|) (Intercept) 5.4363557 0.3204344 16.966

15、 2e-16 * factor(origin)1982 -0.1897676 0.3127652 -0.607 0.54783 factor(origin)1983 0.0916830 0.3270977 0.280 0.78086 factor(origin)1984 0.3190545 0.3427445 0.931 0.35812 factor(origin)1985 0.1560711 0.3613516 0.432 0.66838 factor(origin)1986 -0.1696000 0.3849454 -0.441 0.66215 factor(origin)1987 -0.3552483 0.4169667 -0.852 0.39986 factor(origin)1988 -0.0007145 0.4645266 -0.002 0.99878 factor(origin)1989 -0.0900973 0.5461889 -0.165 0.86990 fact

展开阅读全文
相关资源
相关搜索

当前位置:首页 > IT计算机/网络 > 数据库

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号