whm {rlmDataDriven} | R Documentation |
Weighted M-estimation
Description
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.
Usage
whm(yy, xx, var.function = "power", tuning.para = 1.345, ite = 5)
Arguments
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. |
Value
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 |
Author(s)
Aurelien Callens, You-Gan Wang, Benoit Liquet.
References
Carroll, R. J., & Ruppert, D. (1982). Robust estimation in heteroscedastic linear models. The annals of statistics, 429-441.
See Also
rlm
function from package MASS
Examples
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)