statsmodels.robust.norms.Hampel.psi

Hampel.psi(z)[source]

The psi function for Hampel’s estimator.

The analytic derivative of rho.

\[\begin{split}\psi(z) = \begin{cases} z & \text{for } |z| \le a \\ a \cdot \text{sgn}(z) & \text{for } a < |z| \le b \\ a \cdot \text{sgn}(z) \frac{c - |z|}{c - b} & \text{for } b < |z| \le c \\ 0 & \text{for } |z| > c \end{cases}\end{split}\]
Parameters:
zarray_like

1d array

Returns:
psindarray

The value of the psi function.