Compute measure of centrality of the multivariate data. Type of depth function: simplicial depth (SD), Mahalanobis depth (MhD), Random Half–Space depth (HS), random projection depth (RP) and Likelihood Depth (LD).
Usage
mdepth.LD(x, xx = x, metric = metric.dist, h = NULL, scale = FALSE, ...)
mdepth.HS(x, xx = x, proj = 50, scale = FALSE, xeps = 1e-15, random = FALSE)
mdepth.RP(x, xx = x, proj = 50, scale = FALSE)
mdepth.MhD(x, xx = x, scale = FALSE)
mdepth.KFSD(x, xx = x, trim = 0.25, h = NULL, scale = FALSE, draw = FALSE)
mdepth.FSD(x, xx = x, trim = 0.25, scale = FALSE, draw = FALSE)
mdepth.FM(x, xx = x, scale = FALSE, dfunc = "TD1")
mdepth.TD(x, xx = x, xeps = 1e-15, scale = FALSE)
mdepth.SD(x, xx = NULL, scale = FALSE)
Arguments
- x
is a set of points, a d-column matrix.
- xx
is a d-dimension multivariate reference sample (a d-column matrix) where
x
points are evaluated.- metric
Metric function, by default
metric.dist
. Distance matrix betweenx
andxx
is computed.- h
Bandwidth,
h>0
. Default argument values are provided as the 15%–quantile of the distance betweenx
andxx
.- scale
=TRUE, scale the depth, see scale.
- ...
Further arguments passed to or from other methods.
- proj
are the directions for random projections, by default 500 random projections generated from a scaled
runif(500,-1,1)
.- xeps
Accuracy. The left limit of the empirical distribution function.
- random
=TRUE for random projections. =FALSE for deterministic projections.
- trim
The alpha of the trimming.
- draw
=TRUE, draw the curves, the sample median and trimmed mean.
- dfunc
type of univariate depth function used inside depth function: "FM1" refers to the original Fraiman and Muniz univariate depth (default), "TD1" Tukey (Halfspace),"Liu1" for simplical depth, "LD1" for Likelihood depth and "MhD1" for Mahalanobis 1D depth. Also, any user function fulfilling the following pattern
FUN.USER(x,xx,...)
and returning adep
component can be included.
Value
lmed
: Index of the deepest element (median) ofxx
.ltrim
: Index of the set of pointsx
with trimmed meanmtrim
.dep
: Depth of each point inx
with respect toxx
.proj
: The projection value of each point onto the set of points.x
: A set of points to be evaluated.xx
: A reference sample.name
: Name of the depth method.
Details
Type of depth measures:
The
mdepth.SD
calculates the simplicial depth (HD) of the points inx
w.r.t.xx
(for bivariate data).The
mdepth.HS
function calculates the random half–space depth (HS) of the points inx
w.r.t.xx
based on random projectionsproj
.The
mdepth.MhD
function calculates the Mahalanobis depth (MhD) of the points inx
w.r.t.xx
.The
mdepth.RP
calculates the random' projection depth (RP) of the points inx
w.r.t.xx
based on random projectionsproj
.The
mdepth.LD
calculates the Likelihood depth (LD) of the points inx
w.r.t.xx
.The
mdepth.TD
function provides the Tukey depth measure for multivariate data.
References
Liu, R. Y., Parelius, J. M., and Singh, K. (1999). Multivariate analysis by data depth: descriptive statistics, graphics and inference,(with discussion and a rejoinder by Liu and Singh). The Annals of Statistics, 27(3), 783-858.
See also
Functional depth functions: depth.FM
,
depth.mode
, depth.RP
, depth.RPD
and depth.RT
.
Author
mdepth.RP
, mdepth.MhD
and
mdepth.HS
are versions created by Manuel Febrero Bande and
Manuel Oviedo de la Fuente of the original version created by Jun Li, Juan
A. Cuesta Albertos and Regina Y. Liu for polynomial classifier.
Examples
if (FALSE) { # \dontrun{
data(iris)
group<-iris[,5]
x<-iris[,1:2]
MhD<-mdepth.MhD(x)
PD<-mdepth.RP(x)
HD<-mdepth.HS(x)
SD<-mdepth.SD(x)
x.setosa<-x[group=="setosa",]
x.versicolor<-x[group=="versicolor",]
x.virginica<-x[group=="virginica",]
d1<-mdepth.SD(x,x.setosa)$dep
d2<-mdepth.SD(x,x.versicolor)$dep
d3<-mdepth.SD(x,x.virginica)$dep
} # }