MAT 331, Spring 2006

Project 1: Fitting a line to data

In this project, you are to fit a line to some data in three different ways. First, by using the “usual” least squares method, which minimizes the sums of the squares of the vertical distances between the data and the line. Then, find the line given by assuming that the x variable may contain the errors, and minimizing the sums of squares of the horizontal distances. Finally, you are to find the line that minimizes the sum of the absolute distances from the points to the line. You should, of course, also have Maple plot the three lines you find along with the data points.

Your project should be written as a paper which explains clearly each step you take and why. In particular, you must give a careful derivation of the functions you minimize— you cannot merely quote the formula for the distance from a point to a line. You can use built-in Maple commands to check your results, but you have to perform step by step calculations. You may, of course, assume that the formula for the distance between two points in the plane is known to the reader. Your paper should be written so that someone who has a good working knowledge of mathematics but has never taken this class will understand what you are doing and why.

You should use Maple (or any another appropriate program of your preference) to do the actual computations. Do not include false starts, mistakes, or irrelevant calculations in your finished product. Pay attention to spelling, grammar, and sentence structure. The expository part of this project counts as much as the actual calculations, and should not be ignored.

You will find a file containing the data points at

http://www.math.sunysb.edu/ moira/sp06/projects/project1data/yourFirstName.txt,

where yourFirstName is the your first name (!). Use Maple’s read command to load this data.