powered by
Calculates Highest Density Regions with confidence intervals.
hdrconf(x, den, prob = 0.9, conf = 0.95)
hdrconf returns list containing the following components:
hdrconf
Highest density regions
Highest density regions corresponding to lower confidence limit.
Highest density regions corresponding to upper confidence limit.
Values of \(f_\alpha\) corresponding to HDRs.
Values of \(f_\alpha\) corresponding to lower and upper limits.
Numeric vector containing data.
Density of data as list with components x and y.
x
y
Probability coverage for for HDRs.
Confidence for limits on HDR.
Rob J Hyndman
Hyndman, R.J. (1996) Computing and graphing highest density regions American Statistician, 50, 120-126.
hdr(), plot.hdrconf()
hdr()
plot.hdrconf()
x <- c(rnorm(100, 0, 1), rnorm(100, 4, 1)) den <- density(x, bw = hdrbw(x, 50)) hdr_conf <- hdrconf(x, den) plot(hdr_conf, den, main = "50% HDR with 95% CI")
Run the code above in your browser using DataLab