File: HPDinterval.Rd

package info (click to toggle)
r-cran-coda 0.13-2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 456 kB
  • sloc: makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\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 in
  an 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 target
    probability content of the intervals.  The nominal probability
    content of the intervals is the multiple of \code{1/nrow(obj)}
    nearest to \code{prob}.}
  \item{\dots}{Optional additional arguments for methods.  None are used
    at present.}
}
\details{
  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.
}
\value{
  For an \code{"mcmc"} object, a matrix with columns \code{"lower"} and
  \code{"upper"} and rows corresponding to the parameters.  The
  attribute \code{"Probability"} is the nominal probability content of
  the 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}