l1fit | R Documentation |
Performs an L1 regression on a matrix of explanatory variables and a vector of responses.
l1fit(x, y, intercept = TRUE, tolerance = 1e-07, print.it = TRUE)
x |
vector or matrix of explanatory variables. Each row corresponds to an
observation and each column to a variable. The number of rows of |
y |
numeric vector containing the response. Missing values are not allowed. |
intercept |
logical flag. If |
tolerance |
numerical value used to test for singularity in the regression. |
print.it |
logical flag. If |
The Barrodale-Roberts algorithm, which is a specialized linear programming algorithm, is used.
list defining the regression (compare with function lsfit
).
coefficients |
vector of coefficients. |
residuals |
residuals from the fit. |
message |
character strings stating whether a non-unique solution is possible,
or if the |
Barrodale, I., Roberts, F.D.K. (1973). An improved algorithm for discrete L1 linear approximations. SIAM Journal of Numerical Analysis 10, 839-848.
Barrodale, I., 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., Steiger, W.L. (1983). Least Absolute Deviations: Theory, Applications, and Algorithms. Birkhauser, Boston, Mass.
l1fit(stack.x, stack.loss)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.