Rev 1938 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{HPDinterval}\alias{HPDinterval}\alias{HPDinterval.mcmc}\alias{HPDinterval.mcmc.list}\title{Highest Posterior Density intervals}\description{Create Highest Posterior Density (HPD) intervals for the parameters inan MCMC sample.}\usage{HPDinterval(obj, prob = 0.95, \dots)\method{HPDinterval}{mcmc}(obj, prob = 0.95, \dots)\method{HPDinterval}{mcmc.list}(obj, prob = 0.95, \dots)}\arguments{\item{obj}{The object containing the MCMC sample - usually of class\code{"mcmc"} or \code{"mcmc.list"}}.\item{prob}{A numeric scalar in the interval (0,1) giving the targetprobability content of the intervals. The nominal probabilitycontent of the intervals is the multiple of \code{1/nrow(obj)}nearest to \code{prob}.}\item{\dots}{Optional additional arguments for methods. None are usedat present.}}\details{For each parameter the interval is constructed from the empirical cdfof the sample as the shortest interval for which the difference inthe ecdf values of the endpoints is the nominal probability. Assumingthat the distribution is not severely multimodal, this is the HPD interval.}\value{For an \code{"mcmc"} object, a matrix with columns \code{"lower"} and\code{"upper"} and rows corresponding to the parameters. Theattribute \code{"Probability"} is the nominal probability content ofthe intervals. A list of such matrices is returned for an\code{"mcmc.list"} object.}\author{Douglas Bates}\examples{data(line)HPDinterval(line)}\keyword{univar}\keyword{htest}