hdr.boxplot.2d {hdrcde}R Documentation

Bivariate Highest Density Regions

Description

Calculates and plots highest density regions in two dimensions, including the bivariate HDR boxplot.

Usage

hdr.boxplot.2d(x, y, prob=c(0.01,0.50), h = c(5,5), 
    show.points = FALSE, xlab="", ylab="", ...) 

Arguments

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.

Details

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.

Value

Some information about the HDRs is returned. See code for details.

Author(s)

Rob Hyndman

References

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

See Also

hdr.boxplot

Examples

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)

[Package hdrcde version 2.06 Index]