hdr.boxplot.2d {hdrcde} | R Documentation |
Calculates and plots highest density regions in two dimensions, including the bivariate HDR boxplot.
hdr.boxplot.2d(x, y, prob=c(0.01,0.50), h = c(5,5), show.points = FALSE, xlab="", ylab="", ...)
x |
Numeric vector |
y |
Numeric vector of same length as x . |
prob |
Probability coverage required for HDRs |
h |
Pair of bandwidths passed to ash2 . |
show.points |
If TRUE, will plot points over the top of contours. |
xlab |
Label for x-axis. |
ylab |
Label for y-axis. |
... |
Other arguments to be passed to plot. |
Scott's ash2
is used to estimate the density using kernel
estimation. Then Hyndman's (1996) density quantile algorithm is used to compute
the HDRs.
Some information about the HDRs is returned. See code for details.
Rob Hyndman
Hyndman, R.J. (1996) Computing and graphing highest density regions American Statistician, 50, 120-126.
x <- c(rnorm(200,0,1),rnorm(200,4,1)) y <- c(rnorm(200,0,1),rnorm(200,4,1)) par(mfrow=c(1,2)) plot(x,y) hdr.boxplot.2d(x,y)