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.
First, enter the data points. This can be done as a list of lists or by using the Input menu and the Create Table submenu.
Using the Create Table submenu, we can get the following display to fill in the numbers.
When we fill in the numbers it will look like
After the data has been entered, compute the formulas for the least squares line.
Let's see how the subroutine Regression works. The command for determining the abscissas is
The command for determining the ordinates is
We can add them up by using the selection
operation
and
the summation found in the "BasisInput Palette" .
If you want to add up their squares then be careful using the power. Sometimes extra parenthesis helps.
Let's peek at the linear system that was solved.
Of course we want a graph.
![[Graphics:../Images/LeastSqLineMod_gr_53.gif]](../Images/LeastSqLineMod_gr_53.gif)
The sum of the residual's squared for this example is:
(c) John H. Mathews 2004