lmrob.lar.RdTo compute least absolute residuals (LAR) or “L1” regression,
lmrob.lar implements the routine L1 in Barrodale and Roberts (1974),
which is based on the simplex method of linear programming. It is a
copy of lmRob.lar (in early 2012) from the robust package.
lmrob.lar(x, y, control, ...)numeric matrix for the predictors.
numeric vector for the response.
list as returned by
lmrob.control() .
(unused but needed when called as init(x,y,ctrl, mf)
from lmrob())
This method is used for computing the M-S estimate and typically not to be used on its own.
A description of the Fortran subroutines used can be found in Marazzi
(1993). In the book, the main method is named RILARS.
A list that includes the following components:
The L1-estimate of the coefficient vector
The residual scale estimate (mad)
The residuals
The number of iterations required by the simplex algorithm
Return status (0: optimal, but non unique solution, 1: optimal unique solution)
Convergence status (always TRUE), needed for
lmrob.fit.
Marazzi, A. (1993). Algorithms, routines, and S functions for robust statistics. Wadsworth & Brooks/Cole, Pacific Grove, CA.
rq from CRAN package quantreg.
data(stackloss)
X <- model.matrix(stack.loss ~ . , data = stackloss)
y <- stack.loss
(fm.L1 <- lmrob.lar(X, y))
#> $coefficients
#> [1] -39.68985507 0.83188406 0.57391304 -0.06086957
#>
#> $scale
#> [1] 1.529158
#>
#> $residuals
#> [1] 5.06086957 0.00000000 5.42898551 7.63478261 -1.21739130 -1.79130435
#> [7] -1.00000000 0.00000000 -1.46376812 -0.02028986 0.52753623 0.04057971
#> [13] -2.89855072 -1.80289855 1.18260870 0.00000000 -0.42608696 0.00000000
#> [19] 0.48695652 1.61739130 -9.48115942
#>
#> $iter
#> [1] 7
#>
#> $status
#> [1] 1
#>
#> $converged
#> [1] TRUE
#>
with(fm.L1, stopifnot(converged
, status == 1L
, all.equal(scale, 1.5291576438)
, sum(abs(residuals) < 1e-15) == 4 # p=4 exactly fitted obs.
))