m_est: M-estimator of location

Description Usage Arguments Details Value References Examples

View source: R/locationEstimators.R

Description

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

Usage

1
2
3
4
5
6
7
8
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 \insertCiteMarMarYoh06robu;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

MarMarYoh06roburobnptests

\insertRef

Hub81roburobnptests

Examples

1
2
3
4
5
6
# Generate random sample
set.seed(108)
x <- rnorm(10)

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

robnptests documentation built on Nov. 8, 2021, 5:07 p.m.