Skip to contents

Swapping the squared loss for the plain one buys a breakdown point of one half in any dimension, at the cost of the closed form. The spatial rank of the solution is returned as a check: at the true L1 median the sum of unit vectors to the data points vanishes.

Usage

L1med(X, tol = NULL, max_iter = 200)

Arguments

X

Points.

tol

Ignored; interface compatibility only.

max_iter

Iterations.

Value

List with estimate, cost, spatial_rank_norm, n, d.

Details

Formula: min_mu sum_i ||x_i - mu||, by Weiszfeld iteration for a fixed number of steps.

References

Weiszfeld, E. (1937). Tohoku Math J 43:355-386; Small, C. G. (1990) Int Statist Rev 58:263-277.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
L1med(V)
#> $estimate
#> [1] 4.5
#> 
#> $cost
#> [1] 16
#> 
#> $spatial_rank_norm
#> [1] 0
#> 
#> $n
#> [1] 8
#> 
#> $d
#> [1] 1
#> 
#> $method
#> [1] "L1 median with spatial-rank check"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"