# OPTrho

OPTrho computes rho function for optimal weight function

## Syntax

• rhoOPT=OPTrho(u, c)example

## Description

 rhoOPT =OPTrho(u, c) Plot of rho function.

## Examples

expand all

### Plot of rho function.

x=-6:0.01:6;
rhoOPT=OPTrho(x,2);
plot(x,rhoOPT)
xlabel('x','Interpreter','Latex')
ylabel('$\rho (x)$','Interpreter','Latex')

## Input Arguments

### u — scaled residuals or Mahalanobis distances. Vector.

Vector of length n containing residuals or Mahalanobis distances for the n units of the sample

Data Types: single| double

### c — tuning parameter. Scalar.

Scalar greater than 0 which controls the robustness/efficiency of the estimator (beta in regression or mu in the location case ...)

Data Types: single| double

## Output Arguments

### rhoOPT —residuals after rho filter.  Vector

Vector of length n which contains optima rho values associated to the residuals or Mahalanobis distances for the n units of the sample.

Function OPTrho transforms vector u as follows

Yohai and Zamar (1997) showed that the $\rho$ function given above is optimal in the following highly desirable sense: the final M estimate has a breakdown point of one-half and minimizes the maximum bias under contamination distributions (locally for small fraction of contamination), subject to achieving a desidered nominal asymptotic efficiency when the data are Gaussian.

$\label{opt} \rho(x) = \begin{cases} 1.3846 \left( \frac{x}{c} \right)^2 \qquad |x| \leq \frac{2}{3} c \\ 0.5514-2.6917\left( \frac{x}{c} \right)^2+10.7668\left( \frac{x}{c} \right)^4-11.6640\left( \frac{x}{c} \right)^6+4.0375\left( \frac{x}{c} \right)^8 \qquad \frac{2}{3} c < |x| \leq c \\ 1 \qquad |x| >c \end{cases}$

## References

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

Yohai V.J., Zamar R.H. (1997) Optimal locally robust M-estimates of regression. "Journal of Planning and Statistical Inference", Vol. 64, pp. 309-323.