Linear regression based on minimizing squared distances does not work well when some of the data points are outliers, meaning points far away from a presumptive well-fitting line. We discuss an easy modification that allows linear regression to work well even in the presence of outliers.
June 21, 2017—Jan Segert
Utilities
Utilities to plot a function and to plot a list of points:
Classical least-squares fits a straight line to a set of data points by minimizing the sum of the squared vertical distances. We’ll demonstrate this with an example.
First generate a set of “inlier” points near a fixed straight line: