u: Numerical vector or matrix whose depth is to be calculated. Dimension has to be the same as that of the observations.
X: The data as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one multivariate observation. If it is a list, all components must be numerical vectors of equal length (coordinates of observations).
method: Character string which determines the depth function. method can be "Projection" (the default), "Mahalanobis", "Euclidean" or "Tukey". For details see depth.
threads: number of threads used in parallel computations. Default value -1 means that all possible cores will be used.
...: parameters specific to method --- see depthEuclid
Details
The Mahalanobis depth
DMAH(y,Xn)=1+(y−xˉ)TS−1(y−xˉ)1,
where S denotes the sample covariance matrix Xn.
A symmetric projection depth D(x,X) of a point x∈Rd, d≥1 is defined as
where Med denotes the univariate median, MAD(Z) = Med(∣Z−Med(Z)∣). Its sample version denoted by D(x,Xn) or D(x,Xn) is obtained by replacing F by its empirical counterpart Fn calculated from the sample Xn .
Next interesting depth is the weighted Lp depth. The weighted Lp depth D(x,F) of a point x∈Rd, d≥1 generated by d dimensional random vector X with distribution F, is defined as D(x,F)=1+Ew(∥x−X∥p)1, where w is a suitable weight function on [0,∞), and ∥⋅∥p stands for the Lp norm (when p = 2 we have usual Euclidean norm). We assume that w is non-decreasing and continuous on [0,∞) with w(∞−)=∞, and for a,b∈Rd satisfying w(∥a+b∥)≤w(∥a∥)+w(∥b∥). Examples of the weight functions are: w(x)=a+bx, a,b>0 or w(x)=xα. The empirical version of the weighted Lp depth is obtained by replacing distribution F of X in Ew(∥x−X∥p)=∫w(∥x−t∥p)dF(t) by its empirical counterpart calculated from the sample Xn...
The Projection and Tukey's depths are calculated using an approximate algorithm. Calculations of Mahalanobis, Euclidean and Lp depths are exact. Returns the depth of multivariate point u with respect to data set X.
Examples
library(robustbase)# Calculation of Projection depthdata(starsCYG, package ="robustbase")depth(t(colMeans(starsCYG)), starsCYG)# Also for matricesdepth(starsCYG, starsCYG)# Projection depth applied to a large bivariate data setx <- matrix(rnorm(9999), nc =3)depth(x, x)
References
Liu, R.Y., Parelius, J.M. and Singh, K. (1999), Multivariate analysis by data depth: Descriptive statistics, graphics and inference (with discussion), Ann. Statist., 27, 783--858.
Mosler K (2013). Depth statistics. In C Becker, R Fried, K S (eds.), Robustness and Complex Data Structures, Festschrift in Honour of Ursula Gather, pp. 17--34. Springer.
Rousseeuw, P.J. and Struyf, A. (1998), Computing location depth and regression depth in higher dimensions, Stat. Comput., 8, 193--203.
Zuo, Y. and Serfling, R. (2000), General Notions of Statistical Depth Functions, Ann. Statist., 28, no. 2, 461--482.
See Also
depthContour and depthPersp for depth graphics.
Author(s)
Daniel Kosiorowski, Mateusz Bocian, Anna Wegrzynkiewicz and Zygmunt Zawadzki from Cracow University of Economics.