depmed: Calculates the depth median.

depmedR Documentation

Calculates the depth median.

Description

Calculates the depth median.

Usage

depmed(G)

Arguments

G

List containing the grid information produced by gridfun and the halfspace location depths produced by hldepth.

Details

Calculates the depth median in a specified grid array with given halfspace location depth at each grid location.

Value

An vector with a length equal to the number of dimension of the array in G, containing the coordinates of the depth median.

Author(s)

Jochen Kruppa, Klaus Jung

References

Rousseeuw, P. J., Ruts, I., & Tukey, J. W. (1999). The bagplot: a bivariate boxplot. The American Statistician, 53(4), 382-387.

Examples

## Attention: calculation is currently time-consuming.
## Remove #-Symbols to run examples

## A 3-dimensional example data set D1
# n <- 200
# x1 <- rnorm(n, 0, 1)
# y1 <- rnorm(n, 0, 1)
# z1 <- rnorm(n, 0, 1)
# D1 <- data.frame(cbind(x1, y1, z1))
# colnames(D1) <- c("x", "y", "z")

## Specification of the grid and calculation of the halfspace location depth at each grid location.
# G <- gridfun(D1, grid.size=20)
# G$H <- hldepth(D1, G, verbose=TRUE)
# dm <- depmed(G) ## Calculation of the depth median

RepeatedHighDim documentation built on July 9, 2023, 6:33 p.m.