# OPTpsix

OPTpsix computes psi function (derivative of rho function) times x

## Syntax

• psix=OPTpsix(u,c)example

## Description

 psix =OPTpsix(u, c) Plot of psi(x) function (derivative of rho function) times x.

## Examples

expand all

### Plot of psi(x) function (derivative of rho function) times x.

x=-6:0.01:6;
psixOPT=OPTpsix(x,1.2);
plot(x,psixOPT)
xlabel('x','Interpreter','Latex')
ylabel('$\psi (x) \times 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

### psix —Values of the derivative of the optimal psi function multiplied by u, associated to the residuals or Mahalanobis distances for the n units of the sample. n -by- 1 vector

Function OPTpsix transforms vector u as follows $OPTpsix(u,c) = \left\{ \begin{array}{cc} \frac{1}{3.25*c^2} u^2 & |u| \leq 2c \\ (1/3.25) * (-1.944 * \frac{u^2}{c^2} + 1.728 \frac{u^4}{c^4} - 0.312 \frac{x^6}{c^6} + 0.016 \frac{x^8}{c^8} & \qquad 2c \leq |u| \leq 3c \\ 0 & |u|>3c \\ \end{array} \right.$ Remark: function $\psi(x) *x$ has been precalculated because it is used to find the weights in case of Tau estimators