hpd {metapack} | R Documentation |
get the highest posterior density (HPD) interval
Description
get the highest posterior density (HPD) interval
Usage
hpd(object, parm, level = 0.95, HPD = TRUE)
Arguments
object |
the output model from fitting a (network) meta analysis/regression model |
parm |
a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered. |
level |
the probability which the HPD interval will cover |
HPD |
a logical value indicating whether HPD or equal-tailed credible interval should be computed; by default, TRUE |
Details
A % HPD interval for
is given by
where is the largest constant that satisfies
.
hpd
computes the HPD interval from an MCMC sample by letting be the
th smallest of the MCMC sample,
and denoting
for . Once
's are sorted, the appropriate
is chosen so that
Value
dataframe containing HPD intervals for the parameters
References
Chen, M. H., & Shao, Q. M. (1999). Monte Carlo estimation of Bayesian credible and HPD intervals. Journal of Computational and Graphical Statistics, 8(1), 69-92.