# OPTpsi

OPTpsi computes psi function (derivative of rho function) for optimal weight function

## Syntax

• psiOPT=OPTpsi(u,c)example

## Description

 psiOPT =OPTpsi(u, c) Plot of psi function (derivative of rho function) for optimal weight function.

## Examples

expand all

### Plot of psi function (derivative of rho function) for optimal weight function.

x=-6:0.01:6;
psiOPT=OPTpsi(x,1.2);
plot(x,psiOPT)
xlabel('x','Interpreter','Latex')
ylabel('$\psi (x)$','Interpreter','Latex')

## Input Arguments

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

n x 1 vector containing residuals or Mahalanobis distances for the n units of the sample

Data Types: single| double

### c — tuning parameters. 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

### psiOPT —Values of optimal psi function associated to the residuals or Mahalanobis distances for the n units of the sample. psi function. Vector

function OPTpsi transforms vector u as follows $\psi(x) =\rho' (x) = \begin{cases} \frac{2.7692 x}{c^2} \qquad |x| \leq \frac{2}{3} c \\ -\frac{5.3834 x}{c^2} +\frac{43.0672 x^3}{c^4} -\frac{69.9840 x^5}{c^6} +\frac{32.3 x^7}{c^8} \qquad \frac{2}{3} c < |x| \leq c \\ 0 & \; \vert x \vert > c. \end{cases}$

Remark: Optimal psi-function is almost linear around u = 0 in accordance with Winsor's principle that all distributions are normal in the middle.

This means that $\psi(u)/u$ is approximately constant over the linear region of $\psi$, so the points in that region tend to get equal weight.

## References

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