Description Usage Arguments Details Value
Calculate the highest posterior density interval (HPDI) or the equal-tailed density interval (ETDI) of posterior samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | tidy_hpdi(x, prob = 0.9)
## S3 method for class 'numeric'
tidy_hpdi(x, prob = 0.9)
## S3 method for class 'stanreg'
tidy_hpdi(x, prob = 0.9)
## S3 method for class 'mcmc.list'
tidy_hpdi(x, prob = 0.9)
tidy_etdi(x, prob = 0.9)
## S3 method for class 'numeric'
tidy_etdi(x, prob = 0.9)
## S3 method for class 'stanreg'
tidy_etdi(x, prob = 0.9)
## S3 method for class 'mcmc.list'
tidy_etdi(x, prob = 0.9)
|
x |
a model fitted with RStanARM or a vector of MCMC samples |
prob |
a probability content or width of the interval. Defaults to .9. |
The equal-tailed density interval is a term I made up for the traditional sort of confidence or uncertainty interval. A 90 the 5th and 95th percentiles. The interval contains 90 density, and the left and right tails outside of the interval contain an equal amount of probability density (5 compute the interval.
The highest density posterior interval is the narrowest interval with a given
probability density. A 90
contains 90
the interval might contain unequal amounts of probability density. I use
coda::HPDinterval()
to compute these intervals.
a data-frame (a tibble::tibble()
) of intervals. Contains columns
with the term
name, interval
type and density
, and the lower
and upper
values of the interval.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.