hdi: Compute Highest-Density Interval

View source: R/hdi.R

hdiR Documentation

Compute Highest-Density Interval

Description

Computes the highest density interval from a sample of representative values, estimated as shortest credible interval. Based on John Kruschke's codes.

Usage

hdi(sample_vec, ci_prob = 0.95)

Arguments

sample_vec

A vector of representative values from a probability distribution (e.g., MCMC samples).

ci_prob

A scalar between 0 and 1, indicating the mass within the credible interval that is to be estimated.

Value

A vector containing the limits of the HDI


hBayesDM documentation built on Sept. 10, 2026, 1:12 a.m.