Project 1

Project 2

Project 3

Project 4

Project 5
Linear Algebra I

Section E01, E'00
MINI PROJECT Back to
Project Logo

4. Least Squares



A. Brief Background

In trying to solve a problem, researchers sometimes get data points and seek a function with a graph passing through these points. Usually, the nature of the problem dictates the kind of function they need. For instance, if a car moves at a constant speed and we measure the distance s(t) covered every minute, we expect the graph of s(t) to be a straight line. A high-degree polynomial or an exponential function would be unsuitable for this situation.

Suppose our problem suggests a straight line and we have the points (1,2), (2,4), (3,3). Let y = b + mx be the equation of this line. We want to find the slope m and the y-intercept b. The line should pass through the three point, thus we have:

2 = b + m1 ; 4 = b + m2 ; 3 = b + m3 .

Unfortunately, the resulting linear system in unknowns m and b

is easily seen to be inconsistent. So our problem cannot be solved exactly. The next best thing then is to try to find the straight line that best "fits" these points.

Best fitting may have different meanings, depending on what aspects of the solution we need emphasized. In this case, suppose we want our best line to be such that if d1, d2, and d3 are the errors in the y-direction, and

d1 = 2 - b - m1 ; d2 = 4 - b - m2 ; d3 = 3 - b - m3 ,

then the number

d1^2 + d2^2 + d3^2

is minimum. A solution for m and b that minimizes this sum of the squares of the errors is called a least squares solution.

How could we find the least square solution for the mentioned points and in general? Let we have an inconsistent linear system

Ax = b (*)

where A is an m x n matrix. Because for any n-vector x, the product Ax is never b, the resulting error d

d = b - Ax

is a nonzero m-vector for all n-vectors x. Solving the least squares problem for (*) amounts to finding an n-vectors x~ such that the length of d = b - Ax~ is minimum. Then x~ would be our least square solution.

It is possible to show the following. If A is an m x n matrix, then there are always least squares solutions x~ of Ax = b. Furthermore:

These statements provide a practical procedure for finding x~.

B. Problems

1. A college instructor has been teaching Linear Algebra course for a while. He has collected the following records regarding a B grade in this course:

Term 1 2 3 4 5 6
Percentage of B's 20 25 20 35 45 40

2. A steel producer gather the following data:

Year 1997 1998 1999 2000 2001 2002
Annual Sales
(millions of dollars)
1.2 2.3 3.2 3.6 3.8 5.1

Hint: Represent the years 1997, ..., 2002 as 0, ..., 5 respectively, and let x denote the year. Let y denote the annual sales (in millions of dollars).

C. Helpful Sources

The Course Text, Chapter 8, Section 8.1.
References from Further Readings sub-section, Section 8.1.

[ Back to COURSE MINI PROJECTS ]

[ Project 1 | Project 2 | Project 3 | Project 4 | Project 5 ]

[ Course Information | Home Work Assignments | Mini Projects | Maple Exercises | What's New? ]

[WPI HomePage] Department of Mathematical Sciences Back to Vadim Yakovlev's Professional Page


vadim@wpi.edu
Last modified: Mon, June 5, 2000