m_est: M-estimator of location

View source: R/locationEstimators.R

m_estR Documentation

M-estimator of location

Description

m_est calculates an M-estimate of location and its variance for different psi functions.

Usage

m_est(
  x,
  psi,
  k = robustbase::.Mpsi.tuning.default(psi),
  tol = 1e-06,
  max.it = 15,
  na.rm = FALSE
)

Arguments

x

a (non-empty) numeric vector of data values.

psi

kernel used for optimization. Must be one of "bisquare", "hampel" and "huber". The default is "huber".

k

tuning parameter(s) for the respective kernel function, defaults to parameters implemented in .Mpsi.tuning.default(psi) in the package robustbase.

tol

tolerance for convergence. The default is 1e-06.

max.it

the maximum number of iterations. The default is 15.

na.rm

a logical value indicating whether NA values in x and y should be stripped before the computation proceeds. The default is na.rm = FALSE.

Details

To compute the M-estimate, the iterative algorithm described in \insertCiteMarMarYoh19robu;textualrobnptests is used. The variance is estimated as in \insertCiteHub81robu;textualrobnptests.

If max.it contains decimal places, it is truncated to an integer value.

Value

A named list containing the components:

est

estimated mean.

var

estimated variance.

References

\insertRef

MarMarYoh19roburobnptests

\insertRef

Hub81roburobnptests

Examples


# Generate random sample
set.seed(108)
x <- rnorm(10)

# Computer Huber's M-estimate
m_est(x, psi = "huber")


s-abbas/robTests documentation built on Feb. 20, 2023, 10:14 a.m.