heat wave modeling, lyon 2011freakonometrics.free.fr/rmetrics.pdf · arthur charpentier, actuarial...

119
Arthur CHARPENTIER, Actuarial science with R Actuarial Science with life and nonlife insurance (a quick overview) Arthur Charpentier joint work with Christophe Dutang & Vincent Goulet http ://freakonometrics.blog.free.fr Meielisalp 2012 Conference, June 6th R/Rmetrics Meielisalp Workshop & Summer School on Computational Finance and Financial Engineering 1

Upload: others

Post on 02-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Actuarial Science withlife and nonlife insurance (a quick overview)

Arthur Charpentier

joint work with Christophe Dutang & Vincent Goulet

http ://freakonometrics.blog.free.fr

Meielisalp 2012 Conference, June

6th R/Rmetrics Meielisalp Workshop & Summer Schoolon Computational Finance and Financial Engineering

1

Page 2: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Actuarial models for life insurance ?Let (x) denote a life aged x, with x ≥ 0.at time t.

The future lifetime of (x) is a continuous random variable Tx.

E.g. term insurance, benefit of $1 payable at the end of the year of death, ifdeath occurs within a fixed term n,

Ax:n =n−1∑k=0

νk+1P(bTxc = k) =n−1∑k=0

νk+1 · k|qx

E.g. annuity of $1 per year, payable annually in advance, at timesk = 0, 1, · · · , n− 1 provided that (x) survived to age x+ k,

ax:n =n−1∑k=0

νk+1P(bTxc ≥ k) =n−1∑k=0

νk · kpx

2

Page 3: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Actuarial models for life insurance ?Let (x) denote a life aged x, with x ≥ 0, at time t.

The future lifetime of (x) is a continuous random variable Tx.

E.g. term insurance, benefit of $1 payable at the end of the year of death, ifdeath occurs within a fixed term n,

A(t)x:n =

n−1∑k=0

νk+1Pt(bTxc = k) =n−1∑k=0

νk+1 · k|q(t)x

E.g. annuity of $1 per year, payable annually in advance, at timesk = 0, 1, · · · , n− 1 provided that (x) survived to age x+ k,

a(t)x:n =

n−1∑k=0

νk+1Pt(bTxc ≥ k) =n−1∑k=0

νk · kp(t)x

3

Page 4: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Another possible motivation ?

4

Page 5: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram, age and timeFrom Lexis (1880), idea of visualizing lifetime, age x, time t and year of birth y

5

Page 6: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insuranceLexis diagrams have been designed to visualize dynamics of life among severalindividuals, but can be used also to follow claims’life dynamics, from theoccurrence until closure,

in life insurance in nonlife insurance

6

Page 7: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insurance and databut usually we do not work on continuous time individual observations(individuals or claims) : we summarized information per year occurrence untilclosure,

in life insurance in nonlife insurance

7

Page 8: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insurance and dataindividual lives or claims can also be followed looking at diagonals, occurrenceuntil closure,occurrence until closure,occurrence until closure,occurrence untilclosure,

in life insurance in nonlife insurance

8

Page 9: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insuranceand usually, in nonlife insurance, instead of looking at (calendar) time, we followobservations per year of birth, or year of occurrence occurrence untilclosure,occurrence until closure,occurrence until closure,occurrence until closure,

in life insurance in nonlife insurance

9

Page 10: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insuranceand finally, recall that in standard models in nonlife insurance, we look at thetransposed triangle occurrence until closure,occurrence until closure,occurrenceuntil closure,occurrence until closure,

in life insurance in nonlife insurance

10

Page 11: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insurancenote that whatever the way we look at triangles, there are still three dimensions,year of occurrence or birth, age or development and calendar time,calendar timecalendar time

in life insurance in nonlife insurance

11

Page 12: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram in insuranceand in both cases, we want to answer a prediction question...calendar timecalendar time calendar time calendar time calendar time calendar time calendartime calendar timer time calendar time

in life insurance in nonlife insurance

12

Page 13: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Part I

LIFE INSURANCE

13

Page 14: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram, age and timeIdea : Life tables Lx should depend on time, Lx,t.

Let Dx,t denote the number of deaths of people aged x, during year t, data frameDEATH and let Ex,t denote the exposure, of age x, during year t, data frameEXPOSURE, from http://www.mortality.org/

14

Page 15: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lexis diagram, age and timeRemark : be carefull of age 110+

> DEATH$Age=as.numeric(as.character(DEATH$Age))> DEATH$Age[is.na(DEATH$Age)]=110> EXPOSURE$Age=as.numeric(as.character(EXPOSURE$Age))> EXPOSURE$Age[is.na(EXPOSURE$Age)]=110

Consider force of mortality function

µx,t = Dx,t

Ex,t

> MU=DEATH[,3:5]/EXPOSURE[,3:5]> MUT=matrix(MU[,3],length(AGE),length(ANNEE))> persp(AGE[1:100],ANNEE,log(MUT[1:100,]),+ theta=-30,col="light green",shade=TRUE)

15

Page 16: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

16

Page 17: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Tables, per year t and Survival lifetimesLet us study deaths occurred in year=1900 or 2000, x 7→ logµx,t when t = 1900 or2000.

> D=DEATH[DEATH$Year==year,]; E=EXPOSURE[EXPOSURE$Year==year,]> MU = D[,3:5]/E[,3:5]> plot(0:110,log(MU[,1]),type="l",col="red"); lines(0:110,log(MU[,2]),col="blue")

Evolution of x 7→ Lx,t = exp(−∫ x

0µh,tdh

)when t = 1900 or 2000,

> PH=PF=matrix(NA,111,111)> for(x in 0:110){+ PH[x+1,1:(111-x)]=exp(-cumsum(MU[(x+1):111,2]))+ PF[x+1,1:(111-x)]=exp(-cumsum(MU[(x+1):111,1]))}> x=0; plot(1:111,PH[x+1,],ylim=c(0,1),type="l",col="blue")> lines(1:111,PF[x+1,],col="red")

17

Page 18: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Tables, per year t and Survival lifetimes

0 20 40 60 80 100

−10

−8

−6

−4

−2

0Mortality rate 1900

Age

Dea

th r

ate

(log)

FemaleMale

0 20 40 60 80 100

−10

−8

−6

−4

−2

0

Mortality rate 2000

Age

Dea

th r

ate

(log)

FemaleMale

18

Page 19: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Tables, per year t and Survival lifetimes

0 20 40 60 80 100

0.0

0.2

0.4

0.6

0.8

1.0

Survival probability in 1900

Age

Sur

viva

l pro

babi

lity

at a

ge 0

in 1

900

FemaleMale

0 20 40 60 80 100

0.0

0.2

0.4

0.6

0.8

1.0

Survival probability in 2000

Age

Sur

viva

l pro

babi

lity

at a

ge 0

in 2

000

FemaleMale

19

Page 20: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Survival lifetimes and rectangularization’

0 20 40 60 80 100 120

0.0

0.2

0.4

0.6

0.8

1.0

Male Mortality

Age

Sur

viva

l pro

babi

lity

at b

irth

1900

1910

1920

1930

1940

1950

1960

1970

1980

1990

2000

0 20 40 60 80 100 120

0.0

0.2

0.4

0.6

0.8

1.0

Female Mortality

Age

Sur

viva

l pro

babi

lity

at b

irth

1900

1910

1920

1930

1940

1950

1960

1970

1980

1990

2000

20

Page 21: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Life table and transversality> XV<-unique(Deces$Age); YV<-unique(Deces$Year)> DTF<-t(matrix(Deces[,3],length(XV),length(YV)))> ownames(DTF)=YV;colnames(DTF)=XV> t(DTF)[1:13,1:10]

1899 1900 1901 1902 1903 1904 1905 1906 1907 19080 64039 61635 56421 53321 52573 54947 50720 53734 47255 469971 12119 11293 10293 10616 10251 10514 9340 10262 10104 95172 6983 6091 5853 5734 5673 5494 5028 5232 4477 40943 4329 3953 3748 3654 3382 3283 3294 3262 2912 27214 3220 3063 2936 2710 2500 2360 2381 2505 2213 20785 2284 2149 2172 2020 1932 1770 1788 1782 1789 17516 1834 1836 1761 1651 1664 1433 1448 1517 1428 13287 1475 1534 1493 1420 1353 1228 1259 1250 1204 11088 1353 1358 1255 1229 1251 1169 1132 1134 1083 9619 1175 1225 1154 1008 1089 981 1027 1025 957 88510 1174 1114 1063 984 977 882 955 937 942 81211 1162 1055 1038 1020 945 954 931 936 880 85112 1100 1254 1076 1034 1023 1009 1041 1026 954 90813 1251 1283 1190 1126 1108 1093 1111 1054 1103 940

21

Page 22: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Life table and transversalityIt might be interesting to follow a cohort, per year of birth x− t,

> Nannee <- max(DEATH$Year)> naissance <- 1950> taille <- Nannee - naissance> Vage <- seq(0,length=taille+1)> Vnaissance <- seq(naissance,length=taille+1)> Cagreg <- DEATH$Year*1000+DEATH$Age> Vagreg <- Vnaissance*1000+Vage> indice <- Cagreg%in%Vagreg> DEATH[indice,]

Year Age Female Male Total5662 1950 0 18943.05 25912.38 44855.435774 1951 1 2078.41 2500.70 4579.115886 1952 2 693.20 810.32 1503.525998 1953 3 375.08 467.12 842.206110 1954 4 287.04 329.09 616.136222 1955 5 205.03 246.07 451.106334 1956 6 170.00 244.00 414.00

22

Page 23: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Life table and transversality

0 20 40 60 80 100

−10

−8

−6

−4

−2

0Mortality rate 1900

Age

Dea

th r

ate

(log)

FemaleMale

FemaleMale

Transversal

Longitudinal

0 20 40 60 80 100

−10

−8

−6

−4

−2

0

Mortality rate 1950

Age

Dea

th r

ate

(log)

FemaleMale

FemaleMale

Transversal

Longitudinal

23

Page 24: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Lee & Carter (1992) modelAssume here (as in the original model)

logµx,t = αx + βx · κt + εx,t,

with some i.i.d. noise εx,t. Identification assumptions are usually

xM∑x=xm

βx = 1 andtM∑

t=tm

κt = 0.

Then sets of parameters α = (αx), β = (βx) and κ = (κt), are obtained solving(αx, βx, κt

)= arg min

∑x,t

(lnµxt − αx − βx · kt)2.

24

Page 25: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Using demography packagePackage demography can be used to fit a Lee-Carter model

> library(forecast)> library(demography)> YEAR=unique(DEATH$Year);nC=length(YEAR)> AGE =unique(DEATH$Age);nL=length(AGE)> MUF =matrix(DEATH$Female/EXPOSURE$Female,nL,nC)> MUH =matrix(DEATH$Male/EXPOSURE$Male,nL,nC)> POPF=matrix(EXPOSURE$Female,nL,nC)> POPH=matrix(EXPOSURE$Male,nL,nC)

Then wo use the demogdata format

> BASEH <- demogdata(data=MUH, pop=POPH, ages=AGE, years=YEAR, type="mortality",+ label="France", name="Hommes", lambda=1)> BASEF <- demogdata(data=MUF, pop=POPF,ages=AGE, years=YEAR, type="mortality",+ label="France", name="Femmes", lambda=1)

25

Page 26: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Estimation of α = (αx) and β = (βx)The code is simply LCH <- lca(BASEH)

> plot(LCH$age,LCH$ax,col="blue"); plot(LCH$age,LCH$bx,col="blue")

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

0 20 40 60 80 100

−7

−6

−5

−4

−3

−2

−1

LCH$age

LCH

$ax

●●

●●●

●●

●●

●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●●●●

●●●

0 20 40 60 80 100

0.00

50.

010

0.01

50.

020

0.02

5

LCH$age

LCH

$bx

26

Page 27: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Estimation and projection of κ = (κt)’sUse library(forcast) to predict future κt’s, e.g. using exponential smoothing

> library(forecast)> Y <- LCH$kt> (ETS <- ets(Y))ETS(A,N,N)

Call:ets(y = Y)

Smoothing parameters:alpha = 0.8923

Initial states:l = 71.5007

sigma: 12.3592

AIC AICc BIC

27

Page 28: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

1042.074 1042.190 1047.420

> plot(forecast(ETS,h=100))

But as in Lee & Carter original model, it is possible to fit an ARMA(1,1) model,on the differentiate series (∆κt)

∆κt = φ∆κt−1 + δ + ut − θut−1

It is also possible to consider a linear tendency

κt = α+ βt+ φκt−1 + ut − θut−1.

> (ARIMA <- auto.arima(Y,allowdrift=TRUE))Series: YARIMA(0,1,0) with drift

Call: auto.arima(x = Y, allowdrift = TRUE)

Coefficients:

28

Page 29: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

drift-1.9346

s.e. 1.1972

sigma^2 estimated as 151.9: log likelihood = -416.64AIC = 837.29 AICc = 837.41 BIC = 842.62

> plot(forecast(ARIMA,h=100))

29

Page 30: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Projection of κt’s

●●●●●●●●●●●

●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●

●●●●●

●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

Forecasts from ETS(A,N,N)

1900 1950 2000 2050 2100

−50

0−

400

−30

0−

200

−10

00

100

●●●●●●●●●●●

●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●

●●●●●

●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

Forecasts from ARIMA(0,1,0) with drift

1900 1950 2000 2050 2100

−50

0−

400

−30

0−

200

−10

00

100

30

Page 31: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Shouldn’t we start modeling after 1945 ?Starting in 1948, LCH0 <- lca(BASEH,years=1948:2005)

●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●

●●●●

●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

0 20 40 60 80 100

−8

−6

−4

−2

LCH$age

LCH

$ax

●●

●●●

●●

●●

●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●●●●

●●●

0 20 40 60 80 100

0.00

50.

010

0.01

50.

020

0.02

5

LCH$age

LCH

$bx

31

Page 32: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Projection of κt’s

●●●●●●●●●●●

●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●

●●●●●

●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

Forecasts from ARIMA(0,1,0) with drift

1900 1950 2000 2050 2100

−50

0−

400

−30

0−

200

−10

00

100

●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●

Forecasts from ARIMA(1,1,0) with drift

1900 1950 2000 2050 2100

−50

0−

400

−30

0−

200

−10

00

100

32

Page 33: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Projection of life expectancy, born in 2005> LCHT=lifetable(LCHf); plot(0:100,LCHT$ex[,5],type="l",col="red")> LCHTu=lifetable(LCHf,"upper"); lines(0:100,LCHTu$ex[,5],lty=2)> LCHTl=lifetable(LCHf,"lower"); lines(0:100,LCHTl$ex[,5],lty=2)

0 20 40 60 80 100

020

4060

80

Life expectancy in 2005

Age

Res

idua

l exp

ecte

d lif

time

33

Page 34: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Residuals in Lee & Carter modelRecall that

logµx,t = αx + βx · κt + εx,t

Let εx,t denote pseudo-residuals, obtained from estimation

εx,t = logµx,t −(αx + βx · κt

).

> RES=residuals(LCH,"pearson")> colr=function(k) rainbow(110)[k*100]> couleur=Vectorize(colr)(seq(.01,1,by=.01))> plot(rep(RES$y,length(RES$x)),(RES$z),col=couleur[rep(RES$x,+ each=length(RES$y))-RES$x[1]+1])> plot(rep(RES$x,each=length(RES$y)),t(RES$z),col=couleur[rep(RES$y,length(RES$x))+1])

34

Page 35: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Residuals in Lee & Carter model

●●

●●

●●●●●

●●●

●●

●●●

●●●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●●●

●●

●●

●●●●●

●●

●●●●

●●●

●●●●

●●●

●●

●●●

●●●

●●●●●●●●

●●●

●●●

●●

●●●

●●●●

●●●

●●●

●●

●●

●●

●●

●●●●●

●●

●●●●

●●●●

●●

●●

●●●●●

●●

●●●●●●

●●●

●●

●●●

●●●●●●●●

●●●

●●●●●●●●●●●

●●

●●

●●●

●●●●●

●●

●●

●●

●●

●●●

●●

●●●

●●

●●●●●

●●

●●●●

●●

●●

●●●

●●

●●●●●●●●

●●

●●

●●●●●●●

●●●●●●

●●●

●●

●●●●

●●●●●●●

●●

●●

●●●

●●●●

●●●●●

●●●●

●●

●●●

●●

●●●

●●

●●

●●●●

●●●

●●

●●●●●●

●●●●●●

●●●●●●

●●●

●●●●

●●

●●

●●●

●●

●●●

●●●●●

●●●

●●●

●●●

●●

●●●

●●

●●

●●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●●●●

●●

●●●

●●●●●●

●●

●●

●●●

●●

●●●●●●●

●●

●●●●●●●●

●●

●●●

●●●●

●●●●

●●

●●

●●

●●●

●●●

●●●

●●●●

●●●

●●●●

●●

●●

●●●

●●

●●●●●

●●

●●●●

●●●●

●●

●●●●●●

●●●●●●●●●●

●●

●●●●●●●

●●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●

●●●●

●●

●●●

●●

●●●●●

●●

●●●

●●

●●●

●●●●●●

●●●●

●●●●●●

●●●●●●●●●●

●●●●

●●●

●●●

●●

●●●●

●●

●●●●

●●●

●●

●●

●●

●●

●●

●●●●

●●●●

●●

●●

●●●

●●●

●●●●

●●●

●●●●

●●●

●●●●

●●

●●●●●●●●

●●●

●●●

●●●●●

●●

●●●●

●●

●●

●●●

●●●●●

●●●

●●●

●●

●●

●●

●●●●

●●●●●●●

●●

●●

●●●●

●●●●

●●●

●●●

●●●●

●●●●●●●●●

●●●

●●●

●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●

●●●

●●●

●●●●●●

●●

●●●

●●●●

●●●

●●●

●●

●●●●

●●●●●●●●

●●

●●●●

●●●●●●●●

●●●

●●●●

●●●●

●●

●●●

●●●●●

●●

●●●●●●●●●●●●●●

●●●●

●●●●

●●●

●●●●●●●●●●

●●●

●●●

●●

●●

●●

●●

●●●●●●

●●●

●●

●●

●●●

●●●●●●●●

●●●●

●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●

●●●●

●●

●●

●●●

●●●●

●●

●●●●

●●●

●●●

●●●

●●

●●●●●●●●

●●●

●●●●●●●●●●●●●●●

●●●

●●●●●

●●●●●●●●●●●●●●

●●●

●●●●●●●

●●

●●

●●●

●●●

●●●●

●●

●●

●●●

●●●

●●●●●●●

●●●●

●●●●●

●●

●●●●●●

●●●●

●●

●●●●●●●

●●

●●●●●●●

●●●●●●●●●

●●

●●

●●●●●

●●●●●

●●

●●●●

●●

●●●

●●●●●●

●●

●●●●●

●●

●●●

●●

●●●●

●●●

●●●●●●●●

●●●●●

●●●●●●

●●●●

●●●●●●●●

●●●●●●

●●●●●●●●●●●

●●●

●●●●

●●●

●●●●●

●●●

●●

●●

●●●

●●●●●

●●

●●●●●●●

●●●●

●●

●●●

●●●●●●●●

●●●●●●●

●●●

●●●

●●●●

●●●

●●●●●

●●●●

●●●●●

●●

●●

●●●

●●●●●

●●

●●

●●

●●

●●●

●●

●●●●●

●●●●

●●●

●●

●●●●

●●●

●●●

●●●●●

●●●

●●

●●●

●●●●●

●●●●●●●●●●●●●●●

●●●

●●

●●

●●

●●

●●●●

●●

●●

●●

●●●

●●

●●

●●●

●●●

●●●

●●●

●●●

●●●●●

●●●●

●●●●●●

●●

●●

●●●●

●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●●●●●●

●●

●●

●●●

●●●

●●

●●●

●●●●

●●●

●●●●●

●●

●●●●●●●●●●●●●●

●●●●●

●●●●●●●●●

●●●●●●●●

●●●●

●●

●●

●●●

●●

●●●●

●●

●●●●

●●

●●

●●

●●

●●

●●●

●●

●●●●●

●●●●

●●●●●

●●●●●●●●

●●●

●●●●●

●●●

●●●

●●●

●●●●●●●●●●

●●●●

●●

●●

●●●

●●

●●●●●●

●●●●

●●

●●●●

●●●●●

●●●●●

●●

●●

●●

●●●●●

●●●●

●●●●●●●●●●

●●●●

●●●●●

●●●●●●●●●

●●●

●●●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●●●●

●●

●●

●●●●●●

●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●

●●●●●●●

●●

●●

●●●

●●●●

●●●

●●

●●●

●●●●●●

●●●●

●●●●●●●●●●

●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●

●●

●●

●●●

●●

●●●●●

●●

●●●

●●

●●●●●●●

●●●●

●●

●●●●●●●●

●●

●●

●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●

●●●●●

●●●

●●

●●●

●●●

●●●●

●●●●●●

●●●●●●

●●●●

●●

●●●

●●●●●●

●●●●●●●●●●●●

●●●●●●●●●

●●

●●

●●

●●●●●●●●●

●●●

●●

●●

●●

●●●

●●

●●●

●●

●●●

●●●

●●●

●●●

●●●●●●●

●●●●

●●●

●●●●

●●●●●●●●

●●

●●●

●●●

●●●●●●

●●●●●

●●●●●

●●●●●●●●●●

●●●●

●●●●●●

●●

●●

●●●

●●●

●●●

●●●

●●

●●●●●●

●●●

●●●●

●●

●●●●

●●●●●●●●●●●●

●●●●●●

●●●●●●●●●●●●

●●●●●

●●●●●●●●●●●●

●●●●●●

●●

●●

●●

●●

●●

●●●●

●●

●●●

●●●

●●●●●

●●

●●●●

●●

●●●

●●●●●●●●

●●●●●

●●●●

●●●●●●●●●●●●●●

●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●

●●

●●●●●

●●

●●●

●●●

●●●

●●●●●

●●

●●●●●●

●●●●●

●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●

●●●●

●●

●●

●●

●●●●

●●

●●●●●●

●●

●●●●●●

●●

●●

●●●●

●●●●

●●●●●●●●●●

●●

●●●●●●●

●●●●●●●●●●

●●●●●●●●●●

●●●

●●●●

●●

●●●

●●●●

●●●

●●

●●●

●●●●●

●●●●

●●●●

●●

●●●

●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●

●●●

●●●●●

●●

●●●●

●●●

●●●

●●

●●

●●

●●●●●●

●●

●●●

●●

●●●●●●

●●●

●●●●●●●

●●●●

●●●●●

●●

●●●

●●●●

●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●

●●●

●●

●●●●●●

●●●

●●●●

●●●

●●●

●●●

●●●●

●●●●●●●

●●●●

●●●●●●●●●

●●●

●●●

●●●

●●●●

●●●●●●●●●

●●●

●●●●●

●●●

●●●●●●●

●●●

●●

●●●●●

●●

●●●

●●

●●●●●●

●●●

●●●●●

●●●●●

●●

●●●●●●●

●●●●●●●●●●

●●

●●●●●●●●●●●●

●●●

●●●●●

●●●

●●●●

●●●●

●●

●●

●●●

●●

●●●

●●

●●

●●

●●●

●●●●●●

●●●●

●●

●●●●●

●●

●●●●●

●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●●●

●●

●●●●

●●●●●

●●●

●●

●●●

●●●

●●

●●●

●●●

●●

●●●●●

●●●

●●●

●●

●●

●●●●

●●

●●●

●●●●●●●●●●●●

●●●●

●●

●●●●●●●●●●●●●●●●●

●●●●●

●●●

●●●●●

●●●

●●

●●

●●

●●●

●●●

●●●

●●●

●●●●●

●●●●

●●●

●●●●

●●

●●

●●●

●●●●●●

●●●●●●●●●●●

●●●●●

●●

●●●●●●●●●●●●●●

●●

●●●●

●●●●●

●●

●●●

●●●●●

●●

●●

●●

●●

●●●

●●●

●●●●

●●●

●●●●●

●●●

●●●●●●●●●●●

●●●

●●●●●●

●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●

●●

●●

●●●

●●●●

●●●

●●●

●●

●●

●●●●●

●●

●●●●●

●●

●●●●●

●●●●●●●●●

●●●●●

●●●●●●●●●

●●●●●●●●●●

●●●●●●●●●●

●●●●●

●●●●

●●●

●●●●

●●

●●●●

●●●

●●

●●●

●●●

●●

●●

●●

●●

●●●

●●●●●

●●

●●●

●●●●

●●●

●●●

●●●●●●●●

●●●●

●●●●●●●●●●●

●●

●●●●

●●

●●●●

●●

●●

●●

●●

●●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●

●●●

●●●●●●●●●●●●●●

●●●●

●●●●●●●●●

●●●●●●●●●●●●●●●

●●●●

●●●

●●

●●

●●

●●

●●

●●

●●●●●●●

●●●

●●

●●●

●●

●●●

●●●

●●●●●

●●●●●●

●●●●●●

●●●●●●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●●●

●●●●●

●●●●●●●●●●●●●●●●

●●●

●●●●●●●●

●●●●

●●●

●●●

●●●

●●

●●

●●

●●●

●●

●●●

●●●

●●●●●

●●●

●●●

●●●

●●●

●●●●●●●

●●●●

●●●●

●●●●

●●●

●●●●●

●●●●

●●●●●●●●●

●●●

●●●●

●●●●

●●●●●●

●●

●●

●●●●

●●

●●●

●●●

●●●●

●●

●●

●●●●

●●

●●●

●●●

●●

●●●●●●●

●●●●

●●

●●●●

●●

●●●●

●●●●●●●●●

●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●

●●●●

●●

●●

●●

●●

●●

●●

●●●

●●●●●

●●

●●

●●

●●

●●●●

●●●●

●●●●

●●●

●●

●●●

●●●●●●●

●●●●●●●

●●●●●●●●●●

●●

●●●●●●●●●●●●●

●●●●

●●

●●●

●●

●●

●●

●●

●●●●

●●●

●●●

●●●

●●●●●

●●●●

●●●●●●

●●●

●●●●●●●●●●●●●

●●●●●●●●

●●

●●●●

●●

●●●

●●●●●●●●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●●●●●●●

●●●●●

●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●

●●●

●●●

●●●●●●●

●●

●●

●●

●●●

●●●●

●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●●●●●●●

●●●●●

●●●●●●●●●

●●●●●●●●

●●●

●●●●●●●●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●●●

●●●●

●●

●●

●●

●●

●●

●●●●●●

●●

●●

●●●●●●●●●●

●●●●●●●

●●●●

●●●●

●●●●●●●●●●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●●●

●●●

●●●●●

●●●●●●●●●●●●

●●

●●●●

●●●●●●●●

●●●

●●●●

●●●●●●●●

●●

●●●●●●

●●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●

●●●●●●

●●●

●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●

●●●●●

●●●●●●

●●●●●●●●●●

●●

●●●●●

●●●●

●●●●●

●●

●●●

●●

●●

●●

●●

●●

●●●●

●●●●●●

●●●●●●●●●●

●●●●●●●●●

●●●

●●●●●●●●

●●●●●●●●●●●●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●●

●●

●●

●●●

●●

●●●●●

●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●●

●●

●●●

●●

●●

●●

●●●●

●●●

●●●●●

●●●●

●●●

●●●●●●●●●

●●●●●●●●●●●●●●

●●

●●●

●●●●●●

●●●

●●●

●●

●●

●●

●●

●●

●●

●●●

●●●●

●●●

●●

●●

●●

●●●

●●●

●●●●

●●●

●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●

●●●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●●

●●●

●●

●●●

●●●

●●●

●●

●●

●●●

●●●

●●●●●●●●●●

●●●●●●●●●●●●

●●●●●●

●●●●●●●●●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●●●

●●

●●

●●●

●●●

●●●●●

●●●●●●●●●●

●●●●●●●●●

●●●●●●●●●●●

●●●

●●●●●●●

●●

●●●●

●●●●

●●

●●

●●

●●

●●●●

●●●

●●●

●●

●●

●●●●●●●

●●●●●●

●●●●●●●●

●●●●●●●

●●●●●●●●●●●●●●

●●●●●●●

●●●

●●

●●●●

●●●●●

●●●

●●

●●●

●●●

●●

●●●

●●●

●●

●●●

●●●

●●●●

●●

●●●●●●●●●●●●

●●●●●●●●●●

●●●●●●●●●●

●●●●●●●

●●●

●●●●

●●●

●●

●●

●●

●●●●●

●●●

●●

●●●

●●

●●●●

●●●●●

●●●

●●●●●●●●●●●●

●●●●●●●

●●●

●●●●●●●●

●●●●

●●●●●

●●

●●●

●●●

●●

●●

●●

●●

●●

●●●●

●●●●●

●●

●●

●●

●●

●●

●●●●

●●

●●●●●●●●●●●●●●●

●●●●●●●●

●●●●●●●

●●●

●●●●

●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●●

●●●

●●●

●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

●●

●●●●

●●●●

●●

●●●

●●

●●

●●

●●●

●●●

●●

●●●

●●●●●●

●●●

●●●

●●●

●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●

●●●

●●●

●●

●●●●

●●●

●●●●

●●●

●●●●

●●●

●●

●●

●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●●●

●●●

●●

●●●

●●

●●●●

●●

●●

●●

●●

●●

●●

●●

●●●

●●●●●

●●

●●

●●●●

●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●

●●●●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●●

●●●

●●●

●●●

●●●●

●●●

●●

●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●

●●●●●

●●●●●

●●●

●●●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●●

●●

●●

●●●

●●●●

●●●

●●

●●

●●●●●

●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●●●

●●

●●●

●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●

●●●●●

●●●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●●

●●●●●●●

●●●●●

●●

●●●

●●

●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●

●●●●●●●

●●●

●●●●

●●

●●

●●

●●

●●●

●●

●●●

●●

●●

●●●

●●●

●●●●●

●●●●●●

●●●●●●●●●

●●

●●

●●

●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●

●●●●●

●●

●●●

●●

●●

●●●

●●

●●●

●●

●●●●●

●●●●

●●●

●●●●●●●●●●●●

●●

●●●

●●●●●

●●●●●●●●●

●●●●●●●●●●●●●●●

●●●●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●

●●●

●●

●●●●●

●●●●●

●●●

●●●●●●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●

●●●

●●●●●

●●

●●

●●●

●●

●●

●●

●●●

●●

●●●●

●●●●

●●●

●●●●

●●●●●

●●●●●

●●

●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●●●

●●●●●●●

●●●●●

●●

●●●●●●

●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●

●●●

●●●

●●

●●

●●●

●●●●●●●●●

●●●

●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●

●●

●●●●

●●●

●●

●●●

●●

●●●●●●

●●●

●●●●●●

●●●●●●●

●●●●

●●

●●●

●●●●●●●●●●●●●●●●●●●●

●●●●●

●●●●●●●●

●●●●

●●●

●●

●●●

●●

●●●

●●

●●●

●●

●●

●●

●●●

●●●●●●●

●●●●●●●●●

●●

●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●

●●

●●

●●●

●●●

●●

●●●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●●

●●

●●

●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●

●●●●●

●●

●●

●●

●●●

●●●

●●●

●●●

●●●●●●●●

●●●

●●

●●●●●

●●●●●●●●●

●●●

●●●●●

●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●

●●●●

●●●

●●●●

●●●●●●●●●●●●●

●●

●●

●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●

●●

●●●

●●

●●●

●●

●●●

●●●

●●●

●●

●●●

●●●●

●●●●●●●

●●●●●

●●●

●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●●

●●

●●

●●●

●●

●●●

●●●

●●●

●●●

●●●●●

●●●●

●●

●●

●●

●●

●●●●●●●●●

●●●●●●

●●

●●●●●●

●●●●●●●●

●●●●●●●●●●●

●●●

●●●

●●

●●●●

●●

●●

●●●●

●●

●●●

●●●●●●

●●●●

●●

●●●

●●●●

●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●

●●●●●●●●

●●●●●

●●●●●

●●

●●

●●●

●●

●●

●●●

●●●

●●●

●●●●

●●●

●●●●

●●●

●●

●●

●●●●●●●●●

●●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●

●●

●●●

●●

●●

●●

●●●

●●●

●●

●●●

●●

●●●●●

●●●

●●●●

●●●●●●●●

●●●

●●●●●

●●

●●●●●●●●●●●●●●●

●●●●●●●●●●

●●●●●

●●●

●●

●●●

●●

●●●

●●●

●●

●●●

●●●●●

●●●

●●●

●●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●

●●●●●●●●●●●

●●

●●

●●

●●●

●●

●●●

●●●

●●●

●●

●●●

●●●●●●●

●●

●●●●●●●

●●●●

●●●●

●●●●●●●●

●●●

●●●●●●

●●

●●

●●

●●●●●●●●●●

●●●●●●●●●

●●●●●

●●

●●

●●

●●

●●●●●

●●

●●●

●●

●●

●●●

●●●●●●

●●●●●●●●

●●

●●

●●●●●

●●●●●●●●●●●●●●

●●

●●●

●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●

●●●

●●●●

●●●●●

●●●

●●●

●●●●●●●●

●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●

●●●●

●●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●●●

●●●

●●●

●●●●

●●

●●

●●●●●●

●●

●●

●●●●●●●●

●●●

●●●

●●●●

●●

●●●●●●●●●●●●●

●●●

●●●●●●●

●●●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●●●●●

●●●●

●●

●●

●●●

●●●

●●

●●●●

●●

●●

●●●●●●●●●

●●●

●●●●

●●●

●●●●●

●●●●●●●●●●●●●●●●

●●●●

●●●

●●

●●

●●

●●●●●●●

●●

●●

●●●

●●

●●●

●●●●●●

●●

●●

●●

●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●

●●

●●●●

●●

●●●

●●

●●

●●

●●●●●●●

●●

●●●●

●●●●

●●●●

●●●

●●●●●

●●●

●●●●

●●●

●●●●●●●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●●●

●●●

●●

●●●

●●●

●●●

●●●●●●●●●●●●●●●●●

●●

●●

●●●●●●●●●●●●●

●●●

●●

●●

●●

●●

●●

●●●

●●●

●●●●●

●●

●●●

●●●●

●●

●●●

●●

●●●●●

●●

●●●●●●●●●●●●●●●●●●

●●●

●●●

●●●●●●●●●●●●●

●●

●●

●●●

●●

●●●

●●

●●●●

●●●

●●●

●●●●●

●●

●●●

●●●●

●●●●●

●●

●●●●

●●●●●●

●●●●●●●●●●

●●●

●●●●●●●●●●●●●●

●●●●

●●

●●●

●●●

●●

●●●

●●●●●

●●

●●

●●●

●●●

●●

●●

●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●

●●

●●●●●●●●●●●●●●●

●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●

●●●

●●●●

●●

●●●●●

●●

●●

●●

●●●●●●

●●●●●●●●●●

●●●●●●●●●●

●●●

●●●●●●●●●●●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●●

●●

●●●●●

●●●●

●●●

●●

●●●

●●●●●

●●●●

●●●

●●●●●●●●●●●

●●●●●●●●●

●●●

●●●●●●●

●●●●●●●

●●

●●

●●●

●●●

●●

●●

●●

●●●

●●

●●●●

●●●

●●

●●

●●

●●

●●

●●●●

●●

●●

●●●●●

●●●●●●●●●

●●●●●●●●●●

●●

●●●●●●●

●●●

●●●●●

●●

●●

●●

●●

●●

●●●●●●●

●●●●●

●●●

●●

●●●

●●●●

●●●●●●

●●●●●●●

●●●●

●●●●●●

●●●●●●●●●●

●●

●●●●●●

●●●●

●●

●●

●●

●●●

●●

●●

●●●●

●●●●●●●

●●●

●●

●●

●●

●●

●●●

●●

●●

●●●●

●●

●●

●●

●●

●●●●

●●●●●●●

●●●●●●●

●●

●●●●●●●●

●●●

●●●

●●

●●●

●●●

●●●

●●●●

●●

●●

●●●

●●●

●●●●●

●●●

●●●●

●●

●●●

●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●

●●

●●●●

●●●●●●●

●●●

●●

●●

●●

●●

●●

●●

●●●●

●●●

●●●

●●●●

●●

●●●●●

●●●●

●●●

●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●

●●

●●

●●●●●

●●●●●●

●●

●●

●●●

●●●

●●

●●●

●●●

●●●●

●●●

●●

●●●●●

●●

●●●●

●●●●●

●●●

●●●●●

●●●●●●●

●●

●●●●●●●●

●●

●●●

●●●●

●●

●●

●●●

●●●●

●●

●●●

●●

●●

●●●

●●

●●●

●●●●

●●●

●●●●●

●●●

●●●●●

●●●

●●●●

●●●●●●

●●●●●●●●

●●●

●●

●●●●●●●●●

●●

●●

●●

●●

●●

●●

●●●

●●

●●●●●●

●●

●●●●

●●

●●●●●

●●●●

●●●●●●

●●●●

●●●●

●●●●●

●●●●●●●●●●●

●●

●●●●●●●●●

0 20 40 60 80 100 120

−1.

5−

1.0

−0.

50.

00.

51.

01.

5

Age

Res

idua

ls (

Pea

rson

)

1900

1910

1920

1930

1940

1950

1960

1970

1980

1990

2000

35

Page 36: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Residuals in Lee & Carter model

●●

●●●

●●●●●●●●

●●

●●●

●●●●

●●

●●

●●

●●●●●●

●●●●

●●

●●●●●●●●●

●●●●●●●

●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●

●●●●

●●●

●●●●●

●●●●

●●●●●●●

●●

●●●●●●●●●●

●●

●●●●●●

●●●●●●●●●

●●●

●●●●●●

●●●●●●●●

●●●●

●●●●●●●●●●●●

●●

●●

●●●

●●●●●

●●●●

●●

●●

●●●

●●

●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●●

●●●●●●●●●

●●●●●●●●●●●●●●●

●●

●●●

●●●●●●●●●●●●●

●●

●●●●●●●●●●●

●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●

●●

●●

●●

●●●●

●●

●●●

●●●●

●●●

●●●●●

●●●●●

●●●

●●●●●●●

●●●●●●●●●●

●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●

●●●●●●●●

●●●●

●●

●●

●●

●●●●●●

●●●

●●●●

●●●

●●●●●●●●

●●●

●●

●●●●●

●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●

●●●●●●●●●

●●●●●●●●

●●●●

●●

●●

●●●

●●●●●●●●●●●●●

●●●

●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●●●●●●●●●●●●

●●

●●●●●

●●●

●●●●

●●●

●●●●

●●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●

●●●●●●

●●●●

●●●●●●●●

●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●

●●●●●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●

●●

●●●●●●●●●●●

●●●●

●●

●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●

●●●●●●●●●●●

●●●●●●

●●

●●

●●●●●●●●●●●●●●●

●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●

●●

●●

●●●

●●●●●●●●●●

●●●

●●●●●●

●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●

●●●

●●●

●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●●●●●

●●●●

●●●●●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●

●●●

●●

●●

●●●●●●●●

●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●●●●

●●●●

●●

●●

●●●●●●●●●●

●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●

●●●

●●●●

●●

●●

●●

●●●

●●●●●●●●●●

●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●

●●

●●

●●●●●●

●●●●●●●●●●

●●●

●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●●

●●●●●●●●●●●●●

●●

●●

●●●●

●●●●●●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●

●●●●●●

●●●●●

●●

●●●●

●●●●●

●●●●●

●●●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●●●●●●

●●●●

●●●

●●●●●●●●●

●●●●●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●

●●●

●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●●●●●●●●●

●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●

●●

●●●●●

●●●●●●●

●●●

●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●●●●●

●●●

●●

●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●●●●●●●

●●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●

●●

●●●●●

●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●●●

●●●●●●●●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●●

●●●●

●●●

●●●●●●●

●●

●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●

●●●●●●●●

●●

●●●

●●●

●●●●●●

●●●●●●●●●●●●●●

●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●

●●

●●●●●●●●●

●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●●●●●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●

●●

●●●

●●●●●●●

●●●●●

●●●

●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●

●●●

●●●●●

●●●

●●

●●●●●●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

●●

●●●●●●●●●

●●

●●●

●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●

●●●●

●●●●●●●

●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●

●●●●

●●●●●

●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●

●●●●●●

●●

●●

●●●

●●●●

●●●

●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●

●●

●●

●●●●●●●●

●●●●

●●

●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●●●●●

●●●

●●●●●●

●●●

●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●●

●●●●●●●●●●●

●●●

●●●

●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●

●●●●●●

●●●

●●●●●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●

●●

●●

●●●●

●●●●●●

●●●●

●●

●●

●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●●●●●●●●●

●●●●

●●●

●●●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●

●●●●

●●

●●

●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●

●●●●●●●

●●

●●

●●●●

●●●●

●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●●

●●

●●

●●

●●●●●

●●●●

●●●●

●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●

●●●●

●●●●

●●●

●●

●●

●●●

●●

●●●●●

●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●●●

●●

●●●

●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●

●●●●

●●●●●

●●

●●●●

●●●●●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●●●●●●

●●●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●●

●●

●●●●

●●

●●●●

●●

●●●●●

●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

●●

●●●

●●

●●

●●●

●●●●●

●●●

●●●

●●

●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●●

●●

●●●

●●●●

●●●

●●●

●●

●●●

●●●

●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●

●●●

●●●●

●●

●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●

●●●●

●●

●●●●

●●

●●●●

●●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●

●●●●

●●●●●

●●●

●●

●●●

●●●●●●

●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●

●●

●●

●●

●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●●●●●●

●●●

●●

●●

●●●●●

●●●●●●

●●

●●

●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●

●●

●●

●●

●●●

●●

●●

●●●

●●

●●

●●

●●●

●●●●●●●●

●●●

●●●

●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●

●●●●

●●

●●

●●●●●

●●

●●

●●●

●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●

●●●●●

●●●●●●●

●●●●

●●●●

●●●●

●●●●●●

●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●●●●●

●●●●

●●●●

●●

●●●

●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●

●●

●●

●●

●●●●●●

●●

●●

●●●●●●●●

●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●

●●

●●●●●●

●●●

●●

●●●●●●●●

●●

●●●●

●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●●

●●●

●●●●

●●

●●●●●●●

●●

●●

●●●

●●●●

●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●

●●●

●●●

●●●●●

●●

●●●

●●●●●●●●●●●●

●●●●●

●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●●

●●

●●●

●●

●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●●

●●

●●●●

●●

●●●●●

●●●●

●●●

●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●

●●●

●●

●●●●

●●

●●●●●●●●●●●●●

●●●●●●●

●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●

●●●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●

●●●

●●●●●

●●

●●●●●●●

●●●●●●●

●●●●●

●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●●●

●●

●●

●●

●●●●●●●●

●●●●●●●

●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●

●●●●●●●●●

●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●●●●●

●●

●●●

●●

●●●●●

●●

●●

●●●

●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●

●●●

●●

●●●●●

●●

●●

●●●

●●●●●●

●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●

●●●

●●●

●●●

●●●●●●●●●

●●●●●

●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●

●●

●●

●●

●●●

●●●

●●●●

●●

●●

●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●●

●●●

●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●

●●

●●●

●●

●●●●

●●●

●●●●●●●●●●●●●●●

●●

●●

●●●●●●●●●●●●●

●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●

●●●

●●●●

●●

●●●

●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●●●●

●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●

●●●

●●

●●●

●●●

●●●

●●●

●●

●●●●

●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●

●●●

●●●

●●●●●●●●●●

●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●●●

●●

●●●

●●●●

●●●●●●●●●

●●●●●●●●●●●

●●●●●●●

●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●

●●●●●

●●●

●●●●●●●

●●●●

●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●

●●●●●●●●

●●

●●●●

●●

●●

●●●

●●●

●●●●●●●●

●●●●●●

●●●●●●

●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●●●●

●●

●●

●●

●●●●●●●●●●

●●●●

●●●

●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●

●●

●●●●

●●

●●

●●

●●●●●●●●●

●●●●●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●

●●●●

●●

●●●●●●●●●●●●●

●●●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

●●

●●●●

●●●

●●●●●●●

●●●

●●●●

●●●●●●●●

●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●●

●●●

●●●

●●●

●●●●●●●●●●●●●●

●●

●●●●●

●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●

●●

●●●●●

●●

●●

●●●●●

●●●●●●●

●●●

●●●●●

●●

●●●●

●●●●

●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●●●●

●●●

●●●

●●

●●●

●●●●●●●

●●

●●●

●●●●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●

●●

●●

●●

●●●

●●●

●●

●●

●●●●●●●

●●●

●●●●●●

●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●●●

●●

●●

●●●●

●●

●●

●●●●

●●

●●●●●●●

●●●●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●●●●●●●

●●

●●●

●●●

●●

●●

●●

●●●

●●

●●●●●●●

●●●●

●●●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●

●●

●●

●●

●●

●●●●●●●

●●●●●●●●●●

●●●●●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●

●●

●●

●●●●●●●●●●●

●●●

●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●

●●

●●●

●●●

●●●

●●●●

●●

●●

●●●

●●●●●●●●

●●●

●●●●●

●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●

●●

●●

●●●

●●

●●

●●

●●●●●

●●●●

●●●●

●●●●●●●●●●●

●●●●

●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●

●●

●●●

●●●

●●

●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●

●●●●●

●●●

●●●●

●●●●●●●●●●●●

●●

●●●●

●●●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●

●●

●●

●●

●●

●●

●●●

●●●

●●●●●●●●

●●●●

●●●●●●●

●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●

●●

●●●●●●●●●

1900 1920 1940 1960 1980 2000 2020

−1.

5−

1.0

−0.

50.

00.

51.

01.

5

Year

Res

idua

ls (

Pea

rson

)

0

10

20

30

40

50

60

70

80

90

100

110

36

Page 37: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

LifeMetrics FunctionsLifeMetrics is based on R functions that can be downloaded from JPMorgan’swebsite, that can be uploaded using source("fitModels.r").

Standard functions are based on two matrices etx (for the exposure) and dtx fordeath counts, respectively at dates t and ages x.

Recall that, with discrete notation,

m(x, t) = # deaths during calendar year t aged x last birthdayaverage population during calendar year t aged x last birthday

Note that not only the Lee-Carter model is implemented, but several models,Lee & Carter (1992), logm(x, t) = β

(1)x + β

(2)x κ

(2)t ,

Renshaw & Haberman (2006), logm(x, t) = β(1)x + β

(2)x κ

(2)t + β

(3)x γ

(3)t−x,

Currie (2006), logm(x, t) = β(1)x + κ

(2)t + γ

(3)t−x,

Cairns, Blake & Dowd (2006), logit(1− e−m(x,t)) = κ(1)t + (x− α)κ(2)

t ,Cairns et al. (2007), logit(1− e−m(x,t)) = κ

(1)t + (x− α)κ(2)

t + γ(3)t−x.

37

Page 38: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

LifeMetrics FunctionsFor Lee & Carter model,

> res <- fit701(x, y, etx, dtx, wa)

where wa is a (possible) weight function. Here, assume that wa=1.

Remark : we have to remove very old ages,

> DEATH <- DEATH[DEATH$Age<90,]> EXPOSURE <- EXPOSURE[EXPOSURE$Age<90,]> XV <- unique(DEATH$Age)> YV <- unique(DEATH$Year)> ETF <- t(matrix(EXPOSURE[,3],length(XV),length(YV)))> DTF <- t(matrix(DEATH[,3],length(XV),length(YV)))> ETH <- t(matrix(EXPOSURE[,4],length(XV),length(YV)))> DTH <- t(matrix(DEATH[,4],length(XV),length(YV)))> WA <- matrix(1,length(YV),length(XV))> LCF <- fit701(xv=XV,yv=YV,etx=ETF,dtx=DTF,wa=WA)> LCH <- fit701(xv=XV,yv=YV,etx=ETH,dtx=DTH,wa=WA)

38

Page 39: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

LifeMetrics FunctionsThe output is the following, LC$kappa1, LC$beta1, ... LC$ll for the maximumlog-likelihood estimators of different parameters, LC$mtx is an array with crudedeath rates, and LC$mhat with fitted death rates. LC$cy is the vector of cohortyears of birth (corresponding to LC$gamma3).

It it then possible to plot one of the cofficients against either LC$x or LC$y.

> plot(LCF$x,LCF$beta1,type="l",col="red")> lines(LCH$x,LCH$beta1,col="blue",lty=2)> plot(LCF$x,LCF$beta2,type="l",col="red")> lines(LCH$x,LCH$beta2,col="blue",lty=2)

39

Page 40: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

0 20 40 60 80

−7

−6

−5

−4

−3

−2

Age

LCF

$bet

a1

FemaleMale

0 20 40 60 80

0.00

50.

010

0.01

50.

020

Age

LCF

$bet

a2

FemaleMale

40

Page 41: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> plot(LCF$y,LCF$kappa2,type="l",col="red")> lines(LCH$y,LCH$kappa2,col="blue")

1900 1920 1940 1960 1980 2000

−15

0−

100

−50

050

100

Year

LCF

$kap

pa2

41

Page 42: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Using the gnm package(Much) more generally, it is possible to use the gnm package, to run a regression.Assume here that

Dx,t ∼ P(λx,t) where λx,t = Ex,t exp (αx + βx · κt)

which is a generalized nonlinear regression model.

> library(gnm)> Y=DEATH$Male> E=EXPOSURE$Male> Age= DEATH$Age> Year=DEATH$Year> I=(DEATH$Age<100)> base=data.frame(Y=Y[I],E=E[I],Age=Age[I],Year=Year[I])> REG=gnm(Y~factor(Age)+Mult((factor(Age)),factor(Year)),

data=base,offset=log(E),family=quasipoisson)InitialisingRunning start-up iterations..Running main iterations.......................Done

42

Page 43: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Using the gnm package

> names(REG$coefficients[c(1:5,85:90)])[1] "(Intercept)" "factor(Age)1" "factor(Age)2" "factor(Age)3"[5] "factor(Age)4" "factor(Age)84" "factor(Age)85" "factor(Age)86"[9] "factor(Age)87" "factor(Age)88" "factor(Age)89"

> names(REG$coefficients[c(91:94,178:180)])[1] "Mult(., factor(Year)).factor(Age)0" "Mult(., factor(Year)).factor(Age)1"[3] "Mult(., factor(Year)).factor(Age)2" "Mult(., factor(Year)).factor(Age)3"[5] "Mult(., factor(Year)).factor(Age)87" "Mult(., factor(Year)).factor(Age)88"[7] "Mult(., factor(Year)).factor(Age)89"> nomvar <- names(REG$coefficients)> nb3 <- substr(nomvar,nchar(nomvar)-3,nchar(nomvar))> nb2 <- substr(nomvar,nchar(nomvar)-1,nchar(nomvar))> nb1 <- substr(nomvar,nchar(nomvar),nchar(nomvar))> nb <- nb3> nb[substr(nb,1,1)=="g"]<- nb1[substr(nb,1,1)=="g"]> nb[substr(nb,1,1)=="e"]<- nb2[substr(nb,1,1)=="e"]> nb <- as.numeric(nb)> I <- which(abs(diff(nb))>1)

43

Page 44: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

●●●●●●●

●●●

●●●●●●●●●●●●●●

●●●●●●●●

●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●

0 20 40 60 80 100

−4

−3

−2

−1

01

2

Age

RE

G$c

oeffi

cien

ts[2

:I[1]

]

●●

●●●●●●

●●●

●●●●

●●●●

●●

●●

●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●

●●●●

●●●

●●

0 20 40 60 80 100

0.1

0.2

0.3

0.4

0.5

0.6

Age

RE

G$c

oeffi

cien

ts[(

I[1] +

1):

(I[2

])]

44

Page 45: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

1900 1920 1940 1960 1980 2000

−4

−2

02

46

Année

RE

G$c

oeffi

cien

ts[(

I[2] +

1):

leng

th(n

b)]

45

Page 46: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Using Lee & Carter projectionsUsing estimators of αx’s, βx’s, as well as projection of κt’s, it is possible to obtainprojection of any actuarial quantities, based on projections of µx,t’s. E.g.

> A <- LCH$ax; B <- LCH$bx> K1 <- LCH$kt; K2 <- LCH$kt[99]+LCHf$kt.f$mean; K <- c(K1,K2)> MU <- matrix(NA,length(A),length(K))> for(i in 1:length(A)){ for(j in 1:length(K)){+ MU[i,j] <- exp(A[i]+B[i]*K[j]) }}

46

Page 47: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

It is then possible to extrapolate k 7→ kpx’s

> t=2000> x=40> s=seq(0,99-x-1)

47

Page 48: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> MUd=MU[x+1+s,t+s-1898]> (Pxt=cumprod(exp(-diag(MUd))))[1] 0.99838440 0.99663098 0.99469369 0.99248602 0.99030804 0.98782725[7] 0.98417947 0.98017722 0.97575106 0.97098896 0.96576107 0.96006617

[13] 0.95402111 0.94749333 0.94045500 0.93291535 0.92484762 0.91622709[19] 0.90707101 0.89726011 0.88690981 0.87577047 0.86405282 0.85159220[25] 0.83850049 0.82472277 0.81011757 0.79478797 0.77847592 0.76144457[31] 0.74364218 0.72457570 0.70474824 0.68387491 0.66193090 0.63903821[37] 0.61469237 0.58924560 0.56257772 0.53478172 0.50577349 0.47480005[43] 0.44324965 0.41055038 0.37750446 0.34390607 0.30973747 0.27613617[49] 0.24253289 0.21038508 0.17960626 0.14970800 0.12276231 0.09902686[55] 0.07742879 0.05959964 0.04495042 0.03281240 0.02366992

and then we can derive projections of several actuarial (or demography)quantities. E.g. remaining lifetimes

> x=40> E=rep(NA,150)> for(t in 1900:2040){+ s=seq(0,90-x-1)+ MUd=MU[x+1+s,t+s-1898]

48

Page 49: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

+ Pxt=cumprod(exp(-diag(MUd)))+ ext=sum(Pxt)+ E[t-1899]=ext}> plot(1900:2049,E)

or expected present value of deferred whole life annuities, purchased at age 40,deferred of 30 years

> r=.035: m=70> VV=rep(NA,141)> for(t in 1900:2040){+ s=seq(0,90-x-1)+ MUd=MU[x+1+s,t+s-1898]+ Pxt=cumprod(exp(-diag(MUd)))+ h=seq(0,30)+ V=1/(1+r)^(m-x+h)*Pxt[m-x+h]+ VV[t-1899]=sum(V,na.rm=TRUE)}> plot(1900:2040,VV)

49

Page 50: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

1900 1950 2000 2050

3035

40

Residual life expectancy

Year

Res

idua

l life

exp

ecta

ncy,

at a

ge 4

0

1900 1920 1940 1960 1980 2000 2020 2040

1.5

2.0

2.5

3.0

3.5

Whole life insurance annuity

Year

50

Page 51: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Mortality rates as functional time seriesIt is possible to consider functional time series using rainbow package

> library(rainbow)> rownames(MUH)=AGE> colnames(MUH)=YEAR> rownames(MUF)=AGE> colnames(MUF)=YEAR> MUH=MUH[1:90,]> MUF=MUF[1:90,]> MUHF=fts(x = AGE[1:90], y = log(MUH), xname = "Age",yname = "Log Mortality Rate")> MUFF=fts(x = AGE[1:90], y = log(MUF), xname = "Age",yname = "Log Mortality Rate")> fboxplot(data = MUHF, plot.type = "functional", type = "bag")

Using principal components, it is possible to detect outliers

> fboxplot(data = MUHF, plot.type = "bivariate", type = "bag")

51

Page 52: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

0 20 40 60 80

−8

−6

−4

−2

Age

Log

Mor

talit

y R

ate

19141915191619171918

19191940194319441945

−5 0 5 10 15

01

23

4PC score 1

PC

sco

re 2

●●

●●●

●●

●●●

● ●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●

●●

●●

●●

●●● ●

●●

●●●

●●

●●●

●●

●●●

●●●

●●

●●●

●●

●●

●●

●●

●●

●●●

●●

●●

●●

●●●●

●●

●●

●●●

●●

●●●

●●●

●●

●●●

●●

●●

19141915

1916

1917

1918

1919

1940

1943

1944

1945

52

Page 53: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Cohort effect and Lee & Carter modelA natural idea is to include (on top of the age x and the year t) a cohort factor,based on the year of birth, t− x

logµx,t = αx + βx · κt + γx · δt−x + ηx,t,

as in Renshaw & Haberman (2006).

Using gnm function, it is possible to estimate that model, assuming again that alog-Poisson model for death counts is valid,

> D=as.vector(BASEB)> E=as.vector(BASEC)> A=rep(AGE,each=length(ANNEE))> Y=rep(ANNEE,length(AGE))> C=Y-A> base=data.frame(D,E,A,Y,C,a=as.factor(A),+ y=as.factor(Y),c=as.factor(C))> LCC=gnm(D~a+Mult(a,y)+Mult(a,c),offset=log(E), family=poisson,data=base)

53

Page 54: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

●●●●

●●●●●

●●●●●●

●●●●●●

●●

●●●

●●●

●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●

0 20 40 60 80 100

−1.

0−

0.8

−0.

6−

0.4

−0.

20.

0

Age

RE

G$c

oeffi

cien

ts[(

I[1] +

1):

(I[2

])]

●●●●

●●●●●●●

●●●●

●●

●●●●●●●

●●●●●

●●●●

●●●●

●●

●●●●

●●

●●●●●●

●●●●●●

●●●●●●

●●●●●●

●●●●

●●●●

●●●●●

●●●●●

●●●●●●●●

●●

●●

1900 1920 1940 1960 1980 2000

−4

−2

02

Year

RE

G$c

oeffi

cien

ts[(

I[2] +

1):

(I[3

])]

54

Page 55: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

●●

●●

●●●●●●

●●

●●●●●●●●

●●●

●●

●●

●●

●●

●●

●●

●●●●●●

●●●●●●●

●●●

●●●●●●●●●

●●●●●

●●●●●●●

●●

●●

●●

0 20 40 60 80 100

−1.

0−

0.5

0.0

0.5

Age

RE

G$c

oeffi

cien

ts[(

I[3] +

1):

(I[4

])]

●●

●●●●●●

●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●

●●●●●●●●●●●

●●●●●●●●●●●●●

●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●●

●●●●●●●●●●●

1800 1850 1900 1950 2000

−4

−2

02

Year (cohort)

RE

G$c

oeffi

cien

ts[(

I[4] +

1):

leng

th(n

b)]

55

Page 56: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

PRACTICALS

56

Page 57: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> DEATH=read.table(+ "http://freakonometrics.free.fr/DeathsSwitzerland.txt",+ header=TRUE,skip=2)> EXPOSURE=read.table(+ "http://freakonometrics.free.fr/ExposuresSwitzerland.txt",+ header=TRUE,skip=2)> DEATH$Age=as.numeric(as.character(DEATH$Age))> DEATH=DEATH[-which(is.na(DEATH$Age)),]> EXPOSURE$Age=as.numeric(as.character(EXPOSURE$Age))> EXPOSURE=EXPOSURE[-which(is.na(EXPOSURE$Age)),]

57

Page 58: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

– based on those datasets, plot the log mortality rates for male and female,– for those two datasets, plot the log mortality rates in 1900 and 1950,

respectively– for those two datasets, plot the log mortality rates for the cohort born on 1900

and 1950, respectively– on the total dataset (male and female), fit a Lee-Carter model. Plot the age

coefficients– plot the time coefficients and propose a forecast for that series of estimators.– plot the residuals obtained from the regression– using those estimates, and the forecasts, project the log-mortality rates– extrapolate the survival function of an insured aged 40 in 2000, and compare it

with the one obtained on the longitudinal dataset.

58

Page 59: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Part II

NON LIFE INSURANCE

59

Page 60: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Loss development triangle in nonlife insuranceLet PAID denote a triangle of cumulated payments, over time

> PAID[,1] [,2] [,3] [,4] [,5] [,6]

[1,] 3209 4372 4411 4428 4435 4456[2,] 3367 4659 4696 4720 4730 NA[3,] 3871 5345 5398 5420 NA NA[4,] 4239 5917 6020 NA NA NA[5,] 4929 6794 NA NA NA NA[6,] 5217 NA NA NA NA NA

– row i the accident year– column j the development year– diagonal i+ j the calendar year (for incremental payments)– Yi,j are incremental payments– Ci,j are cumulated payments, per accident year, Ci,j = Yi,0 + Yi,1 + · · ·+ Yi,j

60

Page 61: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Incurred But Not Reported - IBNRAt time n, all claims occurred before have not necessarily been (fully) reported,or settled, so claims manager have to predict the total amount of payments. LetHn denote the information available at time n (the upper part of the triangle)

Hn = {(Yi,j), i+ j ≤ n} = {(Ci,j), i+ j ≤ n}.

For accident year i, we want to get a best estimate of the total amount ofpayment, i.e.

C(n−i)i,∞ = lim

j→∞E[Ci,j |Hn] = E[Ci,∞|Hn]

and the difference with the payment done as at year i will be the required reserve

Ri = C(n−i)i,∞ − Ci,n−i.

One interesting quantity can be the (ultimate) uncertainty,

Var[Ci,∞|Hn] or Var[C(n−i)i,∞ ]

61

Page 62: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

One year uncertainty in Solvency IIIn Solvency II, it is required to study the CDR (claims development result)defined as

∆ni = C

(n−i+1)i,∞ − C(n−i)

i,∞ = CDRi(n),

Note that E[∆ni |Fi,n−i] = 0, but insurers have to estimate (and set a reserve for

that uncertainty) Var[∆ni |Fi,n−i].

62

Page 63: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Chain LadderThe most popular model is the Chain Ladder methodology, assuming that

Ci,j+1 = λj · Ci,j for all i, j = 1, · · · , n.

A natural estimator for λj is

λj =∑n−j

i=1 Ci,j+1∑n−ji=1 Ci,j

for all j = 1, · · · , n− 1.

Then it is natural to predict the non-observed part of the triangle using

Ci,j =[λn+1−i · · · λj−1

]· Ci,n+1−i.

> k <- 1> sum(PAID[1:(nl-k),k+1])/sum(PAID[1:(nl-k),k])[1] 1.380933

63

Page 64: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Chain LadderThose transition factors can be obtained using a simple loop

> LAMBDA <- rep(NA,nc-1)> for(k in 1:(nc-1)){+ LAMBDA[k]=(sum(PAID[1:(nl-k),k+1])/sum(PAID[1:(nl-k),k]))}> LAMBDA[1] 1.380933 1.011433 1.004343 1.001858 1.004735

It is possible to rewrite Ci,j+1 = λj · Ci,j for all i, j = 1, · · · , n, as follows

Ci,j = γj · Ci,∞ or Yi,j = ϕj · Ci,∞.

> (GAMMA <- rev(cumprod(rev(1/LAMBDA))))[1] 0.7081910 0.9779643 0.9891449 0.9934411 0.9952873> (PHI <- c(GAMMA[1],diff(GAMMA)))[1] 0.708191033 0.269773306 0.011180591 0.004296183 0.001846141

64

Page 65: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Chain Ladder

> barplot(PHI,names=1:5)

1 2 3 4 5

0.0

0.2

0.4

0.6

0 1 2 3 4 n

λj 1,38093 1,01143 1,00434 1,00186 1,00474 1,0000γj 70,819% 97,796% 98,914% 99,344% 99,529% 100,000%ϕj 70,819% 26,977% 1,118% 0,430% 0,185% 0,000%

65

Page 66: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Chain LadderNote that we can write

λj =n−j∑i=1

ωi,j · λi,j où ωi,j = Ci,j∑n−ji=1 Ci,j

et λi,j = Ci,j+1

Ci,j.

i.e.

> k <- 1> weighted.mean(x=PAID[,k+1]/PAID[,k],w=PAID[,k],na.rm=TRUE)[1] 1.380933

An alternative is to write that weighted mean as the solution of a weighted leastsquares problem, i.e.

> lm(PAID[,k+1]~0+PAID[,k],weights=1/PAID[,k])$coefficientsPAID[, k]1.380933

The main interest of that expression is that is remains valid when trianglecontains NA’s

66

Page 67: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> LAMBDA <- rep(NA,nc-1)> for(k in 1:(nc-1)){+ LAMBDA[k]=lm(PAID[,k+1]~0+PAID[,k],+ weights=1/PAID[,k])$coefficients}> LAMBDA[1] 1.380933 1.011433 1.004343 1.001858 1.004735

The idea here is to iterate, by column,

> TRIANGLE <- PAID> for(i in 1:(nc-1)){+ TRIANGLE[(nl-i+1):(nl),i+1]=LAMBDA[i]*TRIANGLE[(nl-i+1):(nl),i]}> TRIANGLE

[,1] [,2] [,3] [,4] [,5] [,6][1,] 3209 4372.000 4411.000 4428.000 4435.000 4456.000[2,] 3367 4659.000 4696.000 4720.000 4730.000 4752.397[3,] 3871 5345.000 5398.000 5420.000 5430.072 5455.784[4,] 4239 5917.000 6020.000 6046.147 6057.383 6086.065[5,] 4929 6794.000 6871.672 6901.518 6914.344 6947.084[6,] 5217 7204.327 7286.691 7318.339 7331.939 7366.656

> tail.factor <- 1

67

Page 68: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> chargeultime <- TRIANGLE[,nc]*tail.factor> paiements <- diag(TRIANGLE[,nc:1])> (RESERVES <- chargeultime-paiements)[1] 0.00000 22.39684 35.78388 66.06466 153.08358 2149.65640

Here sum(RESERVES) is equal to 2426.985, which is the best estimate of theamount of required reserves,

> DIAG <- diag(TRIANGLE[,nc:1])> PRODUIT <- c(1,rev(LAMBDA))> sum((cumprod(PRODUIT)-1)*DIAG)[1] 2426.985

It is possible to write a function Chainladder() which return the total amountof reserves

> Chainladder<-function(TR,f=1){+ nc <- ncol(TR); nl <- nrow(TR)+ L <- rep(NA,nc-1)+ for(k in 1:(nc-1)){

68

Page 69: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

+ L[k]=lm(TR[,k+1]~0+ TR[,k],+ weights=1/TR[,k])$coefficients}+ TRc <- TR+ for(i in 1:(nc-1)){+ TRc[(nl-i+1):(nl),i+1]=L[i]* TRc[(nl-i+1):(nl),i]}+ C <- TRc[,nc]*f+ R <- (cumprod(c(1,rev(L)))-1)*diag(TR[,nc:1])+ return(list(charge=C,reserves=R,restot=sum(R)))+ }> Chainladder(PAID)$charge[1] 4456.000 4752.397 5455.784 6086.065 6947.084 7366.656

$reserves[1] 0.00000 22.39684 35.78388 66.06466 153.08358 2149.65640

$restot[1] 2426.985

69

Page 70: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

A stochastic model for paimentsAssume is that (Ci,j)j≥0 is a Markovian process and that there are λ = (λj) andσ = (σ2

j ) such that E(Ci,j+1|Hi+j) = E(Ci,j+1|Ci,j) = λj · Ci,j

Var(Ci,j+1|Hi+j) = Var(Ci,j+1|Ci,j) = σ2j · Ci,j

Under those assumptions,

E(Ci,j+k|Hi+j) = E(Ci,j+k|Ci,j) = λj · λj+1 · · ·λj+k−1Ci,j

Mack (1993) assumes moreover that (Ci,j)j=1,...,n and (Ci′,j)j=1,...,n areindependent for all i 6= i′.

Remark : It is also possible to write

Ci,j+1 = λjCi,j + σj

√Ci,j · εi,j ,

where residuals (εi,j) are i.i.d., centred, with unit variance.

70

Page 71: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

From that expression, one might think of weigthed least squares techniques, toestimation transition factors, i.e. given j, solve

min{

n−j∑i=1

1Ci,j

(Ci,j+1 − λjCi,j)2

}.

Remark : The interpretation of the first assumption is that points C·,j+1 versusC·,j should be on a straight line that goes through 0.

> par(mfrow = c(1, 2))> j=1> plot(PAID[,j],PAID[,j+1],pch=19,cex=1.5)> abline(lm(PAID[,j+1]~0+PAID[,j],weights=1/PAID[,j]))> j=2> plot(PAID[,j],PAID[,j+1],pch=19,cex=1.5)> abline(lm(PAID[,j+1]~0+PAID[,j],weights=1/PAID[,j]))> par(mfrow = c(1, 1))

71

Page 72: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

3500 4000 4500 5000

4500

5000

5500

6000

6500

PAID[, j]

PAID

[, j +

1]

4500 5000 5500 6000 6500

4500

5000

5500

6000

PAID[, j]

PAID

[, j +

1]

Then, a natural idea is to use weighted residuals), εi,j = Ci,j+1 − λjCi,j√Ci,j

.

72

Page 73: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> j=1> RESIDUALS <- (PAID[,j+1]-LAMBDA[j]*PAID[,j])/sqrt(PAID[,j])

Based on those residuals, it is then possible to estimate the volatility parameter

σ2j = 1

n− j − 1

n−j−1∑i=0

(Ci,j+1 − λjCi,j√

Ci,j

)2

or equivalenlty

σ2j = 1

n− j − 1

n−j−1∑i=0

(Ci,j+1

Ci,j− λj

)2· Ci,j

> lambda <- PAID[,2:nc]/PAID[,1:(nc-1)]> SIGMA <- rep(NA,nc-1)> for(i in 1:(nc-1)){+ D <- PAID[,i]*(lambda[,i]-t(rep(LAMBDA[i],nc)))^2+ SIGMA[i] <- 1/(nc-i-1)*sum(D[,1:(nc-i)])}> SIGMA[nc-1] <- min(SIGMA[(nc-3):(nc-2)])> (SIGMA=sqrt(SIGMA))[1] 0.72485777 0.32036422 0.04587297 0.02570564 0.02570564

73

Page 74: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Tail factor, and closure of claim filesAssume that there exists λ∞ > 1 such that

Ci,∞ = Ci,n × λ∞.

A standard technique to extrapolate λi is to consider an exponentialextrapolation (i.e. linear extrapolation on log(λk − 1)’s), then set

λ∞ =∏k≥n

λk.

> logL <- log(LAMBDA-1)> tps <- 1:(nc-1)> modele <- lm(logL~tps)> plot(tps,logL,xlim=c(1,20),ylim=c(-30,0))> abline(modele)> tpsP <- seq(6,1000)> logP <- predict(modele,newdata=data.frame(tps=tpsP))> points(tpsP,logP ,pch=0)> (facteur <- prod(exp(logP)+1))[1] 1.000707

74

Page 75: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

I.e. 0.07% should be added on top of estimated final charge

> chargeultime <- TRIANGLE[,nc]*facteur> paiements <- diag(TRIANGLE[,nc:1])> (RESERVES <- chargeultime-paiements)[1] 3.148948 25.755248 39.639346 70.365538 157.992918 2154.862234> sum(RESERVES)[1] 2451.764

●●

●●

5 10 15 20

−30

−20

−10

0

tps

logL

75

Page 76: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

The ChainLadder package

> library(ChainLadder)> MackChainLadder(PAID)MackChainLadder(Triangle = PAID)

Latest Dev.To.Date Ultimate IBNR Mack.S.E CV(IBNR)1 4,456 1.000 4,456 0.0 0.000 NaN2 4,730 0.995 4,752 22.4 0.639 0.02853 5,420 0.993 5,456 35.8 2.503 0.06994 6,020 0.989 6,086 66.1 5.046 0.07645 6,794 0.978 6,947 153.1 31.332 0.20476 5,217 0.708 7,367 2,149.7 68.449 0.0318

In this first part, we have outputs per accident year, namely reserves Ri in theIBNR, column, e.g. 2,149.7, for present year, and msep(Ri) given by Mack S.E.e.g. 68.449 for present year.

76

Page 77: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

The ChainLadder package

TotalsLatest: 32,637.00Ultimate: 35,063.99IBNR: 2,426.99Mack S.E.: 79.30CV(IBNR): 0.03

Here, the total amount of reserves R is IBNR, qui vaut 2,426.99, as well asmsep(R) given by Mack S.E. i.e. 79.30. Function plot() can also be used onthe output of that function.

77

Page 78: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

The ChainLadder package

1 2 3 4 5 6

Forecast

Latest

Mack Chain Ladder Results

Origin period

Va

lue

01

00

02

00

03

00

04

00

05

00

06

00

07

00

0

1 2 3 4 5 64

00

05

00

06

00

07

00

0

Chain ladder developments by origin period

Development period

Am

ou

nt

1

1 1 1 1 1

2

2 2 2 2

3

3 3 3

4

44

5

5

6

78

Page 79: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

The ChainLadder package

4500 5000 5500 6000 6500

−1.5

−1.0

−0.5

0.0

0.5

1.0

1.5

Fitted

Standardised residuals

1 2 3 4 5

−1.5

−1.0

−0.5

0.0

0.5

1.0

1.5

Origin period

Standardised residuals

79

Page 80: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

The ChainLadder package

1 2 3 4 5

−1.5

−1.0

−0.5

0.0

0.5

1.0

1.5

Calendar period

Standardised residuals

1.0 1.5 2.0 2.5 3.0 3.5 4.0

−1.5

−1.0

−0.5

0.0

0.5

1.0

1.5

Development period

Standardised residuals

80

Page 81: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

One year uncertaintyMerz & Wüthrich (2008) studied the evolution of CDRi(n) with time (n).They proved that

msepcn−1(CDRi(n)) = C2i,∞

(Γi,n + ∆i,n

)where

∆i,n =σ2

n−i+1

λ2n−i+1S

n+1n−i+1

+n−1∑

j=n−i+2

(Cn−j+1,j

Sn+1j

)2σ2

j

λ2jS

nj

and

Γi,n =(

1 +σ2

n−i+1

λ2n−i+1Ci,n−i+1

)n−1∏

j=n−i+2

(1 +

σ2j

λ2j [Sn+1

j ]2Cn−j+1,j

)− 1

Merz & Wüthrich (2008) mentioned that one can approximate the term aboveas

Γi,n ≈σ2

n−i+1

λ2n−i+1Ci,n−i+1

+n−1∑

j=n−i+2

(Cn−j+1,j

Sn+1j

)2σ2

j

λ2jCn−j+1,j

81

Page 82: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

using∏

(1 + ui) ≈ 1 +∑ui, which is valid if ui is small i.e.

σ2j

λ2j

<< Cn−j+1,j .

It is possible to use function MackMerzWuthrich()

> MackMerzWuthrich(PAID)MSEP Mack MSEP MW app. MSEP MW ex.

1 0.0000000 0.000000 0.0000002 0.6393379 1.424131 1.3152923 2.5025153 2.543508 2.5435084 5.0459004 4.476698 4.4766985 31.3319292 30.915407 30.9154076 68.4489667 60.832875 60.832898tot 79.2954414 72.574735 72.572700

82

Page 83: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Regression and claims reservingde Vylder (1978) suggested the following model, for incremental payments

Yi,j ∼ N (αi · βj , σ2), for all i, j,

i.e. an accident year factor αi and a development factor βj It is possible to useleast squares techniques to estimate those factors

(α, β) = argmin

∑i,j

[Yi,j − αi · βj ]2 .

Here normal equations are

αi =∑

j Yi,j · βj∑j β

2j

et βj =∑

i Yi,j · αi∑i α

2i

,

83

Page 84: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Regression and claims reservingAn alternative is to consider an additive model for the logarithm of incrementalpayments

log Yi,j ∼ N (ai + bj , σ2), for all i, j.

> ligne <- rep(1:nl, each=nc); colonne <- rep(1:nc, nl)> INC <- PAID> INC[,2:6] <- PAID[,2:6]-PAID[,1:5]> Y <- as.vector(INC)> lig <- as.factor(ligne)> col <- as.factor(colonne)> reg <- lm(log(Y)~col+lig)

84

Page 85: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> summary(reg)Call:lm(formula = log(Y) ~ col + lig)Coefficients:

Estimate Std. Error t value Pr(>|t|)(Intercept) 7.9471 0.1101 72.188 6.35e-15 ***col2 0.1604 0.1109 1.447 0.17849col3 0.2718 0.1208 2.250 0.04819 *col4 0.5904 0.1342 4.399 0.00134 **col5 0.5535 0.1562 3.543 0.00533 **col6 0.6126 0.2070 2.959 0.01431 *lig2 -0.9674 0.1109 -8.726 5.46e-06 ***lig3 -4.2329 0.1208 -35.038 8.50e-12 ***lig4 -5.0571 0.1342 -37.684 4.13e-12 ***lig5 -5.9031 0.1562 -37.783 4.02e-12 ***lig6 -4.9026 0.2070 -23.685 4.08e-10 ***---Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1

Residual standard error: 0.1753 on 10 degrees of freedom(15 observations deleted due to missingness)

85

Page 86: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Multiple R-squared: 0.9975, Adjusted R-squared: 0.9949F-statistic: 391.7 on 10 and 10 DF, p-value: 1.338e-11

An unbiaised estimator for Yi,j is then Yi,j = exp[ai + bj + σ2/2], i.e.

> sigma <- summary(reg)$sigma> (INCpred <- matrix(exp(logY+sigma^2/2),nl,nc))

[,1] [,2] [,3] [,4] [,5] [,6][1,] 2871.209 1091.278 41.66208 18.27237 7.84125 21.32511[2,] 3370.826 1281.170 48.91167 21.45193 9.20570 25.03588[3,] 3767.972 1432.116 54.67438 23.97937 10.29030 27.98557[4,] 5181.482 1969.357 75.18483 32.97495 14.15059 38.48403[5,] 4994.082 1898.131 72.46559 31.78233 13.63880 37.09216[6,] 5297.767 2013.554 76.87216 33.71498 14.46816 39.34771> sum(exp(logY[is.na(Y)==TRUE]+sigma^2/2))[1] 2481.857

86

Page 87: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

A Poisson Regression on incremental paymentsHachemeister & Stanard (1975), Kremer (1985) and Mack (1991)observed that a log-Poisson regression yield exactly the same amount of reservesas the Chain Ladder technique

> CL <- glm(Y~lig+col, family=poisson)> summary(CL)

Call:glm(formula = Y ~ lig + col, family = poisson)

Coefficients:Estimate Std. Error z value Pr(>|z|)

(Intercept) 8.05697 0.01551 519.426 < 2e-16 ***lig2 -0.96513 0.01359 -70.994 < 2e-16 ***lig3 -4.14853 0.06613 -62.729 < 2e-16 ***lig4 -5.10499 0.12632 -40.413 < 2e-16 ***lig5 -5.94962 0.24279 -24.505 < 2e-16 ***lig6 -5.01244 0.21877 -22.912 < 2e-16 ***col2 0.06440 0.02090 3.081 0.00206 **

87

Page 88: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

col3 0.20242 0.02025 9.995 < 2e-16 ***col4 0.31175 0.01980 15.744 < 2e-16 ***col5 0.44407 0.01933 22.971 < 2e-16 ***col6 0.50271 0.02079 24.179 < 2e-16 ***---Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1

(Dispersion parameter for poisson family taken to be 1)

Null deviance: 46695.269 on 20 degrees of freedomResidual deviance: 30.214 on 10 degrees of freedom

(15 observations deleted due to missingness)AIC: 209.52

Number of Fisher Scoring iterations: 4

88

Page 89: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Here, the prediction is

> Ypred <- predict(CL,newdata=data.frame(lig,col),type="response")> (INCpred <- matrix(Ypred,nl,nc))

[,1] [,2] [,3] [,4] [,5] [,6][1,] 3155.699 1202.110 49.82071 19.14379 8.226405 21.00000[2,] 3365.605 1282.070 53.13460 20.41717 8.773595 22.39684[3,] 3863.737 1471.825 60.99889 23.43904 10.072147 25.71173[4,] 4310.096 1641.858 68.04580 26.14685 11.235734 28.68208[5,] 4919.862 1874.138 77.67250 29.84594 12.825297 32.73985[6,] 5217.000 1987.327 82.36357 31.64850 13.599887 34.71719

which is the same as Chain-Ladder estimate

> sum(Ypred[is.na(Y)==TRUE])[1] 2426.985

89

Page 90: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Oversdispersion and quasiPoisson regressionNote that usually, the Poisson model might be too conservative (in terms ofvariance) since there might be overdispersion of incremental payments.

Remark : N has an overdispersed Poisson distribution with dispersionparameter φ if X/φ ∼ P(λ/φ), i.e. E(X) = λ while Var(X) = φλ

> CL <- glm(Y~lig+col, family=quasipoisson)> summary(CL)

Call:glm(formula = Y ~ lig + col, family = quasipoisson)

Deviance Residuals:Min 1Q Median 3Q Max

-2.3426 -0.4996 0.0000 0.2770 3.9355

Coefficients:Estimate Std. Error t value Pr(>|t|)

(Intercept) 8.05697 0.02769 290.995 < 2e-16 ***

90

Page 91: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

lig2 -0.96513 0.02427 -39.772 2.41e-12 ***lig3 -4.14853 0.11805 -35.142 8.26e-12 ***lig4 -5.10499 0.22548 -22.641 6.36e-10 ***lig5 -5.94962 0.43338 -13.728 8.17e-08 ***lig6 -5.01244 0.39050 -12.836 1.55e-07 ***col2 0.06440 0.03731 1.726 0.115054col3 0.20242 0.03615 5.599 0.000228 ***col4 0.31175 0.03535 8.820 4.96e-06 ***col5 0.44407 0.03451 12.869 1.51e-07 ***col6 0.50271 0.03711 13.546 9.28e-08 ***---Signif. codes: 0 â***â 0.001 â**â 0.01 â*â 0.05 â.â 0.1 â â 1

(Dispersion parameter for quasipoisson family taken to be 3.18623)

Null deviance: 46695.269 on 20 degrees of freedomResidual deviance: 30.214 on 10 degrees of freedom

(15 observations deleted due to missingness)AIC: NA

Number of Fisher Scoring iterations: 4

91

Page 92: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertaintyRecall that in this GLM framework

E(Yi,j |Fn) = µi,j = exp[ηi,j ]

i.e.Yi,j = µi,j = exp[ηi,j ].

Using the delta method we can write

Var(Yi,j) ≈∣∣∣∣∂µi,j

∂ηi,j

∣∣∣∣2 ·Var(ηi,j),

which becomes, with a log link function

∂µi,j

∂ηi,j= µi,j

92

Page 93: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertaintyIn the case of an overdispersed Poisson model (as in Renshaw (1992)),

E(

[Yi,j − Yi,j ]2)≈ φ · µi,j + µ2

i,j · Var(ηi,j)

for the lower part of the triangle. Further,

Cov(Yi,j , Yk,l) ≈ µi,j · µk,l · Cov(ηi,j , ηk,l).

Since R =∑

i+j>n Yi,j , then

E(

[R− R]2)≈

∑i+j>n

φ · µi,j

+ µ′F · Var(ηF ) · µF ,

where µF and ηF are restrictions of µ and η to indices i+ j > n (i.e. lower partof the triangle).

93

Page 94: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertaintyRemark : This expression is only asymptotic.

> p <- nl+nc-1;> phi <- sum(residuals(CL,"pearson")^2)/(sum(is.na(Y)==FALSE)-p)> Sig <- vcov(CL)> X <- model.matrix(glm(Ypred~lig+col, family=quasipoisson))> Cov.eta <- X%*%Sig%*%t(X)> Ypred <-predict(CL,newdata=data.frame(lig,col),type="response")*(is.na(Y)==TRUE)> se2 <- phi * sum(Ypred) + t(Ypred) %*% Cov.eta %*% Ypred> sqrt(se2)

[,1][1,] 131.7726

94

Page 95: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Uncertainty and errors in regression modelsIn regression models, there are two sources in regression models• the process error (due to statistical inference) : error on Y• the variance error (due to the model approximation) : error on Y = Y + ε

●●

8 10 12 14 16 18 20

1020

3040

5060

●●

95

Page 96: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Uncertainty and errors in regression modelsIn regression models, there are two sources in regression models• the process error (due to statistical inference) : error on Y• the variance error (due to the model approximation) : error on Y = Y + ε

●●

8 10 12 14 16 18 20

1020

3040

5060

●●

96

Page 97: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertainty using simulationsIn order to estimate those quantities, consider Person’s residuals

εi,j = Yi,j − Yi,j√Yi,j

.

or, in order to have unit variance,

εi,j =√

n

n− k· Yi,j − Yi,j√

Yi,j

,

where k is the number of parameters in the model (i.e. 2n− 1).

97

Page 98: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertainty using simulations

> (residus=residuals(CL,type="pearson"))1 2 3 4 5 6 7 8

9.49e-01 2.40e-02 1.17e-01 -1.08e+00 1.30e-01 -1.01e-13 -1.13e+00 2.77e-019 10 11 13 14 15 16 19

5.67e-02 8.92e-01 -2.11e-01 -1.53e+00 -2.21e+00 -1.02e+00 4.24e+00 -4.90e-0120 21 25 26 31

7.93e-01 -2.97e-01 -4.28e-01 4.14e-01 -6.20e-15> n=sum(is.na(Y)==FALSE)> k=ncol(PAID)+nrow(PAID)-1> (residus=sqrt(n/(n-k))*residus)

1 2 3 4 5 6 7 81.37e+00 3.49e-02 1.69e-01 -1.57e+00 1.89e-01 -1.46e-13 -1.63e+00 4.02e-01

9 10 11 13 14 15 16 198.22e-02 1.29e+00 -3.06e-01 -2.22e+00 -3.21e+00 -1.48e+00 6.14e+00 -7.10e-01

20 21 25 26 311.15e+00 -4.31e-01 -6.20e-01 6.00e-01 -8.99e-15

98

Page 99: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertainty using simulations

> epsilon <- rep(NA,nl*nc)> epsilon[is.na(Y)==FALSE]=residus> matrix(epsilon,nl,nc)

[,1] [,2] [,3] [,4] [,5] [,6][1,] 1.37e+00 -1.6346 -2.22 -0.710 -0.62 -8.99e-15[2,] 3.49e-02 0.4019 -3.21 1.149 0.60 NA[3,] 1.69e-01 0.0822 -1.48 -0.431 NA NA[4,] -1.57e+00 1.2926 6.14 NA NA NA[5,] 1.89e-01 -0.3059 NA NA NA NA[6,] -1.46e-13 NA NA NA NA NA

99

Page 100: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Generating a pseudo triangle of paymentsIt is then natural to generate errors εb = (εb

i,j), to generate a pseudo triangle ofpayments

Y bi,j = Yi,j +

√Yi,j · εb

i,j .

> par(mfrow = c(1, 2))> hist(residus,breaks=seq(-3.5,6.5,by=.5),col="grey",proba=TRUE)> u <- seq(-4,5,by=.01)> densite <- density(residus)> lines(densite,lwd=2)> lines(u,dnorm(u,mean(residus),sd(residus)),lty=2)> plot(ecdf(residus),xlab="residus",ylab="Fn(residus)")> lines(u,pnorm(u,mean(residus),sd(residus)),lty=2)> Femp <- cumsum(densite$y)/sum(densite$y)> lines(densite$x,Femp,lwd=2)> par(mfrow = c(1, 1))

Bootstrap or parametric model for ε’s ?

100

Page 101: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Generating a pseudo triangle of payments

Histogram of epsilon

epsilon

Den

sity

−5 0 5 10

0.00

0.05

0.10

0.15

0.20

0.25

−5 0 5 10

0.0

0.2

0.4

0.6

0.8

1.0

ecdf(epsilon)

espilon

Cum

ulat

ive

dist

ribut

ion

101

Page 102: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Generating a pseudo triangle of paymentsOnce triangle Y b = (Y b

i,j) is generate, compute Rb, e.g. using Chain Laddertechnique. Variance of Rb will denote the estimation error.

From triangle Y bi,j , prediction for the lower part of the triangle can be derived

Y bi,j . In order to generate scenarios of future payments, generate Poisson variates

with mean Y bi,j ,

> CLsimul1<-function(triangle){+ rpoisson(length(triangle),lambda=triangle)}

But generating Poisson variates might be too conservative,

> (summary(CL)$dispersion)[1] 3.19

102

Page 103: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Generating quasi Poisson variatesFirst idea : a Gamma approximation. Recall that E(Y ) = λ et Var(Y ) = φλ forY ∼ G(α, β) i.e αβ = λ and αβ2 = φλ.

> rqpoisG <- function(n, lambda, phi, roundvalue = TRUE) {+ b <- phi ; a <- lambda/phi ; r <- rgamma(n, shape = a, scale = b)+ if(roundvalue){r<-round(r)}+ return(r)}

Second idea : a Negative Binomial variate, with mean µ and variance µ+ µ2/k,i.e. µ = λ and k = λ(φλ− 1)−1, i.e.

> rqpoisBN = function(n, lambda, phi) {+ mu <- lambda ; k <- mu/(phi * mu - 1) ; r <- rnbinom(n, mu = mu, size = k)+ return(r)}

Then

> CLsimul2<-function(triangle,surdispersion){+ rqpoissonG(length(triangle),lambda=triangle,phi=surdispersion)}

103

Page 104: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Quantifying uncertainty using simulationsAn alternative to generate future payements is use Mack (1993)’s approach, assuggested in England & Verrall (1998).

From λj and σ2j use the following dynamics

Cbi,j+1|Cb

i,j ∼ N (λjCbi,j , σ

2jC

bi,j).

Thus, from a triangle of cumulated payments triangle a vector of transitionvaluers l and a vector of conditional variances s define

> CLsimul3<-function(triangle,l,s){+ m<-nrow(triangle)+ for(i in 2:m){+ triangle[(m-i+2):m,i]<-rnorm(i-1,+ mean=triangle[(m-i+2):m,i-1]*l[i-1],+ sd=sqrt(triangle[(m-i+2):m,i-1])*s[i-1])+ }+ return(triangle) }

104

Page 105: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Then, we run several simulations to generate best estimates and possiblescenarios of payments

> ns<-20000> set.seed(1)> Yp <- predict(CL,type="response",newdata=base)> Rs <- R <- rep(NA,ns)> for(s in 1:ns){+ serreur <- sample(residus,size=nl*nc,replace=TRUE)+ E <- matrix(serreur,nl,nc)+ sY <- matrix(Yp,6,6)+E*sqrt(matrix(Yp,6,6))+ if(min(sY[is.na(Y)==FALSE])>=0){+ sbase <- data.frame(sY=as.vector(sY),lig,col)+ sbase$sY[is.na(Y)==TRUE]=NA+ sreg <- glm(sY~lig+col,+ data=sbase,family=poisson(link="log"))+ sYp <- predict(sreg,type="response",newdata=sbase)+ R[s] <- sum(sYp[is.na(Y)==TRUE])+ sYpscenario <- rqpoisG(36,sYp,phi=3.18623)+ Rs[s] <- sum(sYpscenario[is.na(Y)==TRUE])+ }}

105

Page 106: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Remark : In those simulations, it might be possible to generate negativeincrements

> sort(residus)[1:2]14 13

-3.21 -2.22> sort(sqrt(Yp[is.na(Y)==FALSE]))[1:4]

25 26 19 202.87 2.96 4.38 4.52

But we might assume that those scenarios while yield low reserves (and thus willnot impact high losses quantiles)

> Rna <- R> Rna[is.na(R)==TRUE]<-0> Rsna <- Rs> Rsna[is.na(Rs)==TRUE]<-0> quantile(Rna,c(.75,.95,.99,.995))

75% 95% 99% 99.5%2470 2602 2700 2729

106

Page 107: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> quantile(Rsna,c(.75,.95,.99,.995))75% 95% 99% 99.5%

2496 2645 2759 2800

0.75 0.80 0.85 0.90 0.95 1.00

2500

2600

2700

2800

2900

probabilty

107

Page 108: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

Vector R contains best scenarios, while vector Rs contains scenarios of payments.In order to visualize their distribution, we have to remove NA values

> Rnarm <- R[is.na(R)==FALSE]> Rsnarm <- Rs[is.na(Rs)==FALSE]

Here quantiles are slightly higher

> quantile(Rnarm,c(.75,.95,.99,.995))75% 95% 99% 99.5%

2478 2609 2704 2733> quantile(Rsnarm,c(.75,.95,.99,.995))

75% 95% 99% 99.5%2507 2653 2764 2805

108

Page 109: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

● ●●●●● ●●● ●● ● ●●●● ●● ● ●●● ●● ●●●● ●●●● ●●● ●● ●●● ●●●●●●● ●●● ● ●● ● ●●●●●●● ● ● ●● ●● ●●● ● ●● ● ●●● ●●● ●●●● ●●● ●●●● ● ●● ●● ●● ● ●●●● ●● ● ●● ●● ●● ●● ●● ● ●●● ● ●●●● ●●● ● ●● ●●●●●● ●● ●● ● ● ●●● ●● ● ●●●●●●● ●● ●● ●●● ●● ●● ●● ●● ●●●● ●●● ●● ●●●● ●● ●● ●●● ●●●● ●● ●● ●●● ● ● ●●●● ●●● ● ●●● ●● ● ●● ●● ●● ●● ● ● ●●● ●●● ●● ●●● ●● ● ● ●● ●● ●●●● ● ●●● ● ●●● ●● ● ●● ●●● ●●●● ●●●● ● ●●● ●●●● ● ●● ●● ● ●● ●●● ●● ●● ●● ●● ●● ●●● ●●● ●● ●● ●●● ●● ●●● ●●● ●● ●● ●●● ●●●● ●●● ●●● ●●●● ●● ●● ●●● ●● ●●● ●● ●● ●●● ●● ●●●● ● ●●● ●● ●● ●●● ●●●● ● ● ●● ●●●●●●● ● ●● ●● ●●● ●●● ●● ●●● ●●● ●● ●●● ●●● ●● ●●● ●● ●●●●●● ●●●● ● ●●● ●●●● ●● ●●●● ●●● ● ● ●●● ●● ●●●● ● ●●● ●● ● ●● ●● ●● ●● ●● ●●● ●●● ●●● ●● ● ●● ●● ● ●● ●●● ● ● ●●● ●● ●

●● ● ● ●●●● ●●●● ●● ●● ●● ●●● ● ● ●● ●● ●●●● ●● ●●● ●● ●● ●● ● ●●● ●● ● ●●● ●● ●●●●● ● ●●● ●●●● ● ●●●● ●● ●●● ●● ●●● ●● ●●● ●● ●●●● ● ●● ●●● ●● ●●● ●●●●●● ●● ●●● ●●● ● ●● ● ●●●● ●●● ●●● ●● ● ●● ●●● ●● ● ●● ● ● ●●●●● ●● ●●● ●● ●● ●● ● ●●● ●● ● ● ●● ●●●● ● ●● ●● ● ●●●●● ●●● ● ●● ●● ●● ● ●● ● ●●●● ● ●●●● ●●● ● ●●●● ● ●●●● ●●●●

Bes

t Est

imat

e

2000 2200 2400 2600 2800 3000

> plot(density(Rnarm),col="grey",main="")> lines(density(Rsnarm),lwd=2)> boxplot(cbind(Rnarm,Rsnarm),+ col=c("grey","black"),horizontal=TRUE)

109

Page 110: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

2200 2400 2600 2800 3000

0.00

00.

001

0.00

20.

003

0.00

4

N = 18079 Bandwidth = 11.07

Den

sity

Those quantities are quite similar to the one obtained using bootChainLadderfrom library(ChainLadder),

110

Page 111: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> BootChainLadder(PAID,20000,"od.pois")BootChainLadder(Triangle = PAID, R = 20000, process.distr = "od.pois")

Latest Mean Ultimate Mean IBNR SD IBNR IBNR 75% IBNR 95%1 4,456 4,456 0.0 0.0 0 02 4,730 4,752 22.1 12.0 28 443 5,420 5,455 35.3 15.3 44 634 6,020 6,085 65.5 19.8 77 1015 6,794 6,946 152.4 28.6 170 2036 5,217 7,363 2,146.2 111.6 2,216 2,337

TotalsLatest: 32,637Mean Ultimate: 35,059Mean IBNR: 2,422SD IBNR: 132Total IBNR 75%: 2,504Total IBNR 95%: 2,651

111

Page 112: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

PRACTICALS

112

Page 113: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

> OthLiabData=read.csv(+ "http://www.casact.org/research/reserve_data/othliab_pos.csv",+ header=TRUE, sep=",")> library(plyr)> OL=SumData=ddply(OthLiabData,.(AccidentYear,DevelopmentYear,+ DevelopmentLag),summarise,IncurLoss=sum(IncurLoss_H1-BulkLoss_H1),+ CumPaidLoss=sum(CumPaidLoss_H1), EarnedPremDIR=+ sum(EarnedPremDIR_H1))> library(ChainLadder)> LossTri <- as.triangle(OL, origin="AccidentYear",+ dev="DevelopmentLag", value="IncurLoss")> Year=as.triangle(OL, origin="AccidentYear",+ dev="DevelopmentLag", value="DevelopmentYear")> TRIANGLE=LossTri> TRIANGLE[Year>1997]=NA

113

Page 114: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

– suggest an estimation for the amount of reserves, all years.– using a (quasi)Poisson regression, propose a VaR with level 99.5% for future

payments, for all claims that already occurred.

114

Page 115: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

To go further, some (standard) references

Wüthrich, M. & Merz, M. (2008)Stochastic Claims Reserving Methods in InsuranceWiley Finance Series

Frees, J.E. (2007)Regression Modeling with Actuarialand Financial ApplicationsCambridge University Press

115

Page 116: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

To go further, loss distributions and credibility

Krugman, S.A., Panjer, H.H. & Willmot, G.E. (1998)Loss ModelsWiley Series in Probability

Bühlmann, H. & Gisler, A. (2005)A Course in Credibility Theory and its ApplicationsSpringer Verlag

116

Page 117: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

To go further, regression & GLMs

Kaas, R., Goovaerts, M, Dhaene, J & Denuit, M. (2009)Modern Actuarial Risk TheorySpringer Verlag

de Jong, P. & Heller, G.Z. (2008)Generalized Linear Models for Insurance DataCambridge University Press

117

Page 118: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

To go further, ratemaking

Denuit, M., Marechal, X., Pitrebois, S.& Walhin, J.F. (2007)Actuarial Modelling of Claim Counts :Risk Classification, Credibility & Bonus-Malus SystemsJohn Wiley & Sons

Ohlsson E. & Johansson, B. (2010)Non-Life Insurance Pricing withGeneralized Linear ModelsSpringer Verlag

118

Page 119: Heat wave modeling, Lyon 2011freakonometrics.free.fr/rmetrics.pdf · Arthur CHARPENTIER, Actuarial science with R Actuarialmodelsforlifeinsurance? Let (x) denotealifeaged x,with x

Arthur CHARPENTIER, Actuarial science with R

To go further, on demography

Pitacco, E., Denuit, M., Haberman, S.& Olivieri, A. (2008) Modeling LongevityDynamics for Pensions and Annuity BusinessOxford University Press

Schoen, R. (2007)Dynamic Population ModelsSpringer Verlag

119