statsmodels.robust.norms.Hampel.weights

Hampel.weights(z)[source]

Hampel weighting function for the IRLS algorithm.

The psi function scaled by z.

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

1d array

Returns:
weightsndarray

The value of the weighting function.