Learn R Programming

BayesMortalityPlus (version 0.2.3)

mean.PredBLC: BLC: Arithmetic mean for predictions

Description

Calculates the means based on the resulting chains from a predicted year.

Usage

# S3 method for PredBLC
mean(x, h, ...)

Value

A vector with the mean values of the log-mortality chains.

Arguments

x

A PredBLC object, result to the pred() function call on a BLC object.

h

A positive integer specifying the year in the prediction horizon to be calculated.

...

Further arguments passed to or from other methods.

See Also

mean.BLC() for BLC object method.

Examples

Run this code
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)

mean(pred, 1)
mean(pred, 2)

Run the code above in your browser using DataLab