sdepth {mrfDepth} | R Documentation |
Simplicial depth of points relative to a dataset
Description
Computes the simplicial depth of p
-dimensional points z
relative to a p
-dimensional dataset x
. Only dimension p<=2
is supported.
Usage
sdepth(x, z = NULL)
Arguments
x |
An |
z |
An optional |
Details
The simplicial depth has been introduced by Liu (1990). The simplicial depth of a point z_i
is defined as the number of simplices with vertices in x
that contain z_i
.
Exact computation of the simplicial depth for bivariate data is performed by means of the algorithm described in Rousseeuw and Ruts (1996).
To visualize the depth of bivariate data one can apply the mrainbowplot
function. It plots the data with coloring according to their depth.
It is first checked whether the data lie in a subspace of dimension smaller than p
. If so, a warning is given, as well as the dimension of the subspace and a direction which is orthogonal to it.
Value
A list with components:
depthZ |
Vector of length |
dimension |
When the data |
hyperplane |
When the data |
Author(s)
P. Segaert, based on Fortran code by P.J. Rousseeuw, I. Ruts and A. Struyf.
References
Liu R. (1990). On a notion of data depth based on random simplices. The Annals of Statistics, 18, 405–414.
Rousseeuw P.J., Ruts I. (1996). AS 307: Bivariate location depth. Applied Statistics, 45, 516–526.
See Also
Examples
data(bloodfat)
Result <- sdepth(x = bloodfat)
mrainbowplot(bloodfat, depth = Result$depthZ)