wgt_functions function

Weight Functions (for the M- and GM-Estimators)

Weight Functions (for the M- and GM-Estimators)

Weight functions associated with the Huber and the Tukey biweight psi-functions; and the weight function of Simpson et al. (1992) for GM-estimators.

huberWgt(x, k = 1.345) tukeyWgt(x, k = 4.685) simpsonWgt(x, a, b)

Arguments

  • x: [numeric vector] data.
  • k: [double] robustness tuning constant (0<k<=Inf0 < k <= Inf).
  • a: [double] robustness tuning constant (0<=a<=Inf0 <= a <= Inf); see details below.
  • b: [double] robustness tuning constant (0<b<=Inf0 < b <= Inf; see details below.

Details

The functions huberWgt and tukeyWgt return the weights associated with the respective psi-function.

The function simpsonWgt is used (in regression GM-estimators) to downweight leverage observations (i.e., outliers in the model's design space). Let d[i]d[i] denote the (robust) squared Mahalanobis distance of the i-th observation. The Simpson et al. (1992) type of weight is defined as min[1,(b/d[i])(a/2)]min[1, (b/d[i])^(a/2)], where a and b are tuning constants.

  • By default, a = 1; this choice implies that the weights are computed on the basis of the robust Mahalanobis distances. Alternative: a = Inf implies a weight of zero for all observations whose (robust) squared Mahalanobis is larger than b.
  • The tuning constants b is a threshold on the distances.

Returns

Numerical vector of weights

References

Simpson, D. G., Ruppert, D. and Carroll, R.J. (1992). On One-Step GM Estimates and Stability of Inferences in Linear Regression. Journal of the American Statistical Association 87 , 439--450. tools:::Rd_expr_doi("10.2307/2290275")

See Also

Overview (of all implemented functions)

svyreg_huberM, svyreg_huberGM, svyreg_tukeyM and svyreg_tukeyGM

Examples

head(flour) # standardized distance from median (copper content in wholemeal flour) x <- flour$copper z <- abs(x - median(x)) / mad(x) # plot of weight functions vs. distance plot(z, huberWgt(z, k = 3), ylim = c(0, 1), xlab = "distance", ylab = "weight") points(z, tukeyWgt(z, k = 6), pch = 2, col = 2) points(z, simpsonWgt(z, a = Inf, b = 3), pch = 3, col = 4) legend("topright", c("huberWgt(k = 3)", "tukeyWgt(k = 6)", "simpsonWgt(a = Inf, b = 3)"), pch = 1:3, col = c(1, 2, 4))
  • Maintainer: Tobias Schoch
  • License: GPL (>= 2)
  • Last published: 2024-08-22