Learn R Programming

LadR (version 1.0.6)

ladfit: Fitting LAD Models

Description

Fitting LAD Models

Usage

ladfit(x, y, intercept = TRUE)

Arguments

x

A matrix or vector with explanatory variables.

y

A vector with response variables.

intercept

TRUE for a model with intercept and FALSE for a model without intercept.

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 {
### Using stackloss data

ladfit(stack.x, stack.loss, intercept =TRUE)
# }

Run the code above in your browser using DataLab