hpd.overlap: Check whether hpds of two distributions overlap

View source: R/sets.R

hpd.overlapR Documentation

Check whether hpds of two distributions overlap

Description

Checks whether any of the highest posterior densities (hpds) of two distributions overlap.

Usage

hpd.overlap(distA, distB, prob = 0.95)

Arguments

distA

Distribution A. Expects two columns: values and their probabilities (e.g., caldist(130,10, cc=1)).

distB

Distribution B. Expects two columns: values and their probabilities (e.g., caldist(130,10, cc=1)).

prob

The probability of the highest posterior densities. Defaults to 95%.

Value

TRUE if at least one of the hpds of distA overlaps with that of distB.

Examples

  distA <- caldist(130, 20, cc=0) # normal distribution
  distB <- caldist(130, 20, cc=1) # calibrated distribution
  plot(distB, type="l")
  lines(distA, col=2)
  hpd.overlap(distA, distB)

rice documentation built on Sept. 9, 2025, 5:42 p.m.