Skip to contents

Huber weights taper but never vanish, so a point far enough out still moves the estimate. The biweight redescends to exactly zero past c. The price is a non-convex objective, so the start matters – the median and a MAD scale are used.

Usage

Tukeyw(y, c = 4.685, n_iter = 20)

Arguments

y

Sample.

c

Tuning constant; 4.685 gives 95 percent Gaussian efficiency.

n_iter

Reweighting sweeps.

Value

List with estimate, scale, weights, n.

Details

Determinism: fixed number of reweighting sweeps, no tolerance.

Formula: w(r) = (1 - (r/c)^2)^2 for |r| <= c, else 0, with r = (y - mu)/s and s the consistency-scaled MAD.

References

Beaton, A. E. & Tukey, J. W. (1974). Technometrics 16:147-185.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Tukeyw(V)
#> $estimate
#> [1] 4.5
#> 
#> $scale
#> [1] 2.965204
#> 
#> $weights
#> [1] 0.8770777 0.9362777 0.9768183 0.9974108 0.9974108 0.9768183 0.9362777
#> [8] 0.8770777
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Tukey biweight location, MAD scale"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"