Learn R Programming

smoothmest (version 0.1-3)

smoothm: Smoothed and unsmoothed 1-d location M-estimators

Description

smoothm is an interface for all the smoothed M-estimators introduced in Hampel, Hennig and Ronchetti (2011) for one-dimensional location, the Huber- and Bisquare-M-estimator and the ML-estimator of the Cauchy distribution, calling all the other functions documented on this page.

Usage

smoothm(y, method="smhuber",
     k=0.862, sn=sqrt(2.046/length(y)),
     tol=1e-06,  s=mad(y), init="median")

sehuber(y, k = 0.862, tol = 1e-06, s=mad(y), init="median")

smhuber(y, k = 0.862, sn=sqrt(2.046/length(y)), tol = 1e-06, s=mad(y), smmed=FALSE, init="median")

mbisquare(y, k=4.685, tol = 1e-06, s=mad(y), init="median")

smbisquare(y, k=4.685, tol = 1e-06, sn=sqrt(1.0526/length(y)), s=mad(y), init="median")

mlcauchy(y, tol = 1e-06, s=mad(y))

smcauchy(y, tol = 1e-06, sn=sqrt(2/length(y)), s=mad(y))

Arguments

y

numeric vector. Data set.

method

one of "huber", "smhuber", "bisquare", "smbisquare", "cauchy", "smcauchy", "smmed". See details.

k

numeric. Tuning constant. This is used for method one of "huber", "smhuber", "bisquare", "smbisquare" in smoothm and the corresponding functions. Tuning constants are defined for the Huber- and Bisquare M-estimator as in Maronna et al. (2006). The default values refer to a Huber M-estimator which is optimal under 20% contamination (0.862) and to a Bisquare M-estimator with 95% efficiency under the Gaussian model (4.685).

sn

numeric. This is used for method one of "smhuber", "smbisquare", "smcauchy", "smmed". This is the smoothing standard error \(\sigma_n\) in Hampel et al. (2011) depending on the sample size and the asymptotic variance of the base estimator. The default value of smoothm and smhuber is based on a Huber estimator with k=0.862 under Huber's least favourable distribution for which it is ML. The default value of smbisquare is based on the Bisquare estimator with k=4.685 under the Gaussian distribution. The default value of smcauchy is based on the Cauchy ML estimator under the Cauchy distribution. A value that can be used for the smoothed median is sqrt(1.056/length(y)), which is based on the median under the double exponential (Laplace) distribution with 1.4826 MAD=1. Note that the distributional "assumptions" for these choices are by no means critical; they should work well under many other distributions as well.

tol

numeric. Stopping criterion for algorithms (absolute difference between two successive values).

s

numeric. Estimated or assumed scale/standard deviation.

init

"median" or "mean". Initial estimator for iteration. Ignored if method=="cauchy" or "smcauchy".

smmed

logical. If FALSE, the smoothed Huber estimator is computed, otherwise the smoothed median by smhuber.

Value

A list with components

mu

the location estimator.

method

see above.

k

see above.

sn

see above.

tol

see above.

s

see above.

Details

The following estimators can be computed (some computational details are given in Hampel et al. 2011):

Huber estimator.

method="huber" and function sehuber compute the standard Huber estimator (Huber and Ronchetti 2009). The only differences from huber are that s and init can be specified and that the default k is different.

Smoothed Huber estimator.

method="smhuber" and function smhuber compute the smoothed Huber estimator (Hampel et al. 2011).

Bisquare estimator.

method="bisquare" and function bisquare compute the bisquare M-estimator (Maronna et al. 2006). This uses psi.bisquare.

Smoothed bisquare estimator.

method="smbisquare" and function smbisquare compute the smoothed bisquare M-estimator (Hampel et al. 2011). This uses psi.bisquare

ML estimator for Cauchy distribution.

method="cauchy" and function mlcauchy compute the ML-estimator for the Cauchy distribution.

Smoothed ML estimator for Cauchy distribution.

method="smcauchy" and function smcauchy compute the smoothed ML-estimator for the Cauchy distribution (Hampel et al. 2011).

Smoothed median.

method="smmed" and function smhuber with median=TRUE compute the smoothed median (Hampel et al. 2011).

References

Hampel, F., Hennig, C. and Ronchetti, E. (2011) A smoothing principle for the Huber and other location M-estimators. Computational Statistics and Data Analysis 55, 324-337.

Huber, P. J. and Ronchetti, E. (2009) Robust Statistics (2nd ed.). Wiley, New York.

Maronna, A.R., Martin, D.R., Yohai, V.J. (2006). Robust Statistics: Theory and Methods. Wiley, New York

See Also

pitman, huber, rlm

Examples

Run this code
# NOT RUN {
  library(MASS)
  set.seed(10001)
  y <- rdoublex(7)
  median(y)
  huber(y)$mu
  smoothm(y)$mu
  smoothm(y,method="huber")$mu
  smoothm(y,method="bisquare",k=4.685)$mu
  smoothm(y,method="smbisquare",k=4.685,sn=sqrt(1.0526/7))$mu
  smoothm(y,method="cauchy")$mu
  smoothm(y,method="smcauchy",sn=sqrt(2/7))$mu
  smoothm(y,method="smmed",sn=sqrt(1.0526/7))$mu
  smoothm(y,method="smmed",sn=sqrt(1.0526/7),init="mean")$mu
# }

Run the code above in your browser using DataLab