plot.PredBLC {BayesMortalityPlus} | R Documentation |
This functions plot the predicted log-mortality and the predict intervals of the log-mortality for a specific year in the prediction horizon
## S3 method for class 'PredBLC'
plot(x, h = NULL, prob = 0.95, plotIC = TRUE, age = NULL, ...)
x |
A |
h |
A numeric vector specifying the year(s) in the prediction horizon to be calculated. |
prob |
A real number that represents the probability of the predict interval. |
plotIC |
Logical. If 'TRUE' (default), shows the predictive intervals. |
age |
A numeric vector indicating the modelled ages. (Optional). |
... |
Other arguments. |
A 'ggplot' object with the predicted mortality rates and their predict intervals.
plot.HP()
, plot.DLM()
and plot.BLC for HP
, DLM
or BLC
methods.
## Importing log-mortality data from Portugal:
data(PT)
Y <- PT
## Fitting the model
fit = blc(Y = Y, M = 100, bn = 20)
#' ## Prediction for 10 years ahead
pred = predict(fit, h = 3)
## Plotting
plot(pred, h = 1)
plot(pred, h = 3, prob = 0.9)