Fit robust linear regression

`robustfit`

uses iteratively reweighted least squares to compute the coefficients`b`

. The input`wfun`

specifies the weights.`robustfit`

estimates the variance-covariance matrix of the coefficient estimates`stats.covb`

using the formula`inv(X'*X)*stats.s^2`

. This estimate produces the standard error`stats.se`

and correlation`stats.coeffcorr`

.In a linear model, observed values of

`y`

and their residuals are random variables. Residuals have normal distributions with zero mean but with different variances at different values of the predictors. To put residuals on a comparable scale,`robustfit`

“Studentizes” the residuals. That is,`robustfit`

divides the residuals by an estimate of their standard deviation that is independent of their value. Studentized residuals have*t*-distributions with known degrees of freedom.`robustfit`

returns the Studentized residuals in`stats.rstud`

.

`robustfit`

is useful when you simply need the output arguments of the
function or when you want to repeat fitting a model multiple times in a loop. If you need to
investigate a robust fitted regression model further, create a linear regression model object
`LinearModel`

by using `fitlm`

. Set the value for the name-value pair
argument `'RobustOpts'`

to `'on'`

.

[1] DuMouchel, W. H., and F. L.
O'Brien. “Integrating a Robust Option into a Multiple Regression Computing
Environment.” *Computer Science and Statistics*:*
Proceedings of the 21st Symposium on the Interface*. Alexandria, VA: American
Statistical Association, 1989.

[2] Holland, P. W., and R. E. Welsch.
“Robust Regression Using Iteratively Reweighted Least-Squares.”
*Communications in Statistics: Theory and Methods*,
*A6*, 1977, pp. 813–827.

[3] Huber, P. J. *Robust
Statistics*. Hoboken, NJ: John Wiley & Sons, Inc., 1981.

[4] Street, J. O., R. J. Carroll, and
D. Ruppert. “A Note on Computing Robust Regression Estimates via Iteratively Reweighted
Least Squares.” *The American Statistician*. Vol. 42, 1988, pp.
152–154.

`LinearModel`

| `fitlm`

| `regress`

| `robustdemo`