Calculates Bayesian credible intervals (CI) using one of the available methods:
"HDI": highest density interval (seextr_ci_hdi()),"ETI": equal tailed intervals (seextr_ci_eti()).
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.
Examples
xtr_ci(rnorm(1e4), type = "HDI")
#> lower upper
#> 1 -1.943616 1.960297
