Description Usage Arguments Value Author(s) References See Also Examples
Fit the Oeppen model for forecasting the life table distribution of deaths. This is a Lee-Carter type model adapted to a compositional-data framework (CoDa). A key difference between the \insertCitelee1992;textualMortalityForecast method and the Oeppen model is that the former fits and forecasts the death rates (mx) while the latter is based on the life table death distribution (dx). \insertCite@See @oeppen2008 and @bergeron2017;textualMortalityForecast for a detail description and mathematical formulation.
1 |
data |
A data.frame or a matrix containing mortality data
with ages |
x |
Numerical vector indicating the ages in input |
y |
Numerical vector indicating the years in input |
verbose |
A logical value. Set |
... |
Arguments to be passed to or from other methods. |
The output is a list with the components:
input |
List with arguments provided in input. Saved for convenience; |
info |
Short details about the model; |
call |
An unevaluated function call, that is, an unevaluated expression which consists of the named function applied to the given arguments; |
coefficients |
Estimated coefficients; |
fitted.values |
Fitted values of the estimated model; |
observed.values |
The observed values used in fitting arranged in the same format as the fitted.values; |
residuals |
Deviance residuals; |
x |
Vector of ages used in the fitting; |
y |
Vector of years used in the fitting. |
Marius D. Pascariu and Marie-Pier Bergeron-Boucher
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # Example 1 ----------------------
# Data
x <- 0:100
y <- 1980:2016
dx <- HMD_male$dx$GBRTENW[paste(x), paste(y)]
# If data contains zero's we have to replace them with very small
# values in order to avoid errors in fitting. replace.zeros() will do it.
dx <- replace.zeros(dx)
# Fit model
M <- model.Oeppen(data = dx, x = x, y = y)
M
summary(M)
coef(M)
# Plot observed and fitted values
plot(M, plotType = "observed")
plot(M, plotType = "fitted")
# Plot residuals
R <- residuals(M)
plot(R, plotType = "scatter")
plot(R, plotType = "colourmap")
plot(R, plotType = "signplot")
# Perform forecasts
P <- predict(M, h = 16)
P
plot(P, plotType = "mean")
plot(P, plotType = "lower")
plot(P, plotType = "upper")
#' # Example 2 ----------------------
# One can specify manually the ARIMA order, a drift to be included or not,
# and the jump choice of the first forecast year.
P2 <- predict(M, h = 20,
order = c(0,1,1),
include.drift = FALSE,
jumpchoice = "fit")
## Not run:
# Example 3 ----------------------
# Compute life tables using forecast values using the MortalityLaws R package
library(MortalityLaws)
dx <- P$predicted.values
lt <- LifeTable(x = P$x, dx = dx)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.