Skip to contents

Computes the smallest interval containing the specified probability mass for a given sample.

Usage

hdi(sample, prob = 0.95)

Arguments

sample

A numeric vector representing the sample data.

prob

A numeric value between 0 and 1 specifying the desired probability mass. Defaults to 0.95.

Value

A numeric vector of length 2 indicating the lower and upper bounds of the HDI.