wgt_functions | R Documentation |
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)
x |
|
k |
|
a |
|
b |
|
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
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}\}
, 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.
Numerical vector of weights
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2290275")}
Overview (of all implemented functions)
svyreg_huberM
, svyreg_huberGM
,
svyreg_tukeyM
and svyreg_tukeyGM
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.