0% found this document useful (0 votes)
10 views9 pages

Actuarial Internship: Gross Premium Models

Uploaded by

Malay H Kenia
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

Actuarial Internship: Gross Premium Models

Uploaded by

Malay H Kenia
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Actuarial Internship Test (Modelling)

Models for deciding Gross Premiums: (Using R)


> z1 <- Intern1$`Dummy variable Z1= 1 for Delhi, 0 otherwise`
> z2 <- Intern1$`Dummy variable Z2= 1 for Kolkata, 0 otherwise`
> z3 <- Intern1$`Dummy variable Z3= 1 for Chennai, 0 otherwise`
> z4 <- Intern1$`Dummy variable Z4= 1 for Male, 0 otherwise`
> z5 <- Intern1$`Age (nearest Birthday)`
> y <- Intern1$`Gross Premium`
>
> #Alternative 1 Generalised linear model (Gaussian Family)
> model1 <- glm(y ~ z1 + z2 +z3+z4+z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model1)
Call:
glm(formula = y ~ z1 + z2 + z3 + z4 + z5, family = gaussian(link = "identi
ty"),
data = Intern1)

Deviance Residuals:
Min 1Q Median 3Q Max
-1259.9 -97.1 7.5 89.0 4312.2
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 603.7584 9.1527 65.965 <2e-16 ***
z1 3.6766 4.1400 0.888 0.375
z2 -4.3243 4.1571 -1.040 0.298
z3 -1.8448 4.1599 -0.443 0.657
z4 -214.7496 5.8875 -36.475 <2e-16 ***
z5 18.3598 0.2048 89.627 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 59547.17)


Null deviance: 2197909467 on 27598 degrees of freedom
Residual deviance: 1643085103 on 27593 degrees of freedom
AIC: 381768
Number of Fisher Scoring iterations: 2
>
> #All location parameters do not impact the amount of gross premium signi
ficantly.
> #Age and gender are significant parameters with a very low p-value.
> #Hence the appropriate model can be of the form 603.7584-214.7496*z4*18.
3598*z5
>
> model1$aic
[1] 381768.4
>
> #Alternative 2 GLM (Gamma family)
> model2 <- glm(y ~ z1 + z2 +z3+z4+z5,
+ family = Gamma(link = "inverse"), data = Intern1)
> summary(model2)
Call:
glm(formula = y ~ z1 + z2 + z3 + z4 + z5, family = Gamma(link = "inverse")
,
data = Intern1)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.41667 -0.07894 0.00686 0.08228 1.80506
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.409e-03 7.999e-06 176.090 <2e-16 ***
z1 -3.014e-06 3.801e-06 -0.793 0.428
z2 4.267e-06 3.826e-06 1.115 0.265
z3 1.070e-06 3.822e-06 0.280 0.780
z4 1.722e-04 4.588e-06 37.530 <2e-16 ***
z5 -1.697e-05 1.775e-07 -95.621 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for Gamma family taken to be 0.05219946)
Null deviance: 2552.5 on 27598 degrees of freedom
Residual deviance: 2033.6 on 27593 degrees of freedom
AIC: 385865
Number of Fisher Scoring iterations: 5
> model2$aic
[1] 385865.1
> #As AIC of first model is lower so first model is better than the second
model.
>
> #Alternative 3
> model4 <- glm(y ~ z4+z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model4)
Call:
glm(formula = y ~ z4 + z5, family = gaussian(link = "identity"),
data = Intern1)

Deviance Residuals:
Min 1Q Median 3Q Max
-1259.1 -98.4 11.8 85.2 4311.1
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 603.1312 8.7957 68.57 <2e-16 ***
z4 -214.6404 5.8873 -36.46 <2e-16 ***
z5 18.3574 0.2048 89.62 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 59549.24)
Null deviance: 2197909467 on 27598 degrees of freedom
Residual deviance: 1643320876 on 27596 degrees of freedom
AIC: 381766
Number of Fisher Scoring iterations: 2
> model4$aic
[1] 381766.4

> #Alternative 4 GLM with interaction term


> model3 <- glm(y ~ z4+z5+z4*z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model3)
Call:
glm(formula = y ~ z4 + z5 + z4 * z5, family = gaussian(link = "identity"),
data = Intern1)
Deviance Residuals:
Min 1Q Median 3Q Max
-1245.3 -99.2 12.6 87.1 4303.8
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 689.3095 22.7286 30.328 < 2e-16 ***
z4 -309.7025 23.8567 -12.982 < 2e-16 ***
z5 15.7264 0.6718 23.408 < 2e-16 ***
z4:z5 2.9005 0.7054 4.112 3.94e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 59514.94)
Null deviance: 2197909467 on 27598 degrees of freedom
Residual deviance: 1642314661 on 27595 degrees of freedom
AIC: 381751
Number of Fisher Scoring iterations: 2
> model3$aic
[1] 381751.5
> # as aic of third model is lowest so model 1 is the best model out of 4.
> #However the AIC reduced only marginally as compared to model 3
>
> #The best model of gross premium will be of the form:
> #y= 689.3095- 309.7025*z4 + 15.7264*z5 + 2.9005*z4*z5
>
> plot(model3)
Hit <Return> to see next plot: plot(model3)
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
#We can see that the sample quartiles match the theoretical quartiles to a certain degree. The fit is
very good in the middle ranges. However, we can see that the model doesn’t produce satisfactory
results on the tails. It is clear from the fact that there are many outliers in the upper tails and
significant distance between sample quartiles and theoretical quartiles in the lower tails.

Models for deciding number of claims


> x <- Intern1$`No of claims`
>
> #Alternative 1 Generalised linear model (Gaussian Family)
> model1 <- glm(x ~ z1 + z2 +z3+z4+z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model1)

Call:
glm(formula = x ~ z1 + z2 + z3 + z4 + z5, family = gaussian(link = "identi
ty"),
data = Intern1)
Deviance Residuals:
Min 1Q Median 3Q Max
-17.855 -6.598 -4.466 2.041 185.067

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.85096 0.46038 17.053 <2e-16 ***
z1 0.02172 0.20824 0.104 0.9169
z2 -0.09547 0.20910 -0.457 0.6480
z3 0.40853 0.20924 1.952 0.0509 .
z4 -7.19731 0.29614 -24.303 <2e-16 ***
z5 0.18876 0.01030 18.319 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 150.6598)
Null deviance: 4296824 on 27598 degrees of freedom
Residual deviance: 4157155 on 27593 degrees of freedom
AIC: 216740
Number of Fisher Scoring iterations: 2
> model1$aic
[1] 216740.2
>
> #Alternative 2
> model2 <- glm(x ~ z4+z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model2)
Call:
glm(formula = x ~ z4 + z5, family = gaussian(link = "identity"),
data = Intern1)
Deviance Residuals:
Min 1Q Median 3Q Max
-17.941 -6.588 -4.454 2.034 185.004

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.9272 0.4424 17.92 <2e-16 ***
z4 -7.1962 0.2961 -24.30 <2e-16 ***
z5 0.1889 0.0103 18.34 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 150.6803)
Null deviance: 4296824 on 27598 degrees of freedom
Residual deviance: 4158172 on 27596 degrees of freedom
AIC: 216741
Number of Fisher Scoring iterations: 2
> model2$aic
[1] 216741
>
>
>
> #Alternative 3 GLM with interaction term
> model3 <- glm(x ~ z4+z5+z4*z5,
+ family = gaussian(link = "identity"), data = Intern1)
> summary(model3)
Call:
glm(formula = x ~ z4 + z5 + z4 * z5, family = gaussian(link = "identity"),
data = Intern1)
Deviance Residuals:
Min 1Q Median 3Q Max
-18.687 -6.595 -4.447 2.034 184.442
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.71962 1.14363 5.876 4.26e-09 ***
z4 -5.86414 1.20039 -4.885 1.04e-06 ***
z5 0.22580 0.03380 6.680 2.44e-11 ***
z4:z5 -0.04064 0.03549 -1.145 0.252
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 150.6786)

Null deviance: 4296824 on 27598 degrees of freedom


Residual deviance: 4157975 on 27595 degrees of freedom
AIC: 216742
Number of Fisher Scoring iterations: 2
> model2$aic
[1] 216741
>
> #As AIC of third model increased so we conclude that the second model is
the best
> #model as it contains less parameters even though AIC is more in second
alternative
> #as compared to first.
>
> plot(model3)
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
#We can see that the model works fine in the lower ranges and mid ranges of the data. As the data
approaches to its lower ends the fit becomes more and more inefficient. We can solve the problem
maybe by modelling the extreme events separately.
#Important Note: Location parameters do not matter significantly while modelling for no. of claims
and gross premium.

Model for predicting claim decision.


> #Model for predicting claim
> z1 <- Intern2$`Dummy variable for Provider type, Z1= 1 Hospital,0 otherw
ise`
> z2 <- Intern2$`Dummy Variable for provider type, Z2=1 Pharamacy, 0 other
wise`
> z3 <- Intern2$`Dummy variable Z3= 1 for Clinic, 0 otherwise`
> z4 <- Intern2$`Gross Requested Amount`
> y <- Intern2$`Dummy variable for claim decision,`
>
> #Alternative 1 (Glm - gaussian family)
> model1 <- glm(y~z1+z2+z3+z4,family=gaussian(link="identity"))
> summary(model1)

Call:
glm(formula = y ~ z1 + z2 + z3 + z4, family = gaussian(link = "identity"))
Deviance Residuals:
Min 1Q Median 3Q Max
-2.50811 -0.76542 0.00411 0.23377 1.23533
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.010e+00 3.928e-02 51.176 < 2e-16 ***
z1 -2.456e-01 3.941e-02 -6.233 4.61e-10 ***
z2 -1.465e-02 3.957e-02 -0.370 0.71128
z3 -1.456e-01 3.975e-02 -3.662 0.00025 ***
z4 1.273e-05 1.340e-06 9.496 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 0.4119991)


Null deviance: 30172 on 71527 degrees of freedom
Residual deviance: 29467 on 71523 degrees of freedom
(33418 observations deleted due to missingness)
AIC: 139568
Number of Fisher Scoring iterations: 2

> model1$aic
[1] 139568.4
>
> #Alternative 2 (Glm - gaussian family- removing insignificant variables)
> model2 <- glm(y~z1+z3+z4,family=gaussian(link="identity"))
> summary(model2)
Call:
glm(formula = y ~ z1 + z3 + z4, family = gaussian(link = "identity"))
Deviance Residuals:
Min 1Q Median 3Q Max
-2.5081 -0.7654 0.0039 0.2338 1.2353
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.996e+00 4.744e-03 420.691 <2e-16 ***
z1 -2.312e-01 5.695e-03 -40.593 <2e-16 ***
z3 -1.311e-01 7.720e-03 -16.989 <2e-16 ***
z4 1.273e-05 1.340e-06 9.495 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 0.4119941)
Null deviance: 30172 on 71527 degrees of freedom
Residual deviance: 29467 on 71524 degrees of freedom
(33418 observations deleted due to missingness)
AIC: 139566
Number of Fisher Scoring iterations: 2
> model2$aic
[1] 139566.5
>
> #Alternative 3 (Glm with interaction)
> model3 <- glm(y~z1+z3+z4+z3*z4,family=gaussian(link="identity"))
> summary(model3)
Call:
glm(formula = y ~ z1 + z3 + z4 + z3 * z4, family = gaussian(link = "identi
ty"))
Deviance Residuals:
Min 1Q Median 3Q Max
-3.8078 -0.7656 0.0039 0.2337 1.2352
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.996e+00 4.739e-03 421.167 <2e-16 ***
z1 -2.311e-01 5.689e-03 -40.614 <2e-16 ***
z3 -1.951e-01 9.219e-03 -21.158 <2e-16 ***
z4 1.227e-05 1.339e-06 9.158 <2e-16 ***
z3:z4 6.228e-04 4.924e-05 12.649 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for gaussian family taken to be 0.4110803)


Null deviance: 30172 on 71527 degrees of freedom
Residual deviance: 29402 on 71523 degrees of freedom
(33418 observations deleted due to missingness)
AIC: 139409
Number of Fisher Scoring iterations: 2

> model3$aic
[1] 139408.7
>
> #Alternative 4 (Glm with interaction)
> model4 <- glm(y~z1+z3+z4+z3*z4+z1*z4,family=gaussian(link="identity"))
> summary(model4)
Call:
glm(formula = y ~ z1 + z3 + z4 + z3 * z4 + z1 * z4, family = gaussian(link
= "identity"))
Deviance Residuals:
Min 1Q Median 3Q Max
-3.8078 -0.7656 0.0080 0.2336 1.2351

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.991e+00 6.050e-03 328.989 <2e-16 ***
z1 -2.257e-01 6.829e-03 -33.047 <2e-16 ***
z3 -1.897e-01 9.957e-03 -19.051 <2e-16 ***
z4 7.552e-05 4.434e-05 1.703 0.0886 .
z3:z4 5.595e-04 6.625e-05 8.446 <2e-16 ***
z1:z4 -6.331e-05 4.436e-05 -1.427 0.1536
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 0.4110744)
Null deviance: 30172 on 71527 degrees of freedom
Residual deviance: 29401 on 71522 degrees of freedom
(33418 observations deleted due to missingness)
AIC: 139409
Number of Fisher Scoring iterations: 2
> model4$aic
[1] 139408.6
>
> #The aic is lowest in model 4 but the decrease is only marginal as compa
red to
> #model 3 so we conclude that the model 3 is the best model because of le
ss
> #parameters used.

You might also like