statsmodels.robust.norms.Hampel.weights#

Hampel.weights(z)[source]#

Hampel weighting function for the IRLS algorithm

The psi function scaled by z.

Parameters:
zarray_like

1d array

Returns:
weightsndarray

The value of the weighting function.

\[\begin{split}\text{weights}(z) = \begin{cases} 1 & \text{if } \lvert z \rvert \le a \\ \frac{a}{\lvert z \rvert} & \text{if } a < \lvert z \rvert \le b \\ \frac{a}{\lvert z \rvert (c - b)} \cdot (c - \lvert z \rvert) & \text{if } b < \lvert z \rvert \le c \\ 0 & \text{if } \lvert z \rvert > c \\ \end{cases}\end{split}\]