View source: R/depth.spatial.r
depth.spatial | R Documentation |
Calculates the spatial depth of points w.r.t. a multivariate data set.
depth.spatial(x, data, mah.estimate = "moment", mah.parMcd = 0.75)
x |
Matrix of objects (numerical vector as one object) whose depth is to be calculated; each row contains a |
data |
Matrix of data where each row contains a |
mah.estimate |
is a character string specifying which estimates to use when calculating sample covariance matrix; can be |
mah.parMcd |
is the value of the argument |
Calculates spatial depth. Spatial depth (also L1-depth) is a distance-based depth exploiting the idea of spatial quantiles of Chaudhuri (1996) and Koltchinskii (1997), formulated by Vardi & Zhang (2000) and Serfling (2002).
Numerical vector of depths, one for each row in x
; or one depth value if x
is a numerical vector.
Chaudhuri, P. (1996). On a geometric notion of quantiles for multivariate data. Journal of the Americal Statistical Association 91 862–872.
Koltchinskii, V.I. (1997). M-estimation, convexity and quantiles. The Annals of Statistics 25 435–477.
Serfling, R. (2006). Depth functions in nonparametric multivariate inference. In: Liu, R., Serfling, R., Souvaine, D. (eds.), Data Depth: Robust Multivariate Analysis, Computational Geometry and Applications, American Mathematical Society, 1–16.
Vardi, Y. and Zhang, C.H. (2000). The multivariate L1-median and associated data depth. Proceedings of the National Academy of Sciences, U.S.A. 97 1423–1426.
depth.halfspace
for calculation of the Tukey depth.
depth.Mahalanobis
for calculation of Mahalanobis depth.
depth.projection
for calculation of projection depth.
depth.simplicial
for calculation of simplicial depth.
depth.simplicialVolume
for calculation of simplicial volume depth.
depth.zonoid
for calculation of zonoid depth.
depth.potential
for calculation of data potential.
# 5-dimensional normal distribution
data <- mvrnorm(1000, rep(0, 5),
matrix(c(1, 0, 0, 0, 0,
0, 2, 0, 0, 0,
0, 0, 3, 0, 0,
0, 0, 0, 2, 0,
0, 0, 0, 0, 1),
nrow = 5))
x <- mvrnorm(10, rep(1, 5),
matrix(c(1, 0, 0, 0, 0,
0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 1, 0,
0, 0, 0, 0, 1),
nrow = 5))
depths <- depth.spatial(x, data)
cat("Depths: ", depths, "\n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.