xtr_ci: Credible Intervals

View source: R/ci.R

xtr_ciR Documentation

Credible Intervals

Description

Calculates Bayesian credible intervals (CI) using one of the available methods:

  • "HDI": highest density interval (see xtr_ci_hdi()),

  • "ETI": equal tailed intervals (see xtr_ci_eti()).

Usage

xtr_ci(x, level = 0.95, ..., type = "HDI", 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.

type

A string indicating which type of CI to return. Currently allows Highest Density Intervals ("HDI"; default) and Equal-Tailed Intervals ("ETI").

na_rm

A flag indicating whether to remove missing values.

Value

A data.frame of the lower and upper limits for the credible interval. Note that the interval is not guaranteed to be one-sided or two-sided.

See Also

mcmcr::coef

Examples

xtr_ci(rnorm(1e4), type = "HDI")

extras documentation built on July 16, 2026, 1:07 a.m.