statsmodels.robust.scale.Huber.__call__

method

Huber.__call__(a, mu=None, initscale=None, axis=0)[source]

Compute Huber’s proposal 2 estimate of scale, using an optional initial value of scale and an optional estimate of mu. If mu is supplied, it is not reestimated.

Parameters
aarray

1d array

mufloat or None, optional

If the location mu is supplied then it is not reestimated. Default is None, which means that it is estimated.

initscalefloat or None, optional

A first guess on scale. If initscale is None then the standardized median absolute deviation of a is used.

Notes

Huber minimizes the function

sum(psi((a[i]-mu)/scale)**2)

as a function of (mu, scale), where

psi(x) = np.clip(x, -self.c, self.c)