The ilc package: Iterative Lee-Carter...The ilc package: Iterative Lee-Carter Han Lin Shang Research...
Transcript of The ilc package: Iterative Lee-Carter...The ilc package: Iterative Lee-Carter Han Lin Shang Research...
The ilc package: Iterative Lee-Carter
Han Lin Shang
Research School of Finance, Actuarial Studies and Applied Statistics,Australian National University
Presentation prepared for the useR2015Aalborg, 1st July 2015
Acknowledgement: Zoltan Butt and Steven Haberman (Cass Business School,
London)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
1 / 26
Motivating example: UK male log mortality rates
Force of mortality is
µx,t = mx,t =yx,tex,t
where yx,t and ex,t represent the number of deaths and correspondingcentral exposure for any given age group at year t. Obtain a n× p matrixto represent age and time dimensions
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
2 / 26
Lee-Carter model under Gaussian error
LC model is defined as
ln(mx,t) = αx + βxκt + εx,t
1 αx represents a constant age-specific pattern
2 κt measures the trend in mortality over time
3 βx measures the age-specific deviations of mortality change from theoverall trend
4 εx,t are assumed to be N(0, σ2
)random effects by age and time
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
3 / 26
Lee-Carter model under Gaussian error
LC model is defined as
ln(mx,t) = αx + βxκt + εx,t
1 αx represents a constant age-specific pattern
2 κt measures the trend in mortality over time
3 βx measures the age-specific deviations of mortality change from theoverall trend
4 εx,t are assumed to be N(0, σ2
)random effects by age and time
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
3 / 26
Lee-Carter model under Gaussian error
LC model is defined as
ln(mx,t) = αx + βxκt + εx,t
1 αx represents a constant age-specific pattern
2 κt measures the trend in mortality over time
3 βx measures the age-specific deviations of mortality change from theoverall trend
4 εx,t are assumed to be N(0, σ2
)random effects by age and time
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
3 / 26
Lee-Carter model under Gaussian error
LC model is defined as
ln(mx,t) = αx + βxκt + εx,t
1 αx represents a constant age-specific pattern
2 κt measures the trend in mortality over time
3 βx measures the age-specific deviations of mortality change from theoverall trend
4 εx,t are assumed to be N(0, σ2
)random effects by age and time
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
3 / 26
Objectives of methods
Implement an iterative regression method for analysing age-periodmortality rates via generalised Lee-Carter (LC) model
Use Generalised Linear Model (GLM) model (Renshaw and Haberman2006)
Develop and implement a stratified LC model for the measurement ofthe additive effect on the log scale of an explanatory factor (otherthan age and time)
Produce forecasts of age-specific mortality rates and life expectancy
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
4 / 26
Objectives of methods
Implement an iterative regression method for analysing age-periodmortality rates via generalised Lee-Carter (LC) model
Use Generalised Linear Model (GLM) model (Renshaw and Haberman2006)
Develop and implement a stratified LC model for the measurement ofthe additive effect on the log scale of an explanatory factor (otherthan age and time)
Produce forecasts of age-specific mortality rates and life expectancy
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
4 / 26
Objectives of methods
Implement an iterative regression method for analysing age-periodmortality rates via generalised Lee-Carter (LC) model
Use Generalised Linear Model (GLM) model (Renshaw and Haberman2006)
Develop and implement a stratified LC model for the measurement ofthe additive effect on the log scale of an explanatory factor (otherthan age and time)
Produce forecasts of age-specific mortality rates and life expectancy
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
4 / 26
Objectives of methods
Implement an iterative regression method for analysing age-periodmortality rates via generalised Lee-Carter (LC) model
Use Generalised Linear Model (GLM) model (Renshaw and Haberman2006)
Develop and implement a stratified LC model for the measurement ofthe additive effect on the log scale of an explanatory factor (otherthan age and time)
Produce forecasts of age-specific mortality rates and life expectancy
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
4 / 26
Objectives of ilc package
Extend LC model based on the Gaussian error structure to Poisson
Instead of singular value decomposition, consider a regression modelbased on Poisson likelihood maximisation
ilc package contains methods for the analysis of a class of sixlog-linear models (capturing age, period, cohort) in the GLM withPoisson errors
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
5 / 26
Objectives of ilc package
Extend LC model based on the Gaussian error structure to Poisson
Instead of singular value decomposition, consider a regression modelbased on Poisson likelihood maximisation
ilc package contains methods for the analysis of a class of sixlog-linear models (capturing age, period, cohort) in the GLM withPoisson errors
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
5 / 26
Objectives of ilc package
Extend LC model based on the Gaussian error structure to Poisson
Instead of singular value decomposition, consider a regression modelbased on Poisson likelihood maximisation
ilc package contains methods for the analysis of a class of sixlog-linear models (capturing age, period, cohort) in the GLM withPoisson errors
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
5 / 26
Features of the ilc package
1 To assess goodness of fit of the regression, estimation routinessupport a range of residual diagnostic plots
2 Allows preliminary data corrections, to replace missing data cells, butalso to eliminate potential outliers that might result from datainaccuracies
3 Includes two simple methods of “closing-out” produces to correct theoriginal data at very old ages before the application of the model
4 ilc package integrates with the demography and forecast packages
5 ilc package has improved inspection and graphical visualisation ofmortality data and regression output
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
6 / 26
Features of the ilc package
1 To assess goodness of fit of the regression, estimation routinessupport a range of residual diagnostic plots
2 Allows preliminary data corrections, to replace missing data cells, butalso to eliminate potential outliers that might result from datainaccuracies
3 Includes two simple methods of “closing-out” produces to correct theoriginal data at very old ages before the application of the model
4 ilc package integrates with the demography and forecast packages
5 ilc package has improved inspection and graphical visualisation ofmortality data and regression output
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
6 / 26
Features of the ilc package
1 To assess goodness of fit of the regression, estimation routinessupport a range of residual diagnostic plots
2 Allows preliminary data corrections, to replace missing data cells, butalso to eliminate potential outliers that might result from datainaccuracies
3 Includes two simple methods of “closing-out” produces to correct theoriginal data at very old ages before the application of the model
4 ilc package integrates with the demography and forecast packages
5 ilc package has improved inspection and graphical visualisation ofmortality data and regression output
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
6 / 26
Features of the ilc package
1 To assess goodness of fit of the regression, estimation routinessupport a range of residual diagnostic plots
2 Allows preliminary data corrections, to replace missing data cells, butalso to eliminate potential outliers that might result from datainaccuracies
3 Includes two simple methods of “closing-out” produces to correct theoriginal data at very old ages before the application of the model
4 ilc package integrates with the demography and forecast packages
5 ilc package has improved inspection and graphical visualisation ofmortality data and regression output
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
6 / 26
Features of the ilc package
1 To assess goodness of fit of the regression, estimation routinessupport a range of residual diagnostic plots
2 Allows preliminary data corrections, to replace missing data cells, butalso to eliminate potential outliers that might result from datainaccuracies
3 Includes two simple methods of “closing-out” produces to correct theoriginal data at very old ages before the application of the model
4 ilc package integrates with the demography and forecast packages
5 ilc package has improved inspection and graphical visualisation ofmortality data and regression output
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
6 / 26
Lee-Carter model under Poisson error
1 LC parameters can be estimated by maximum likelihood methodsbased on Poisson error distribution
2 Assuming that age- and period-specific number of deaths areindependent realisations from a Poisson distribution with parameters
E[Yx,t] = ex,tµx,t, Var[Yx,t] = φE[Yx,t]
where φ is a measure of over-dispersion to allow for heterogeneity
3 GLM model of the response variable Yx,t with log-link and non-linearparameterized predictor:
ηx,t = ln(yx,t) = ln(ex,t)︸ ︷︷ ︸offset
+αx + βxκt
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
7 / 26
Lee-Carter model under Poisson error
1 LC parameters can be estimated by maximum likelihood methodsbased on Poisson error distribution
2 Assuming that age- and period-specific number of deaths areindependent realisations from a Poisson distribution with parameters
E[Yx,t] = ex,tµx,t, Var[Yx,t] = φE[Yx,t]
where φ is a measure of over-dispersion to allow for heterogeneity
3 GLM model of the response variable Yx,t with log-link and non-linearparameterized predictor:
ηx,t = ln(yx,t) = ln(ex,t)︸ ︷︷ ︸offset
+αx + βxκt
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
7 / 26
Lee-Carter model under Poisson error
1 LC parameters can be estimated by maximum likelihood methodsbased on Poisson error distribution
2 Assuming that age- and period-specific number of deaths areindependent realisations from a Poisson distribution with parameters
E[Yx,t] = ex,tµx,t, Var[Yx,t] = φE[Yx,t]
where φ is a measure of over-dispersion to allow for heterogeneity
3 GLM model of the response variable Yx,t with log-link and non-linearparameterized predictor:
ηx,t = ln(yx,t) = ln(ex,t)︸ ︷︷ ︸offset
+αx + βxκt
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
7 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx
2 Given βx, update αx and κt3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt
3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt3 Given κt, update αx and βx
4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)
5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Estimation algorithm
1 Maximum likelihood point estimates under the GLM approach areobtained at the minimum value of the total deviation, given by
D (yx,t, yx,t) =∑x,t
dev(x, t) =∑x,t
2ωx,t
{yx,t ln
yx,tyx,t
− (yx,t − yx,t)
}(1)
where dev(x, t) are the deviance residuals that depend on a set ofprior weights ωx,t
2 Resort to an iterative Newton-Raphson method applied to thedeviance function (1) . We use the iterative procedure:
1 Set starting values βx2 Given βx, update αx and κt3 Given κt, update αx and βx4 Compute D(yx,t, yx,t)5 Repeat the updating cycle; stop when D(yx,t, yx,t) converges
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
8 / 26
Inclusion of cohort effect
1 Basic LC model can be extended to include an additional bilinearterm, containing a second period effect or a cohort effect
2 Force of mortality by a generalised structure is given as
µx,t = exp(αx + β(0)x lt−x + β(1)x κt
)where αx: main age profile; lt−x: cohort effect; κt: period
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
9 / 26
Inclusion of cohort effect
1 Basic LC model can be extended to include an additional bilinearterm, containing a second period effect or a cohort effect
2 Force of mortality by a generalised structure is given as
µx,t = exp(αx + β(0)x lt−x + β(1)x κt
)where αx: main age profile; lt−x: cohort effect; κt: period
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
9 / 26
Lee-Carter model with additional covariates
1 Additional factor depends on the size and nature of the mortalityexperience, such as geographical, socio-economic or race differences
2 Consider a cross-classified mortality experience observed over age x,period t and an extra variate g made up of (k × n× l) data cells
3 Stratified LC model is given by
ηx,t,g = ln(yx,t,g) = ln(ex,t,g)︸ ︷︷ ︸offset
+αx + αg + βxκt,
where αg measures the relative differences between the age-specificlog mortality profiles among subgroups defined by the extra variate g
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
10 / 26
Lee-Carter model with additional covariates
1 Additional factor depends on the size and nature of the mortalityexperience, such as geographical, socio-economic or race differences
2 Consider a cross-classified mortality experience observed over age x,period t and an extra variate g made up of (k × n× l) data cells
3 Stratified LC model is given by
ηx,t,g = ln(yx,t,g) = ln(ex,t,g)︸ ︷︷ ︸offset
+αx + αg + βxκt,
where αg measures the relative differences between the age-specificlog mortality profiles among subgroups defined by the extra variate g
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
10 / 26
Lee-Carter model with additional covariates
1 Additional factor depends on the size and nature of the mortalityexperience, such as geographical, socio-economic or race differences
2 Consider a cross-classified mortality experience observed over age x,period t and an extra variate g made up of (k × n× l) data cells
3 Stratified LC model is given by
ηx,t,g = ln(yx,t,g) = ln(ex,t,g)︸ ︷︷ ︸offset
+αx + αg + βxκt,
where αg measures the relative differences between the age-specificlog mortality profiles among subgroups defined by the extra variate g
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
10 / 26
Forecasting
1 Forecasting mortality in the LC family of models is based on timeseries prediction of the calendar time dependent parameters (lt−x, κt)
2 Mortality rate forecasts can be written as
µx,n+h = exp(αx + β(0)x ln+h−x + β(1)x κn+h
)where ln+h−x and κn+h represent the forecast cohort and periodeffects
3 Random walk with drift, ARIMA(0,1,0), is used to forecast periodeffect (κt), expressed as
κt = κt−1 + d+ et
where d measures the drift and et represents the white noise
4 In the cohort effects, forecasts revert to the fitted parameters when hfalls within the available data range
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
11 / 26
Forecasting
1 Forecasting mortality in the LC family of models is based on timeseries prediction of the calendar time dependent parameters (lt−x, κt)
2 Mortality rate forecasts can be written as
µx,n+h = exp(αx + β(0)x ln+h−x + β(1)x κn+h
)where ln+h−x and κn+h represent the forecast cohort and periodeffects
3 Random walk with drift, ARIMA(0,1,0), is used to forecast periodeffect (κt), expressed as
κt = κt−1 + d+ et
where d measures the drift and et represents the white noise
4 In the cohort effects, forecasts revert to the fitted parameters when hfalls within the available data range
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
11 / 26
Forecasting
1 Forecasting mortality in the LC family of models is based on timeseries prediction of the calendar time dependent parameters (lt−x, κt)
2 Mortality rate forecasts can be written as
µx,n+h = exp(αx + β(0)x ln+h−x + β(1)x κn+h
)where ln+h−x and κn+h represent the forecast cohort and periodeffects
3 Random walk with drift, ARIMA(0,1,0), is used to forecast periodeffect (κt), expressed as
κt = κt−1 + d+ et
where d measures the drift and et represents the white noise
4 In the cohort effects, forecasts revert to the fitted parameters when hfalls within the available data range
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
11 / 26
Forecasting
1 Forecasting mortality in the LC family of models is based on timeseries prediction of the calendar time dependent parameters (lt−x, κt)
2 Mortality rate forecasts can be written as
µx,n+h = exp(αx + β(0)x ln+h−x + β(1)x κn+h
)where ln+h−x and κn+h represent the forecast cohort and periodeffects
3 Random walk with drift, ARIMA(0,1,0), is used to forecast periodeffect (κt), expressed as
κt = κt−1 + d+ et
where d measures the drift and et represents the white noise
4 In the cohort effects, forecasts revert to the fitted parameters when hfalls within the available data range
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
11 / 26
CMI data
1 CMI data contains the mortality experience of male life officepensioners retiring at or after normal retirement age
2 Data is made up of observed central exposure and deaths for ages50-108 from 1983 to 2003
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
12 / 26
CMI data
1 CMI data contains the mortality experience of male life officepensioners retiring at or after normal retirement age
2 Data is made up of observed central exposure and deaths for ages50-108 from 1983 to 2003
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
12 / 26
R demo of explanatory plots
1 Plot mortality rates, population-at-risk, death counts for any agegroup and year
>insp.dd(dd.cmi.pens,age=50:80,year=1985:1990)
>insp.dd(dd.cmi.pens,what=‘pop’,age=70:100,year=1988:1993)
>insp.dd(dd.cmi.pens,what=‘deaths’,age=seq(100),
year=1980:2010)
2 Produce simple plots (i.e., without legend) of log- or untransformedrates:
>plot(dd.cmi.pens)
>plot(dd.cmi.pens,transform=FALSE)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
13 / 26
R demo of explanatory plots
1 Plot mortality rates, population-at-risk, death counts for any agegroup and year
>insp.dd(dd.cmi.pens,age=50:80,year=1985:1990)
>insp.dd(dd.cmi.pens,what=‘pop’,age=70:100,year=1988:1993)
>insp.dd(dd.cmi.pens,what=‘deaths’,age=seq(100),
year=1980:2010)
2 Produce simple plots (i.e., without legend) of log- or untransformedrates:
>plot(dd.cmi.pens)
>plot(dd.cmi.pens,transform=FALSE)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
13 / 26
R demo of explanatory plots
1 Produce annotated plots of log or original rates:
>plot_dd(dd.cmi.pens, xlim=c(40, 110),
lpar = list(x.int = -0.2, y.int = 0.9, cex = 0.85))
>plot_dd(dd.cmi.pens, year=1985:1995, transform=FALSE)
>plot_dd(dd.cmi.pens, year=1995:1997, transform=FALSE,
lty=1:3, col=1:3)
2 Deal with missing data
# without correction of empty cells
>tmp.d = extract.deaths(dd.cmi.pens, ages=55:100)
# empty cells are filled using perk model
>tmp.d = extract.deaths(dd.cmi.pens, ages=55:100,
fill=‘perks’)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
14 / 26
R demo of explanatory plots
1 Produce annotated plots of log or original rates:
>plot_dd(dd.cmi.pens, xlim=c(40, 110),
lpar = list(x.int = -0.2, y.int = 0.9, cex = 0.85))
>plot_dd(dd.cmi.pens, year=1985:1995, transform=FALSE)
>plot_dd(dd.cmi.pens, year=1995:1997, transform=FALSE,
lty=1:3, col=1:3)
2 Deal with missing data
# without correction of empty cells
>tmp.d = extract.deaths(dd.cmi.pens, ages=55:100)
# empty cells are filled using perk model
>tmp.d = extract.deaths(dd.cmi.pens, ages=55:100,
fill=‘perks’)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
14 / 26
Explanatory plots: dealing with missing values
50 60 70 80 90 100 110
−6
−4
−2
0
CMI: male death rates (1983−2003)
Age
Log
deat
h ra
te
40 50 60 70 80 90 100 110
−6
−4
−2
0
CMI: male death rates (1983−2003)
AgeLo
g de
ath
rate
Year198319841985198619871988198919901991199219931994199519961997199819992000200120022003
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
15 / 26
R demo for estimation of LC model
Estimate the base LC model with Poisson errors
>mod6 = lca.rh(dd.cmi.pens, mod = ‘lc’, interpolate=TRUE)
>coef(mod6); plot(mod6)
>fitted_plot(mod6); residual_plot(mod6)
50 60 70 80 90 100
−5
−3
Age
α x
Main effects
50 60 70 80 90 100
0.00
0.06
Age
β x(1)
Interaction effects
Calendar year
κ t (p
oiss
on)
1985 1990 1995 2000
−15
−5
5
Period effects
Standard LC Regression for CMI [male]
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
16 / 26
Plots of fitted models
>forc6 = forecast(mod6, h = 20, jump = ‘fit’, level = 90,
shift=FALSE)
>plot_dd(forc6, xlim=c(45,100), lpar=list(x.int=-0.2,
y.int=0.9, cex=0.95))
>le6 = life.expectancy(forc6, age=60)
>flc.plot(mod6, at=60, h=30, level=90)
Forecasts from Random walk with drift
Year
κ t (p
oiss
on)
1990 2000 2010 2020 2030
−80
−60
−40
−20
020
CMI : male
Year
le60
1990 2000 2010 2020 2030
2025
3035
4045
ObsFitFcast
Forecasts of Life Expectancy at age 60CMI : male
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
17 / 26
R demo for estimation of age-period-cohort model
>mod1 = lca.rh(dd.cmi.pens, age=60:95, mod = "m",
restype=‘deviance’, dec.conv=3)
>coef(mod1)
>plot(mod1)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
18 / 26
Age-period-cohort plot
60 70 80 90−4.
5−
3.5
−2.
5−
1.5
Age
α xMain age effects
60 70 80 90
0.02
00.
035
0.05
0
Age
β x(1)
Period Interaction effects
60 70 80 90
−0.
040.
000.
04
Age
β x(0)
Cohort Interaction effects
Calendar year
κ t (p
oiss
on)
1985 1990 1995 2000
−15
−10
−5
0
Period effects
Year of birth
ι t−x (p
oiss
on)
1890 1900 1910 1920 1930 1940
−4
02
46
8
Cohort effects
Age−Period−Cohort LC Regression for CMI [male]
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
19 / 26
R demo for stratified LC model
1 For stratified LC model, ilc package introduces a special class of dataobject that holds information about the grouping factors andaggregate data of number of deaths, central exposures and mortalityrates
2 Taking the CMI experience as the base data, produce a randomlystratified mortality data
>rfp.cmi = dd.rfp(dd.cmi.pens, rfp = c(0.5,1.2,-0.7,2.5))
>matplot(rfp.cmi$age, rfp.cmi$pop[,,1], type=‘l’,
xlab=‘Age’, ylab=‘Ec’, main = ‘Base Level’)
>matplot(rfp.cmi$age, rfp.cmi$pop[,,2], type=‘l’,
xlab=‘Age’, ylab=‘Ec’, main = ‘Base Level’)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
20 / 26
R demo for stratified LC model
1 For stratified LC model, ilc package introduces a special class of dataobject that holds information about the grouping factors andaggregate data of number of deaths, central exposures and mortalityrates
2 Taking the CMI experience as the base data, produce a randomlystratified mortality data
>rfp.cmi = dd.rfp(dd.cmi.pens, rfp = c(0.5,1.2,-0.7,2.5))
>matplot(rfp.cmi$age, rfp.cmi$pop[,,1], type=‘l’,
xlab=‘Age’, ylab=‘Ec’, main = ‘Base Level’)
>matplot(rfp.cmi$age, rfp.cmi$pop[,,2], type=‘l’,
xlab=‘Age’, ylab=‘Ec’, main = ‘Base Level’)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
20 / 26
Plots of stratified Lee-Carter
50 70 90 110
050
0015
000
2500
0
Base Level
Age
Ec
50 70 90 110
050
0015
000
2500
0
Level a
Age
Ec
50 70 90 110
050
0015
000
2500
0
Level b
Age
Ec
50 70 90 110
050
0015
000
2500
0
Level c
Age
Ec
50 70 90 110
050
0015
000
2500
0
Level d
Age
Ec
50 70 90 110
−6
−4
−2
0
Base Level
Age
log(
mu)
50 70 90 110
−6
−4
−2
0
Level a
Age
log(
mu)
50 70 90 110
−4
−2
02
Level b
Age
log(
mu)
50 70 90 110
−6
−5
−4
−3
−2
−1
0
Level c
Agelo
g(m
u)
50 70 90 110
−4
−2
02
Level d
Age
log(
mu)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
21 / 26
R demo for estimating and forecasting of stratified LCmodel
>rfp.cmi = dd.rfp(dd.cmi.pens, rfp = c(0.5, 1.2, -0.7, 2.5))
>mod6e = elca.rh(rfp.cmi, age=50:100, interpolate=TRUE,
dec.conv=3, verbose=TRUE)
>coef(mod6e)
>mod6ef = forecast.lca(mod6e, h = 20, level = 90, jump=‘fit’,
shift=FALSE)
>plot(mod6ef$kt, ylab=‘kt’, xlab=‘Year’)
>matfle.plot(mod6e$lca, mod6, at=60, label=‘RFP CMI’, h=20)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
22 / 26
Plot of forecast life expectancy
Forecasts from Random walk with drift
Year
kt
1990 2000 2010 2020
−60
−40
−20
020
1985 1995 2005 2015 20255
1015
2025
3035
Year
le60
+++++++++
+++++
+++++++
++++++
++++++
++++++
++
d
base
a
b
c
+ dbaseabc
Forecasts of Life Expectancy at age 60
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
23 / 26
Conclusion
1 ilc package implements the Lee-Carter model with Gaussian andPoisson errors
2 ilc package implements additional five models discussed in Renshawand Haberman (2006)
3 Stratified Lee-Carter model allows users to include additionalcovariates (other than age and time)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
24 / 26
Conclusion
1 ilc package implements the Lee-Carter model with Gaussian andPoisson errors
2 ilc package implements additional five models discussed in Renshawand Haberman (2006)
3 Stratified Lee-Carter model allows users to include additionalcovariates (other than age and time)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
24 / 26
Conclusion
1 ilc package implements the Lee-Carter model with Gaussian andPoisson errors
2 ilc package implements additional five models discussed in Renshawand Haberman (2006)
3 Stratified Lee-Carter model allows users to include additionalcovariates (other than age and time)
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
24 / 26
References
Renshaw, A. E., and S. Haberman, 2003. Lee-Carter mortalityforecasting with age-specific enhancement. Insurance: Mathematicsand Economics, 33, 255-272.
Hyndman, R. J., and H. L. Shang, 2010. Rainbow plots, bagplots andboxplot for functional data, Journal of Computational and GraphicalStatistics, 19(1), 29-45.
H. L. Shang, 2011. rainbow: An R package for visualizing functionaltime series, The R Journal, 3(2), 54-59.
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
25 / 26
References
Renshaw, A. E., and S. Haberman, 2003. Lee-Carter mortalityforecasting with age-specific enhancement. Insurance: Mathematicsand Economics, 33, 255-272.
Hyndman, R. J., and H. L. Shang, 2010. Rainbow plots, bagplots andboxplot for functional data, Journal of Computational and GraphicalStatistics, 19(1), 29-45.
H. L. Shang, 2011. rainbow: An R package for visualizing functionaltime series, The R Journal, 3(2), 54-59.
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
25 / 26
References
Renshaw, A. E., and S. Haberman, 2003. Lee-Carter mortalityforecasting with age-specific enhancement. Insurance: Mathematicsand Economics, 33, 255-272.
Hyndman, R. J., and H. L. Shang, 2010. Rainbow plots, bagplots andboxplot for functional data, Journal of Computational and GraphicalStatistics, 19(1), 29-45.
H. L. Shang, 2011. rainbow: An R package for visualizing functionaltime series, The R Journal, 3(2), 54-59.
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
25 / 26
Thank you! · Tak
Objectives of methods and ilc packageModel, estimation and forecasting
DemonstrationConclusion
26 / 26