Description Usage Arguments Value Examples
Predict distribution of deaths using CoDa model.
1 2 3 4 |
object |
coda object |
h |
Number of years to be forecast in the future |
order |
A specification of the non-seasonal part of the ARIMA model:
the three components (p, d, q) are the AR order, the degree of differencing,
and the MA order. If |
include.drift |
Logical. Should the ARIMA model include a linear drift term?
If |
method |
Fitting method: maximum likelihood or minimize conditional
sum-of-squares. Options to use:
conditional-sum-of-squares ( |
ci |
Confidence level for prediction intervals. |
jumpchoice |
Method used for computation of jumpchoice.
Possibilities: |
... |
Additional arguments to be passed to |
The output is an object of class "predict.coda"
with the components:
call |
An unevaluated function call, that is, an unevaluated expression which consists of the named function applied to the given arguments. |
predicted.values |
A list containing the predicted values together
with the associated prediction intervals given by the estimated |
kt |
The extrapolated kt parameters. |
conf.intervals |
The extrapolated kt parameters. |
deep |
An object of class |
x |
Vector of ages used in prediction. |
y |
Vector of years used in prediction. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Example 1 ----------------------
# Fit CoDa Mortality Model
M <- coda(CoDa.data)
# Predict life expectancy 20 years in the future using CoDa model
P <- predict(M, h = 20)
# 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,0), include.drift = TRUE, jumpchoice = "fit")
## Not run:
# Example 3 ----------------------
# Compute life tables using forecast values using the MortalityLaws R package
library(MortalityLaws)
dx <- P$predicted.values$mean
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.