sdepth | R Documentation |
Computes the simplicial depth of p
-dimensional points z
relative to a p
-dimensional dataset x
. Only dimension p<=2
is supported.
sdepth(x, z = NULL)
x |
An |
z |
An optional |
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.
A list with components:
depthZ |
Vector of length |
dimension |
When the data |
hyperplane |
When the data |
P. Segaert, based on Fortran code by P.J. Rousseeuw, I. Ruts and A. Struyf.
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.
mrainbowplot
data(bloodfat)
Result <- sdepth(x = bloodfat)
mrainbowplot(bloodfat, depth = Result$depthZ)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.