Description Usage Arguments Value Author(s) References See Also Examples
This function performs a weighted M-estimation described by Carroll and Ruppert (1982) with the Huber loss function. First, a M-estimation is performed on the data assuming that the variance is constant. The residuals of this model are used to robustly estimate the variance parameter. Then, a weighted M-estimation with variance as weight is used to update the regression parameters. These steps are iterated until desired convergence.
1 | whm(yy, xx, var.function = "power", tuning.para = 1.345, ite = 5)
|
yy |
Vector representing the response variable |
xx |
Design matrix of the covariates including the intercept in the first column |
var.function |
Assumed function for the variance. " |
tuning.para |
Value of the tuning parameter associated with the loss function. |
ite |
Number of iterations for the estimation procedure. |
The function returns a list including
esti |
Value of the robust estimate |
Std.Error |
Standard error of the robust estimate |
tunning |
Optimum tunning parameter |
R2 |
R-squared value |
Aurelien Callens, You-Gan Wang, Benoit Liquet.
Carroll, R. J., & Ruppert, D. (1982). Robust estimation in heteroscedastic linear models. The annals of statistics, 429-441.
rlm
function from package MASS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(MASS)
data(stackloss)
LS <- lm(stack.loss ~ stack.x)
RB <- rlm(stack.loss ~ stack.x, psi = psi.huber, k = 1.345)
yy <- stack.loss
xx <- model.matrix(stack.loss ~ stack.x)
#With power function as variance function
WHM_p <- whm(yy, xx, var.function = "power", tuning.para = 1.345)
#With exponential function as variance function
WHM_e <- whm(yy, xx, var.function = "exponential", tuning.para = 1.345)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.