delicatessen.estimating_equations.basic.ee_mean_robust
- ee_mean_robust(theta, y, k, loss='huber', lower=None, upper=None)
Estimating equation for the (unscaled) robust mean. The estimating equation for the robust mean is
\[\sum_{i=1}^n f_k(Y_i - \theta) = 0\]where \(f_k(x)\) is the corresponding robust loss function. Options for the loss function include: Huber, Tukey’s biweight, Andrew’s Sine, and Hampel. See
robust_loss_function
for further details on the loss functions for the robust mean.- Parameters
theta (ndarray, list, vector) – Theta in the case of the robust mean consists of a single value. Therefore, an initial value like the form of
[0, ]
is should be provided.y (ndarray, vector, list) – 1-dimensional vector of n observed values.
k (int, float) – Tuning or hyperparameter for the chosen loss function. Notice that the choice of hyperparameter depends on the loss function.
loss (str, optional) – Robust loss function to use. Default is
'huber'
. Options include'andrew'
,'hampel'
,'tukey'
.lower (int, float, None, optional) – Lower parameter for the Hampel loss function. This parameter does not impact the other loss functions. Default is
None
.upper (int, float, None, optional) – Upper parameter for the Hampel loss function. This parameter does not impact the other loss functions. Default is
None
.
- Returns
Returns a 1-by-n NumPy array evaluated for the input
theta
andy
.- Return type
array
Examples
Construction of a estimating equation(s) with
ee_mean_robust
should be done similar to the following>>> from delicatessen import MEstimator >>> from delicatessen.estimating_equations import ee_mean_robust
Some generic data to estimate the mean for
>>> y_dat = [-10, 1, 2, 4, 1, 2, 3, 1, 5, 2, 33]
Defining psi, or the stacked estimating equations for Huber’s robust mean
>>> def psi(theta): >>> return ee_mean_robust(theta=theta, y=y_dat, k=9, loss='huber')
Calling the M-estimation procedure
>>> estr = MEstimator(stacked_equations=psi, init=[0, ]) >>> estr.estimate()
Inspecting the parameter estimates, the variance, and the asymptotic variance
>>> estr.theta >>> estr.variance >>> estr.asymptotic_variance
References
Andrews DF. (1974). A robust method for multiple linear regression. Technometrics, 16(4), 523-531.
Beaton AE & Tukey JW (1974). The fitting of power series, meaning polynomials, illustrated on band-spectroscopic data. Technometrics, 16(2), 147-185.
Boos DD, & Stefanski LA. (2013). M-estimation (estimating equations). In Essential Statistical Inference (pp. 297-337). Springer, New York, NY.
Hampel FR. (1971). A general qualitative definition of robustness. The Annals of Mathematical Statistics, 42(6), 1887-1896.
Huber PJ. (1964). Robust Estimation of a Location Parameter. The Annals of Mathematical Statistics, 35(1), 73–101.
Huber PJ, Ronchetti EM. (2009) Robust Statistics 2nd Edition. Wiley. pgs 98-100