hldepth | R Documentation |
Calculates the halfspace location depth for each point in a given grid.
hldepth(D, G, verbose = TRUE)
D |
Data set with rows representing the individuals and columns representing the features. In the case of three dimensions, the colnames of D must be c("x", "y", "z"). |
G |
List containing the grid information produced by
|
verbose |
Logical. Indicates whether progress information is printed during calculation. |
Calculation of the halfspace location depth at each grid point is
mandatory before calculating the depth median
(depmed
), the bag (bag
) and the loop
(loop
). Ideally, the output is assigned to the array
H produced by gridfun
.
An array of the same dimension as the array in argument G. The elements contain the halfspace location depth at the related grid location.
Jochen Kruppa, Klaus Jung
Rousseeuw, P. J., Ruts, I., & Tukey, J. W. (1999). The bagplot: a bivariate boxplot. The American Statistician, 53(4), 382-387.
For more information, please refer to the package's documentation and the tutorial: https://software.klausjung-lab.de/.
## Attention: calculation is currently time-consuming.
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.