Skip to contents

Calculates Bayesian credible intervals using the equal-tailed interval (ETI), i.e., the CI such that the left and right tails outside the CI have the same coverage.

Usage

xtr_ci_eti(x, level = 0.95, ..., na_rm = FALSE)

Arguments

x

A numeric vector of MCMC samples.

level

A number > 0 and <= 1 specifying the probability coverage of the interval.

...

Currently unused.

na_rm

A flag indicating whether to remove missing values.

Value

A data.frame of the lower and upper limits for the credible interval.

Details

The interval is guaranteed to be two-sided, unlike [xtr_ci_hdi()]. Does not return integer outputs even if the input data are integers, unlike xtr_ci_hdi(). The interval limits are always real (double) numeric values.

See also

Examples

xtr_ci_eti(rnorm(1e4))
#>       lower   upper
#> 1 -1.947095 1.94436