quantile.PredBLC {BayesMortalityPlus} | R Documentation |
Calculates the quantiles of log-mortality based on the resulting chains from a predicted year.
## S3 method for class 'PredBLC'
quantile(x, q, h, ...)
x |
A |
q |
A real number that represents the probability of the quantiles. |
h |
A positive integer especifying the year in the prediciton horizon to be calculated. |
... |
Further arguments passed to or from other methods. |
A data.frame with the quantiles of the selected parameter.
quantile.BLC()
for BLC
method.
## 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)
## The log-mortality median for the first year of prediction
quantile(pred, q = 0.5, h = 1)
## The 0.1 and 0.9 quantiles for the first and second year of prediction
quantile(pred, q = c(0.1, 0.9), h = 1)
quantile(pred, q = c(0.1, 0.9), h = 2)