L1pack (version 0.38.19)

l1fit: Minimum absolute residual (L1) regression

Description

Performs an L1 regression on a matrix of explanatory variables and a vector of responses.

Usage

l1fit(x, y, intercept = TRUE, tolerance = 1e-07, print.it = TRUE)

Arguments

x

vector or matrix of explanatory variables. Each row corresponds to an observation and each column to a variable. The number of rows of x should equal the number of data values in y, and there should be fewer columns than rows. Missing values are not allowed.

y

numeric vector containing the response. Missing values are not allowed.

intercept

logical flag. If TRUE, an intercept term is included in the regression model.

tolerance

numerical value used to test for singularity in the regression.

print.it

logical flag. If TRUE, then warnings about non-unique solutions and rank deficiency are given.

Value

list defining the regression (compare with function lsfit).

coefficients

vector of coefficients.

residuals

residuals from the fit.

message

vector of one or two character strings stating whether a non-unique solution is possible, or if the x matrix was found to be rank deficient.

Details

The Barrodale-Roberts algorithm, which is a specialized linear programming algorithm, is used.

References

Barrodale, I., and Roberts, F.D.K. (1973). An improved algorithm for discrete L1 linear approximations. SIAM Journal of Numerical Analysis 10, 839-848.

Barrodale, I., and Roberts, F.D.K. (1974). Solution of an overdetermined system of equations in the L1 norm. Communications of the ACM 17, 319-320.

Bloomfield, P., and Steiger, W.L. (1983). Least Absolute Deviations: Theory, Applications, and Algorithms. Birkhauser, Boston, Mass.

Examples

Run this code
# NOT RUN {
l1fit(stack.x, stack.loss)
# }

Run the code above in your browser using DataLab