statsmodels.robust.norms.Hampel#
- class statsmodels.robust.norms.Hampel(a=2.0, b=4.0, c=8.0)[source]#
Hampel function for M-estimation
- Parameters:
- a, b, c
float,optional The tuning constants for Hampel’s function. They have to be scalars that satisfy
0 < a <= b <= c, equal values are allowed. The default values are a, b, c = 2, 4, 8.
- a, b, c
Methods
__call__(z)Return the value of estimator rho applied to an input
- Raises:
TypeErrorIf a, b or c is not a real scalar. Arrays are not accepted.
ValueErrorIf the constants do not satisfy
0 < a <= b <= c, or if one of them is nan.
See also
Notes
Changed in version 0.15.1: The tuning constants are validated. Constants that are not positive or not ordered, and nan values, raise a
ValueErrorinstead of creating a degenerate norm. Array valued constants raise aTypeError, they never worked in the methods of the norm.The tuning constants are validated when the norm is created and in
_set_tuning_param. Plain attribute assignment after construction, for examplenorm.c = value, is not validated.Methods
max_rho()psi(z)The psi function for Hampel's estimator
psi_deriv(z)Derivative of psi function, second derivative of rho function
rho(z)The robust criterion function for Hampel's estimator
weights(z)Hampel weighting function for the IRLS algorithm
Properties