Skip to contents

Formula: d = 1 / (1 + sup_u |u'x - Med(u'X)| / MAD(u'X))

Usage

DepthP(x, X, n_dir = 180)

Arguments

x

The point, length d.

X

An n x d data matrix.

n_dir

Number of equally spaced directions when d = 2.

Value

List with estimate, depth, outlyingness, med, mad, worst_dir, n, d, method.

Details

The outlyingness of a point is the worst standardised deviation over all one-dimensional projections, and the depth is its reciprocal transform, so depth lies in (0, 1] and equals exactly 1 at a point whose projection is the median in every direction. In one dimension the supremum is attained at u = +/-1, so the depth is available in closed form.

References

Stahel (1981), PhD thesis, ETH Zurich; Donoho (1982), qualifying paper, Harvard; Zuo & Serfling (2000), Ann. Statist. 28(2):461-482.

Examples

DepthP(x = 5L, X = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 0.8557082
#> 
#> $depth
#> [1] 0.8557082
#> 
#> $outlyingness
#> [1] 0.1686227
#> 
#> $med
#> [1] 4.5
#> 
#> $mad
#> [1] 2.9652
#> 
#> $worst_dir
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $d
#> [1] 1
#> 
#> $method
#> [1] "Stahel-Donoho projection depth"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"