dist_hdr: Compute highest density region for a density function

Description Usage Arguments Details Value Examples

Description

This is a wrapper for hdrcde::hdr. The highest density region is the interval that covers conf_level of the data and has the highest average density. See:

Usage

1
dist_hdr(dist, conf_level, bounds = attr(dist, "limits"))

Arguments

dist

A one-argument function

conf_level

A scalar between 0 and 1

bounds

A length 2 vector of the bounds of the distribution's support

Details

Rob J Hyndman (1996) “Computing and graphing highest density regions”. American Statistician, 50, 120-126.

Value

A length 2 vector of region endpoints

Examples

1
2
d1 <- update_prior(33, 50, P = 0.5, prior = stats::dunif)
dist_hdr(d1, 0.95)

truelies documentation built on Aug. 27, 2019, 1:02 a.m.