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).
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)
lmed Index of deepest element median
of xx
.
ltrim Index of set of points x
with trimmed mean
mtrim
.
dep Depth of each point x
w.r.t. xx
.
proj The projection value of each point on set of points.
xis a set of points to be evaluated.
xx a reference sample
name Name of depth method
is a set of points, a d-column matrix.
is a d-dimension multivariate reference sample (a d-column matrix)
where x
points are evaluated.
Metric function, by default metric.dist
.
Distance matrix between x
and xx
is computed.
Bandwidth, h>0
. Default argument values are provided as the
15%--quantile of the distance between x
and xx
.
=TRUE, scale the depth, see scale.
Further arguments passed to or from other methods.
are the directions for random projections, by default 500 random
projections generated from a scaled runif(500,-1,1)
.
Accuracy. The left limit of the empirical distribution function.
=TRUE for random projections. =FALSE for deterministic projections.
The alpha of the trimming.
=TRUE, draw the curves, the sample median and trimmed mean.
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 a
dep
component can be included.
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.
Type of depth measures:
The mdepth.SD
calculates the simplicial depth (HD) of the points in x
w.r.t.
xx
(for bivariate data).
The mdepth.HS
function calculates the random half--space depth (HS)
of the points in x
w.r.t. xx
based on random projections proj
.
The mdepth.MhD
function calculates the Mahalanobis depth (MhD)
of the points in x
w.r.t. xx
.
The mdepth.RP
calculates the random' projection depth (RP)
of the points in x
w.r.t. xx
based on random projections proj
.
The mdepth.LD
calculates the Likelihood depth (LD) of the points
in x
w.r.t. xx
.
The mdepth.TD
function provides the Tukey depth measure for multivariate data.
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.
Functional depth functions: depth.FM
,
depth.mode
, depth.RP
, depth.RPD
and depth.RT
.
if (FALSE) {
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
}
Run the code above in your browser using DataLab