hpdparameter: Highest Posterior Density (HPD) for a parameter
Description
This function returns the upper and lower bound of the Highest
Posterior Density (HPD) for a parameter based on the Chen-Shao Highest
Posterior Density (HPD) Estimation Algorithm found in the book by Chen, Shao,
and Ibrahim (2000). (The smallest 95% credible interval will be given by the
HPD using alpha = 0.05)
Usage
hpdparameter(parameter_MCMC, alpha = 0.05)
Value
A vector is returned that contains the lower and upper bound of the
Highest Posterior Density (HPD) for a parameter (this will be the smallest
95% credible interval using alpha = 0.05)
Arguments
parameter_MCMC
a vector of the parameter samples for a single
estimated parameter
alpha
100(1 - alpha)% credible interval with the default value as
alpha = 0.05
References
Chen M, Shao Q, Ibrahim JG (2000) Monte Carlo Methods in Bayesian
Computation. New York-New York: Springer-Verlag.