dist_hdr {truelies} | R Documentation |
Compute highest density region for a density function
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
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
d1 <- update_prior(33, 50, P = 0.5, prior = stats::dunif)
dist_hdr(d1, 0.95)
[Package truelies version 0.2.0 Index]