Skip to contents

Depth is what a median means in more than one dimension: the deepest point is the one no halfspace can isolate, and the definition is affine invariant.

Usage

DepthH(X, theta)

Arguments

X

Data cloud.

theta

Point whose depth is wanted.

Value

List with estimate, count, exact, n, p.

Details

In the plane the count is constant on each arc between consecutive normals to the vectors from theta to a data point, so the minimum is attained in the INTERIOR of an arc. Testing the normals themselves is the natural-looking mistake: a data point then lies exactly on the closed boundary and is counted, so a point outside the convex hull comes back with positive depth. Arc midpoints are used instead – no epsilon, and exact. Above two dimensions the minimum is taken over the data directions, an UPPER bound, flagged by exact = 0.

Formula: \(depth(theta) = min_u \#\{i: u'(x_i - theta) >= 0\} / n\).

References

Tukey, J. W. (1975). Proc ICM Vancouver 2:523-531; Rousseeuw & Ruts (1996) Appl Statist 45:516-526; Rousseeuw & Struyf (1998) Statist Comput 8:193-203.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
DepthH(V, V)
#> $estimate
#> [1] 1
#> 
#> $count
#> [1] 8
#> 
#> $exact
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $p
#> [1] 1
#> 
#> $method
#> [1] "Tukey halfspace depth"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"