This function converts the posterior Heligman-Pollard parameter distribution resulting from a Bayesian Melding procedure to probabilities of death over a specified age range. In addition, this function also calculates and plots a CI over the specified age range. The user can also elect to plot the data (ndeath
/nrisk
) from which the model was estimated.
1 2 3 4 |
... |
Arguments to be passes to |
nrisk |
A vector containing the number of persons at risk at age x |
ndeath |
A vector containing the number of deaths at age x |
age |
A vector containing the ages at which the probabilities of death will be calculated and plotted |
hpp |
A matrix containing the posterior distribution of Heligman-Pollard parameters resulting from the Bayesian Melding procedure |
yrange |
Same as ylim in |
xrange |
Same as xlim in |
log |
Logical. If TRUE the data will be converted and plotted on the log scale |
plotdata |
Logical. If TRUE the data ( |
plotpost |
Logical. If TRUE the posterior output will be plotted. |
data.type |
Same as |
post.type |
Same as |
line.col |
A vector of length four containing either numbers or strings describing the colors of the plot. In order, the vector elements control the color of the posterior output lines (defaults to "grey"), the color of the median line representing the median probability of death at each age (defaults to "blue"), the color of the two lines representing the upper and lower credible interval bounds (defaults to "red"), and the final element in this vector controls the color of the data points if they are plotted (defaults to "dark green"). |
CI |
Defines the width of the credible interval if plotted (defaults to 95 percent). Setting |
If plotdata is TRUE, the user will need to supply the persons at risk at each age x and the number of deaths at age x with the arguments nrisk
and ndeath
respectively.
A plot depicting the posterior distribution of probabilities of death calculated from the posterior parameter distribution resulting from the Bayesian Melding procedure (see hp.bm.imis
)
Likely used to plot the H.final
return from hp.bm.imis
Heligman, Larry and John H. Pollard. 1980 "The Age Pattern of Mortality." Journal of the Institute of Actuaries 107:49–80.
hp.nqx
, hp.bm.imis
1 2 3 4 5 6 7 8 |
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.