As a simple example, consider the three points (-1,7), (1,1), and
(2,4). If we seek to find the values of *a*, *b*, and *c* so that
the quadratic polynomial *g*(*x*) = *ax ^{2}*+

*a*-*b*+*c* = 7

*a*+*b*+*c* = 1

4*a*+2*b*+*c* = 4

The polynomial of degree *n* which passes through *n*+1 data points is
called an interpolating polynomial. An example of how to use Maple to
compute interpolating polynomials is in the **Getting started**
worksheet for this project.

- 1.
- Consider the following data on power consumption in homes, where
*x*is the size of the home in square feet and*y*is the monthly power consumption in kilowatt-hours.*x*, square feet1350 1600 1980 2930 *y*, kilowatt-hours1172 1493 1804 1954 Fit this data with a cubic polynomial, using

*x*for the independent variable. Then use your result to estimate the energy consumption*y*for a house of area 2000 square feet. - 2.
- Suppose you are given only two data points, say (-1,7) and (1,1). Can you find a quadratic polynomial that passes through these points? (The answer should be yes.) If so, is the quadratic unique? Discuss this, both from a geometric and linear algebraic viewpoint.

Suppose that you know that the relationship between two variables is linear. If you collected experimental data and plotted the results, you would expect them to all lie on a straight line. However, because of experimental errors or other problems there is almost never a single line containg all of the data points. In this case, one has to somehow choose the straight line that ``best'' fits the data. In this part of the project, we describe a commonly-used technique, called least squares regression, for getting the ``best'' fit.

Suppose that you have *n* data points (*x*_{i}, *y*_{i}), for ,where . You want to find values of *a* and *b*
so that a linear equation of the form *y*=*ax*+*b* ``best'' fits the
data. The method of least squares starts by defining the following error
function

The next step is to rearrange these two equations so that all terms
involving *a* and *b* are on the left-hand side and all other terms
are on the right-hand side. This produces the following two linear
equations.

- 1.
- The electroencephalogram (EEG) is a device used to measure brain
waves. Neurologists have found that the peak EEG frequency increases
with age. Data from a particular study are given in the table below. Here
*x*is the age of a child in years, and*y*is the average peak EEG frequency of the subjects in the study.x, years y, hertz x, years y, hertz 2 5.33 10 7.28 3 5.75 11 7.06 4 5.80 12 7.60 5 5.60 13 7.45 6 6.00 14 8.23 7 5.78 15 8.50 8 5.90 16 9.38 9 6.23 - 2.
- Interpolating polynomials generally give good results, if only a few data points are available, but they don't always work well if the number of data points gets bigger than three or four. Use the technique from the first part of this project to find the interpolating polynomial that fits the first five data points from the previous exercise. That is, use the data from years 2, 3, 4, 5, and 6. Then plot your interpolating polynomial on the same graph with the data points from the same years. How does this compare to the straight line you obtained above?
- 3.
- Sometimes you want to use a function you have fit to data to extrapolate beyond the data you have. This can work pretty well if you know something about the way your data behaves. Use the interpolating polynomial from the previous exercise to predict the value of the peak EEG frequency at 7 years. Does it agree with the data?
- 4.
- The data on peak EEG frequency as a function of age showed an approximately linear relationship. Use least squares to fit a straight line to the data for years 2, 3, 4, 5, and 6 and compare its prediction at age 7 to the data, and to the prediction of your intrpolating polynomial in the previous exercise.

This document was generated using the
**LaTeX**2`HTML` translator Version 97.1 (release) (July 13th, 1997)

Copyright © 1993, 1994, 1995, 1996, 1997, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

The command line arguments were:

**latex2html** `-split +0 project_template.tex`.

The translation was initiated by William W. Farr on 9/7/1999

9/7/1999