Skip to content

Instantly share code, notes, and snippets.

View AbstractsInsuranceDataScience2018.md

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)

View StanWorkshop2018.md

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
View InsuranceDataScience2018.md
View plotBananas.R
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
View snip.R
snip <- function(input) {
pb <- pipe("pbcopy", "w")
write.table(input, sep="\t", file=pb, row.names = FALSE)
close(pb)
}
View RinInsurance2017.md

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

View NormalDistribution.stan
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];
View NormalDistribution.R
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
View R_in_Insurance_2016_Agenda.md
View WorldBankMotionChart.R
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