@inproceedings{Lawson1995SolvingLS,
title={Solving least squares problems},
author={C. Lawson and R. Hanson},
booktitle={Classics in applied mathematics},
year={1995}
}

Since the lm function provides a lot of features it is rather complicated. So we are going to instead use the function lsfit as a model. It computes only the coefficient estimates and the residuals. Now would be a good time to read the help file for lsfit. Note that lsfit supports the fitting of multiple least squares models and weighted least squares. Our function will not, hence we can omit the arguments wt, weights and yname. Also, changing tolerances is a little advanced so we will trust… Expand