HPDint: Highest Posterior Density Interval

Description Usage Arguments Value Author(s)

View source: R/stanMisc.r

Description

Adapts code from coda::HPDinterval() to compute a highest posterior density interval from posterior samples for a single parameter. Quoting from the coda help file, for each parameter the interval is constructed from the empirical cdf of the sample as the shortest interval for which the difference in the ecdf values of the endpoints is the nominal probability. Assuming that the distribution is not severely multimodal, this is the HPD interval.

Usage

1
HPDint(x, prob = 0.95)

Arguments

x

a vector of posterior draws

prob

desired probability coverage

Value

a 2-vector with elements Lower and Upper

Author(s)

Douglas Bates and Frank Harrell


rmsb documentation built on Feb. 28, 2021, 1:06 a.m.