Learn R Programming

BayesMortalityPlus (version 0.2.3)

predict.BLC: BLC: Forecasting

Description

Calculates the means and variances of the forecast distributions based on the resulting chains from an estimation method.

Usage

# S3 method for BLC
predict(object, h, ...)

Value

A PredBLC object that contains a list with predicted values calculated from BLC object chains structured in an array.

Arguments

object

A BLC object that is result of a call to blc() function.

h

The prediction horizon.

...

Other arguments.

See Also

fitted.BLC(), print.BLC(), and plot.PredBLC() for PredBLC methods to native R functions fitted(), print(), and plot().

expectancy.BLC() and Heatmap.BLC to compute and plot the life expectancy of the prediction(s).

Examples

Run this code
## Importing log-mortality data from Portugal:
data(PT)
Y <- PT

## Fitting the model
fit = blc(Y = Y, M = 100, bn = 20)

## Prediction for 2 years ahead
pred = predict(fit, h = 2)
print(pred)

Run the code above in your browser using DataLab