spatialDepth: Spatial Depth in dataset

View source: R/statistics.R

spatialDepthR Documentation

Spatial Depth in dataset

Description

The depth in a dataset as defined by 1 the length of the mean of the unit vectors pointing to all (other) datapoints. For a point with depth 0 the direction to all other points is parallel. For a point with depth 1, the point corresponds exactly to the median of the dataset.

Usage

spatialDepth(x, data = x, ..., norm)

## S3 method for class 'BData'
spatialDepth(x, data = x, ..., norm = DistributionalDDA::norm)

## S3 method for class 'numeric'
spatialDepth(x, data = x, ..., norm = abs)

## S3 method for class 'matrix'
spatialDepth(x, data = x, ..., norm = function(x) sqrt(rowMeans(x^2)))

Arguments

x

the values for which the depth shall be computed

data

the dataset against which the spatial depth of 'x' is computed (the reference cloud of points). Defaults to 'x' itself.

...

further arguments to norm determining computation or type of norm

norm

the norm to be used

Value

the spatial depth of the values in x

Methods (by class)

  • spatialDepth(BData): method for BData objects

  • spatialDepth(numeric): method for numerical data

  • spatialDepth(matrix): method for multivariate data

See Also

Other caseStatistics: caseE(), caseLogRatios(), caseMeans(), caseQuantiles(), caseSds(), caseVars(), centralityQuantile(), distanceToCenter(), median.BData()

Examples

data(DTD)
Xpdf    = BDataPDFs(DTD$shapePDF,basis=B2Unif01Basis5)
 spatialDepth(Xpdf) 


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.