Description Usage Arguments Examples
View source: R/do_MortalityModels.R
Fit Multiple Stochastic Mortality Models
1 2 3 |
data |
A data.frame or a matrix containing mortality data
with ages |
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. |
x |
Numerical vector indicating the ages in input |
y |
Numerical vector indicating the years in input |
data.in |
Specify the type of input |
models |
One or several mortality models to be estimated. The following options are available:
|
verbose |
A logical value. Set |
... |
Arguments to be passed to or from other methods. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | x <- 0:100 # Ages
y <- 2005:2016 # Years
h <- 16 # forecasting horizon
MM <- c("MRWD", "LeeCarter", "LiLee", "HyndmanUllah",
"Oeppen", "OeppenC", "MEM5", "RenshawHaberman") # mortality models
D <- HMD_male$dx$GBRTENW[paste(x), paste(y)] # data
B <- HMD_female$dx$GBRTENW[paste(x), paste(y)] # benchmark population
# Note: We are fitting various mortality model to E&W males data. Most of them
# are single population model i.e. the estimates are resulted only from data
# specific to that population. However, the coherent models like "OeppenC" or
# "LiLee" require additional data. In these cases, here, female data is used.
M <- do.MortalityModels(data = D,
data.B = B,
x = x,
y = y,
data.in = "dx",
models = MM)
P <- do.MortalityForecasts(object = M,
h = h,
level = 95,
jumpchoice = "actual")
oex <- get.Observed(M, data.out = "ex")
fex <- get.Fitted(M, data.out = "ex")
rex <- get.Residuals(M, data.out = "ex")
pex <- get.Forecasts(P, data.out = "ex")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.