Module for Least Squares Lines
Check out the new Numerical Analysis Projects page.
The formulas for linear least squares fitting were independently
derived by German mathematician Johann
Carl Friedrich Gauss (1777-1855) and the French
mathematician Adrien-Marie
Legendre (1752-1833).
Algorithm (Least
Squares Line
Fitting).
To construct the least squares line
that
fits the n data points
.
This is sometimes called the line of regression.
Mathematica Subroutine (Least Squares Line).
![[Graphics:Images/LeastSquaresLineMod_gr_3.gif]](Images/LeastSquaresLineMod_gr_3.gif)
Example 1. Find the
standard "least squares line"
for
the data points
.
Use the subroutine Regression to find the
line. Compare with the line obtained with
Mathematica's Fit procedure.
Solution
1.
Example 2. Find the
other "Least Squares Lines"
for
the data points
.
Use the subroutine Regression to find the line.
2 (a). Use the
computer to find the least squares lines
.
2 (b). Is it the same
as the line we found in Example 1 ? Why?
Solution
2.
Example 3. Find the
point of intersection of the two lines.
Solution
3.
What do you conjecture about the point of intersection of the two
lines
.
Can you prove it ?
Philosophy. What
comes first the chicken or the egg ? Which coordinate is
more sacred, the abscissas or the ordinates. We are always
free to choose which variable is independent when we graph a
line;
or
. When
you realize that two different "least squares lines" can be produced
we are amazed. What should we do ? Which line
should we use ? You must decide a priori which variable is
independent and which is dependent and then proceed. Exercise 3 asked
you to think about the mathematics that is involved with this
"paradox."
Example 4. Computer
derivation of the coefficients a and b for the "normal equations" for
"Least Squares Lines"
.
Solution
4.
Old Lab Project (Least
Squares Lines Least
Squares
Lines). Internet
hyperlinks to an old lab project.
Research Experience for Undergraduates
Least
Squares Lines Least
Squares Lines Internet hyperlinks to web
sites and a bibliography of articles.
Downloads (Least
Squares Lines Least
Squares
Lines).
Download this Mathematica notebook.
(c) John H. Mathews 2003