Skip to content

Instantly share code, notes, and snippets.

Insurance Data Science Conference 2018

Abstracts

Modelling longevity risk for retirement and pension planning

Gareth Peters, Heriot-Watt University, Edinburgh

In this talk we build on a sequence of papers recently developed to enhance the modelling of life expectancy based on mortality data. Forecasting life expectancy and mortality are two important aspects for the study of demography that influence pension planning, retirement decisions and government policy.

We demonstrate how to develop regression models incorporating stochastic factors such as graduation temporal effects, period effects, cohort effects, stochastic volatility and long memory to enhance the forecasting and estimation of life tables. In addition, we show the mispricing that occurs in standard annuities, pure endowments and Gauranteed Annuity Oprtions (GAOs)

Stan in Insurance Workshop 17 July 2018

[8:30-9:00] Registration

[9:00 - 10:30] Eric Novik

  • Intro to Stan, including:
    • Coding linear regression to assess wine quality
    • Demonstrating important parts of the Stan program
  • Doing some basic posterior predicting checking
checkModelPlot <- function(x, data, delta, company_code, col=c(1,2),
main="Reported incurred loss development by accident year",
ylab="Loss ratio (%)", xlab="Development year",...){
library(latticeExtra)
my.settings <- list(
strip.background=list(col="#CBDDE6"),
par.main.text = list(font = 2, # make it bold
just = "left",
x = grid::unit(5, "mm")),
par.sub.text = list(font = 1,
@mages
mages / snip.R
Created January 11, 2018 21:41
Mac: Copy R data frame to clipboard
snip <- function(input) {
pb <- pipe("pbcopy", "w")
write.table(input, sep="\t", file=pb, row.names = FALSE)
close(pb)
}

R in Insurance, Paris, 8 June 2017

Porgramme

  • 9:00 am - 9:10 am Welcome - Julien Pouget (Directeur de l'ENSAE)

9:10 am - 10:00 am Opening Keynote Session

  • Textual analysis of expert reports to increase knowledge of technological risks - Julie SEGUELA, Covea

10:00 am - 11:00 am Session 1 - big data

functions {
// Define log probability density function
real myNormal_lpdf(real y, real mu, real sigma) {
return -log(2 * pi()) / 2 - log(sigma)
- square(mu - y) / (2 * sigma^2);
}
}
data {
int N;
real y[N];
library(rstan)
library(MASS)
set.seed(1)
y <- rnorm(100, 4, 2)
truehist(y, col="#B2001D")
lines(density(y), col="skyblue", lwd=2)
summary(y)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -0.4294 3.0120 4.2280 4.2180 5.3830 8.8030
library(wbstats)
library(data.table)
library(googleVis)
# Download World Bank data and turn into data.table
myDT <- data.table(
wb(indicator = c("SP.POP.TOTL",
"SP.DYN.LE00.IN",
"SP.DYN.TFRT.IN"), mrv = 60)
)
# Download country mappings