statsmodels.robust.norms.Hampel.weights

Hampel.weights(z)[source]

Hampel weighting function for the IRLS algorithm

The psi function scaled by z

Parameters:z (array-like) – 1d array
Returns:weights – weights(z) = 1 for |z| <= a

weights(z) = a/|z| for a < |z| <= b

weights(z) = a*(c - |z|)/(|z|*(c-b)) for b < |z| <= c

weights(z) = 0 for |z| > c

Return type:array