# ASpsi

ASpsi computes psi function (derivative of rho function) for Andrew's sine function

## Syntax

• psiAS=ASpsi(u,c)example

## Description

 psiAS =ASpsi(u, c) Plot of psi function for Andrew's sine function.

## Examples

expand all

### Plot of psi function for Andrew's sine function.

close all
x=-6:0.01:6;
c=1.5;
psiAS=ASpsi(x,c);
plot(x,psiAS,'LineWidth',2)
xlabel('$u$','Interpreter','Latex')
ylabel('$\psi(u,2)$','Interpreter','Latex','FontSize',14)
hold('on')
ax=axis;
line([-c*pi;-c*pi],[ax(3);0],'LineStyle',':','LineWidth',1)
line([c*pi;c*pi],[ax(3);0],'LineStyle',':','LineWidth',1)

## 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

### psiAS —Tukey's psi associated to the residuals or Mahalanobis distances for the n units of the sample. n -by- 1 vector

Function ASpsi transforms vector u as follows $ASpsi(u)= \left\{ \begin{array}{cc} \sin(u/c) & |u/c| \leq \pi \\ 0 & |u/c|> \pi \\ \end{array} \right.$

Remark: Andrews's 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

Andrews, D.F., Bickel, P.J., Hampel, F.R., Huber, P.J., Rogers, W.H., and Tukey, J.W. (1972), "Robust Estimates of Location: Survey and Advances", Princeton Univ. Press, Princeton, NJ. [p. 203]

Andrews, D. F. (1974). A Robust Method for Multiple Linear Regression, "Technometrics", V. 16, pp. 523-531, https://doi.org/10.1080/00401706.1974.10489233