do.BBackTesting: Perform Out-of-Sample Testing of Mortality Forecasts Over...

Description Usage Arguments Author(s) See Also Examples

View source: R/do_BBackTesting.R

Description

Perform Out-of-Sample Testing of Mortality Forecasts Over Multiple Time Periods

Usage

1
2
3
do.BBackTesting(data, data.B = NULL, x, y, data.in = c("qx", "mx",
  "dx", "lx"), models, strategy = c(f = 20, h = 20, s = 2), level = 95,
  jumpchoice = c("actual", "fit"), verbose = TRUE, ...)

Arguments

data

A data.frame or a matrix containing mortality data with ages x as row and time y as column.

data.B

A data.frame or a matrix containing mortality data for the benchmark population. This dataset is needed only in the coherent mortality models (e.g. LiLee, OeppenC). Must be the same format as in data;

x

Numerical vector indicating the ages in input data. Optional. Default: NULL.

y

Numerical vector indicating the years in input data. Optional. Default: NULL.

data.in

Specify the type of input data. Various life table indices are accepted: "qx", "mx", "dx", "lx".

models

One or several mortality models to be estimated. The following options are available:

  • "MRW" – The Multivariate Random-Walk (w/o Drift);

  • "MRWD" – The Multivariate Random-Walk with Drift;

  • "LeeCarter" – The Lee-Carter Mortality Model;

  • "LiLee" – The Li-Lee Mortality Model;

  • "HyndmanUllah" – The Hyndman-Ullah Mortality Model;

  • "RenshawHaberman" – The Renshaw-Haberman Mortality Model;

  • "Oeppen" – The Oeppen Mortality Model;

  • "OeppenC" – The Coherent Oeppen Mortality Model;

  • "MEM2" – The Maximum Entropy Mortality Model of order 2;

  • "MEM3" – The Maximum Entropy Mortality Model of order 3;

  • "MEM4" – The Maximum Entropy Mortality Model of order 4;

  • "MEM5" – The Maximum Entropy Mortality Model of order 5;

  • "MEM6" – The Maximum Entropy Mortality Model of order 6;

  • "MEM7" – The Maximum Entropy Mortality Model of order 7;

strategy

Fitting-Forecasting strategy. Format: numerical vector. The strategy c(f, h, s) consists in f number of years to use in fitting, h number of years to forecast and the step s to roll the evaluation window.

level

Significance level of the confidence interval.

jumpchoice

Method used for computation of jumpchoice. Possibilities: "actual" (use actual rates from final year) and "fit" (use fitted rates).

verbose

A logical value. Set verbose = FALSE to silent the process that take place inside the function and avoid progress messages.

...

Arguments to be passed to or from other methods.

Author(s)

Marius D. Pascariu

See Also

do.BackTesting evalAccuracy.BBackTesting evalRobustness.BBackTesting

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
x  <- 0:95
y  <- 1970:2016
dx <- HMD_male$dx$GBRTENW[paste(x), paste(y)]
M  <- c("MRWD", "LeeCarter", "HyndmanUllah",
        "Oeppen", "MEM4", "MEM5")

BB <- do.BBackTesting(data = dx, x = x, y = y,
                      data.in = "dx", 
                      models = M,
                      strategy = c(20, 20, 1))

A <- evalAccuracy(BB, data.out = "ex")
A

R <- do.Ranking(A)
R

mpascariu/MortalityForecast documentation built on Sept. 28, 2020, 2:40 p.m.