|
We have already showed how to use the sum of the squares of the individual
errors to measure how well a function f predicts y from
x. Suppose that we have a set of data points of the form (xi,yi),
for i = 1, 2,
, n.. First consider trying to fit the
data with a constant function (a function of the form y = c).
The best function of this form is the function for which c is the
average of the yi. As an example, consider fitting
the data given in Table 3.2
with a constant function. We would like to find the function of the form
y = c that fits the data best in the least squares sense.
In this case, In order to determine the value of c, we solve the normal equations: We can see from this example that AT A is the number of data points and AT b is the sum of the y values of the data points. Now let's return to a discussion of a general data set. Let fc
represent the constant function that best fits the data in the least squares
sense, and let Sc represent the sum of the squares
of the errors associated with fitting the data set with fc.
Since we may not be satisfied with the error obtained by fitting the data
with a constant function, we will also consider fitting the function with
a linear function of the form
Let fl represent the function of the form (3.12) that best fits the data in the least squares sense, and let Sl represent the sum of the squares of the errors associated with fitting the data set with fl. Every constant function is also a function of the form (3.12). We can see this by letting m = 1 and b = c in (3.12). That means that the function fl must fit the data at least as well as fc does. So the errors in the two fits must satisfy We can use the ratio of these two error measures to see how well linear
changes in the x-values predict changes in y-values. The
ratio We can define the coefficient of determination for fits using other
types of curves. So far, we considered only curves that could be written
in the form (3.12). We call the set of curves satisfying this relationship
a family of curves. If the data seems to follow a different shape,
then we might want to consider fitting the data with curves from a different
family; for example, we might try a the family of cubic functions or even
a family involving exponential functions. Let If the family of curves that we are using contains constant functions
(and most will), then we will have the relationship If we are fitting a set of data in two variables and we select our function from those of the form (3.12), then we are performing what is called simple linear regression. In this case, it is customary to use the notation r instead of R and to refer to r as the correlation coefficient.
|
Send comments on material to Cynthia Lanius
These pages are maintained by Hilena
Vargas (hvargas@rice.edu)
Updated: March 1, 2001
Copyright © 2001 Richard Tapia and Cynthia Lanius