huberM {sfsmisc}R Documentation

Safe (generalized) Huber M-Estimator of Location

Description

(Generalized) Huber M-estimator of location with MAD scale, being sensible also when the scale is zero where huber() returns an error.

Usage

huberM(x, k = 1.5, tol = 1e-06, mu = median(x), s = mad(x, center=mu),
       warn0scale = getOption("verbose"))

Arguments

x numeric vector.
k positive factor; the algorithm winsorizes at k standard deviations.
tol convergence tolerance.
mu initial location estimator.
s scale estimator held constant through the iterations.
warn0scale logical; if true, and s is 0 and length(x) > 1, this will be warned about.

Value

list of location and scale parameters, and number of iterations used.

mu location estimate
s the s argument,MAD scale estimate – unless s is
it the number of “Huber iterations” used.

Author(s)

Martin Maechler building on the MASS code mentioned.

References

Huber, P. J. (1981) Robust Statistics. Wiley.

See Also

hubers (and huber) in package MASS; mad.

Examples

huberM(c(1:9, 1000))
mad  (c(1:9, 1000))
mad  (rep(9, 100))
huberM(rep(9, 100))

[Package Contents]