Function for the computation of asymmetric median absolute deviation (kMAD) It coincides with ordinary median absolute deviation (MAD) for \(k=1\).
kMAD(x,k,...)
# S4 method for numeric,numeric
kMAD(x, k = 1, na.rm = TRUE,
eps = .Machine$double.eps, ... )
# S4 method for UnivariateDistribution,numeric
kMAD(x, k = 1, up = NULL, ... )
a numeric vector or a distribution.
numeric; tunning parameter for asymmetrical MAD; has to be of length 1 and larger than 1.
logical; if TRUE
then NA
values are stripped from x
before computation takes place.
numeric; accuracy up to which to state equality of two numeric values
numeric; upper bound for search interval; important in distributions without left/right endpoint.
additional arguments for other functions; not used so far;
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de, Nataliya Horbenko nhorbenko@gmail.com
For kMAD (asymmetrial MAD) is a root of the equation:
$$\mathop{\rm kMAD}(F,k) = \inf\{t>0\;\mid \;F(m+kt)-F(m-t)\ge 1/2 \}$$,
where F
is the cumulative distribution function, m
is the median of F
.
Ruckdeschel, P., Horbenko, N. (2010): Robustness Properties for Generalized Pareto Distributions. ITWM Report 182.
x <- rnorm(100)
kMAD(x,k=10)
kMAD(Norm(),k=10)
Run the code above in your browser using DataLab