Learn R Programming

rQCC (version 1.20.7)

MAD: Median absolute deviation (MAD)

Description

Calculates the unbiased median absolute deviation (MAD) estimate and the unbiased squared MAD under the normal distribution which are adjusted by the Fisher-consistency and finite-sample unbiasing factors.

Usage

mad.unbiased(x, center = median(x), constant=1.4826, na.rm = FALSE)

mad2.unbiased(x, center = median(x), constant=1.4826, na.rm = FALSE)

Arguments

x

a numeric vector of observations.

center

pptionally, the center: defaults to the median.

constant

correction factor for the Fisher-consistency under the normal distribution

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Value

They return a numeric value.

Details

The unbiased MAD (mad.unbiased) is defined as the mad{stats} divided by \(c_5(n)\), where \(c_5(n)\) is the finite-sample unbiasing factor. Note that \(c_5(n)\) notation is used in Park et. al (2020), and \(c_5(n)\) is calculated using the function c4.factor{rQCC} with method="mad" option. The default value (constant=1.4826) ensures the Fisher-consistency under the normal distribution. Note that the original MAD was proposed by Hampel (1974).

The unbiased squared MAD (mad2.unbiased) is defined as the squared mad{stats} divided by \(w_5(n)\) where \(w_5(n)\) is the finite-sample unbiasing factor. Note that \(w_5(n)\) notation is used in Park et. al (2020), and \(w_5(n)\) is calculated using the function w4.factor{rQCC} with method="mad2" option. The default value (constant=1.4826) ensures the Fisher-consistency under the normal distribution. Note that the square of the conventional MAD is Fisher-consistent for the variance (\(\sigma^2\)) under the normal distribution, but it is not unbiased with a sample of finite size.

References

Park, C., H. Kim, and M. Wang (2020). Investigation of finite-sample properties of robust location and scale estimators. Communications in Statistics - Simulation and Computation, To appear. https://doi.org/10.1080/03610918.2019.1699114

Hampel, F. R. (1974). The influence curve and its role in robust estimation. Journal of the American Statistical Association, 69, 383--393.

See Also

c4.factor{rQCC} for finite-sample unbiasing factor for the standard deviation under the normal distribution.

w4.factor{rQCC} for finite-sample unbiasing factor for the variance under the normal distribution.

shamos{rQCC} for robust Fisher-consistent estimator of the standard deviation under the normal distribution.

shamos.unbiased{rQCC} for robust finite-sample unbiased estimator of the standard deviation under the normal distribution.

mad{stats} for calculating the sample MAD.

finite.breakdown{rQCC} for calculating the finite-sample breakdown point.

Examples

Run this code
# NOT RUN {
x = c(0:10, 50)

# Fisher-consistent MAD, but not unbiased with a finite sample.
mad(x)

# Unbiased MAD.
mad.unbiased(x)

# Fisher-consistent squared MAD, but not unbiased.
mad(x)^2

# Unbiased squared MAD.
mad2.unbiased(x)
# }

Run the code above in your browser using DataLab