Skip to content
Tactiverge

Mathematics · also Research methods, Perception and intelligence

Fitting lines with least squares

Least squares finds the straight line that best fits a set of measured points. For each point, the residual is the vertical gap between the measurement and the line. The method picks the slope and intercept that make the sum of the squared residuals as small as possible, and there is a formula that gives them directly. Plotting the residuals afterwards is a check on the model: if they scatter randomly around zero the line is reasonable, but a clear curve or pattern in them suggests a straight line was the wrong choice.

Why it mattersCalibrating a load cell means fitting a line between known weights and the raw readings so that new readings can be converted into newtons.

Learn it

  1. 1Fitting lines with least squaresComputational Engineering · Data analysis