whm: Weighted M-estimation

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/whm.R

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

1
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. "power" function corresponds to √(Var) = σ = φ |x^T β|^{γ} and "exponential" to √(Var) = σ = φ e^{γ |x^T β|}.

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

 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)

rlmDataDriven documentation built on Oct. 3, 2019, 5:04 p.m.