Learn R Programming

robustbase (version 0.1-2)

Sn: Robust Location-Free Scale Estimate More Efficient than MAD

Description

Compute the robust scale estimator $S_n$, an efficient alternative to the MAD.

Usage

Sn(x, constant = 1.1926, finite.corr = missing(constant))

Arguments

x
numeric vector of observations.
constant
number by which the result is multiplied; the default achieves consisteny for normally distributed data.
finite.corr
logical indicating if the finite sample bias correction factor should be applied. Default to TRUE unless constant is specified.

Value

  • a number, the $S_n$ robust scale estimator, scaled to be consistent for $\sigma^2$ and i.i.d. Gaussian observatsions, optionally bias corrected for finite samples.

Details

............ FIXME ........

References

Rousseeuw, P.J. and Croux, C. (1993) Alternatives to the Median Absolute Deviation, Journal of the American Statistical Association 88, 1273--1283.

See Also

mad for the most robust but much less efficient scale estimator; Qn for another even more efficient alternative.

Examples

Run this code
x <- c(1:10, 100+1:9)# 9 outliers out of 19
Sn(x)
Sn(x, c=1)# 9
Sn(x[1:18], c=1)# 9
set.seed(153)
x <- sort(c(rnorm(80), rt(20, df = 1)))
Sn(x)

Run the code above in your browser using DataLab