predict.CoDa: Predict distribution of deaths using CoDa model.

Description Usage Arguments Value Examples

Description

Predict distribution of deaths using CoDa model.

Usage

1
2
3
4
## S3 method for class 'coda'
predict(object, h, order = NULL, include.drift = NULL,
  method = "ML", ci = c(80, 95), jumpchoice = c("actual", "fit"),
  ...)

Arguments

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 order = NULL, the ARIMA order will be estimated automatically using the KPPS algorithm.

include.drift

Logical. Should the ARIMA model include a linear drift term? If include.drift = NULL, the model will be estimated automatically.

method

Fitting method: maximum likelihood or minimize conditional sum-of-squares. Options to use: conditional-sum-of-squares ("CSS-ML"), maximum likelihood ("ML") and "CSS".

ci

Confidence level for prediction intervals.

jumpchoice

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

...

Additional arguments to be passed to Arima

Value

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 link{coda} model over the forecast horizon h.

kt

The extrapolated kt parameters.

conf.intervals

The extrapolated kt parameters.

deep

An object of class ARIMA that contains all the components of the fitted time series model used in kt prediction.

x

Vector of ages used in prediction.

y

Vector of years used in prediction.

Examples

 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)

mpascariu/CoDa documentation built on May 5, 2019, 7 p.m.