## Usage

 `1` ```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.

## Details

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

## 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.

## 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

 ```1 2 3``` ```### Using stackloss data ladfit(stack.x, stack.loss, intercept =TRUE) ```

### Example output

```\$coefficients
Intercept     Air.Flow   Water.Temp   Acid.Conc.
-39.68985367   0.83188403   0.57391310  -0.06086957

\$minimum
 42.08116

\$fitted.values
 36.939131 37.000000 31.571015 20.365218 19.217392 19.791305 20.000001
 20.000001 16.463769 14.020290 13.472464 12.959421 13.898551 13.802899
  6.817392  7.000001  8.426088  8.000001  8.513044 13.382609 24.481160

\$residuals
  5.0608706  0.0000000  5.4289861  7.6347828 -1.2173911 -1.7913042
 -1.0000000  0.0000000 -1.4637681 -0.0202896  0.5275363  0.0405799
 -2.8985507 -1.8028984  1.1826082  0.0000000 -0.4260873  0.0000000
  0.4869561  1.6173913 -9.4811592

\$rank
 4

\$numIter
 7

\$info
 1
```

LadR documentation built on May 1, 2019, 7:12 p.m.