Simple linear regression

Taller people tend to weigh more, but height does not determine weight exactly. We will use that relationship to build a prediction rule and work out what makes one line fit the observations better than another.

16 sections · 15 questions · 4 coding challenges

1 / 16

Which Observation Should an Astronomer Believe?

BOTIE

An astronomer measuring an object's position does not get exactly the same answer every time. Instruments and observations introduce errors. If the measurements disagree, we cannot simply draw a relationship that passes through all of them and expect it to describe the underlying motion.

In 1805, Adrien-Marie Legendre published the method of least squares in an appendix to his work on determining comet orbits. The problem was how to reconcile more observations than could be satisfied exactly. Squaring the remaining discrepancies and adding them gave a definite criterion for choosing among possible fits.

For our first regression, the possible fits are straight lines. Each line predicts a value at each observed input. We measure the vertical gaps, square them so opposing errors cannot cancel, and choose the line with the smallest total. The astronomical problem is much larger, but the principle is the same: use all the observations to find a relationship that compromises between their disagreements.

Sources for this history