Description Usage Arguments Details Value References See Also Examples
The Maximum-Entropy Mortality Model
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 |
n |
The maximum order of the moments to be used. |
verbose |
A logical value. Set |
... |
Arguments to be passed to or from other methods. |
pascariu_phd2018MortalityForecast
The output is an object of class MEM
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 |
Observed values used in fitting; |
fitted.raw.moments |
Fitted raw moments; |
observed.raw.moments |
Observed raw moments of the input data; |
residuals |
Deviance residuals; |
random.walk.model |
Object containing the components of the fitted time series model to the extrapolate moments; |
x |
Vector of ages used in the fitting; |
y |
Vector of years used in the fitting. |
predict.MEM
plot.MEM
find.moments
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 | # Data
x <- 0:110
y <- 1985:2014
dx <- HMD_male$dx$GBRTENW[paste(x), paste(y)]
# Fit model the Maximum-Entropy Mortality of order 5,
# that is using the first 6 statistical moments (moment 0 to 5).
M <- model.MEM(data = dx, x = x, y = y, n = 5)
M
R <- residuals(M)
plot(M, plotType = "observed")
plot(M, plotType = "fitted")
plot(R, plotType = "scatter")
plot(R, plotType = "colourmap")
plot(R, plotType = "signplot")
# Perform forecasts
P <- predict(M, h = 16, x.h = 0:120)
plot(P, plotType = "mean")
plot(P, plotType = "lower")
plot(P, plotType = "upper")
plot(P, M, plotType = "raw_moments")
plot(P, M, plotType = "normalised_moments")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.