Introduction to R
Mortality Overview
- Mortality Models
- Classical
- Stochastic
- Workshop: Stochastic Mortality Models in R
- Models Fitting
- Mortality Projection - Forecasting
- Portfolio Analysis of BEL and SCR
Case Studies
16 October 2015
Introduction to R
Mortality Overview
Case Studies
“Everything that exists [in R] is an object. Everything that happens [in R] is a function call.” - John Chambers
Most popular Environment to run R
http://www.rstudio.com/products/rstudio/
Free & Open-Source Integrated Development Environment (IDE) for R
Features:
Note: R must be installed first!
Type in the interactive console:
3 + 3
## [1] 6
getwd()
## [1] "C:/Users/omierzwa/Documents/GitHub/Insurance"
1:10
## [1] 1 2 3 4 5 6 7 8 9 10
Type in the interactive console:
x <- 1:10 # "name <- value returns the value invisibly"
x
## [1] 1 2 3 4 5 6 7 8 9 10
(x <- 1:10) # creates x and prints it
## [1] 1 2 3 4 5 6 7 8 9 10
x + y addition
x - y substraction
x * y multiplication
x / y division
x ^ y exponention
x %% y devision remainder
x %/% y integer division
numeric vector operator numeric vector –> numeric vector
(x <- 11:20) # exemplary vector
## [1] 11 12 13 14 15 16 17 18 19 20
x[1] # first
## [1] 11
x[length(x)] # last element using length function
## [1] 20
x[c(1, length(x), 1)] # first, last and first again
## [1] 11 20 11
x[1000] # no such element
## [1] NA
x * 3 # multiplication
## [1] 33 36 39 42 45 48 51 54 57 60
y <- 1:10 x * y
## [1] 11 24 39 56 75 96 119 144 171 200
Basic quantities in the analysis of mortality
\(s_{x} = Pr (X > x)\)
\(p_{xt} = s_{x+t}/s_{x}\)
\(q_{xt} = [s_{x} - s_{x+t}]/s_{x}\)
\(\mu_{x} = lim_{h \to 0} 1/h * q_{xh}\)
Probability that (x) will die within h
Some special parametric laws of mortality
\(\mu_{x} = 1/ (ω – x)\) subject to \(0 \leq x < ω\)
\(\mu_{x} = Bc^{x}\) subject to \(x \geq 0, B>0, c>1\)
\(\mu_{x} = A + Bc^{x}\) subject to \(x \geq 0, B>0, c>1, A>=-B\)
\(\mu_{x} = B_{1}C_{1}^{-x}+B_{2}C_{2}^{[-1/2(x-k)^2]}+B_{3}C_{3}^{x}\) subject to \(x\geq 0, B_{1}, B_{2}, B_{3}>0, C_{1}, C_{2}, C_{3}>1\)
Advantages:
Disadvantages:
\(\hat{\mu}_{x}(t)\)
\(\hat{\mu}_{x}(t) = \alpha_{x}\)
\(\hat{\mu}_{x}(t) = \alpha_{x} + \kappa_{t}\)
\(\hat{\mu}_{x}(t) = \alpha_{x} + \beta_{x} \kappa_{t}\)
\(\hat{\mu}_{x}(t) = \alpha_{x} + \sum^{N}_{i=1} \beta^{i}_{x} \kappa^{i}_{t}\) \(N\) - number of age-period terms
\(\hat{\mu}_{x}(t) = \alpha_{x} + \sum^{N}_{i=1} \beta^{i}_{x} \kappa^{i}_{t} + \gamma_{t-x}\) \(N\) - number of age-period terms
\(\hat{\mu}_{x}(t) = \alpha_{x} + \sum^{N}_{i=1} \beta^{i}_{x} \kappa^{i}_{t} + \beta^{0}_{x} \gamma_{t-x}\) \(N\) - number of age-period terms
You must enable Javascript to view this page properly.
Generalised Age-Period-Cohort Stochastic Mortality Models
Generalised Age-Period-Cohort Stochastic Mortality Models
The numbers of deaths \(D_{xt}\) are independent
\(D_{xt}\) follows a Poisson or a Binomial distribution
Most stochastic mortality models not identifiable up to a transformation
Therefore parameter constraints required to ensure unique parameter estimates
Parameter constraints applied through constraint function
Models sensitive to:
Historical data
Assumptions made
Good practice
Understand and validate data
Understand models and their assumptions
Test several methods
Compare and validate results
Dutch mortality data from Human Mortality Database
Benchmark against AG table
BEL and SCR Projection for a portfolio
Writting own packages in R
setwd('<directory name>') # wrapped in ''
## for Windows the path uses / instead \
"StMoMO: An R Package for Stochastic Mortality Modelling" A.M. Villegas et al.
"Stochastic Modelling of Mortality Risks" Frankie Gregorkiewicz
"Solvency II Glossary" CEA and the Groupe Consultatif
"R: The most powerful and most widely used statistical software" Revolution Analytics