6.5
Curve Fitting
For the data points
6 10 15 18 20
9 8 5 4 5
Let () = + represent the function whose graph is the line and let 1 2 5 be represented the vertical distances the data points and the
line. We want to position the line so that the sum of squares of these vertical distances is as small as possible. So we will find the values of amd the minimize 21+ 22+ 23+ 24+ 25 Note that 21 = ( (6)− 9)2 But (6) = (6) + = 6 So we get 21 = (6 + − 9)2 22 = (10 + − 8) 2 23 = (15 + − 5) 2 24 = (18 + − 4)2 25 = (20 + − 5)2 Define ( ) = 21+ 22+ 23+ 24+ 25 = (6 + − 9)2+ (10 + − 8)2+ (15 + − 5)2 + (18 + − 4)2+ (20 + − 5)2 Then ( ) = 2170 + 138− 762 and ( ) = 138 + 10− 62 89
Thus, = −117332 ≈ −035 = 3673 332 ≈ 11 Other type: (1) () = +1 (two parameters); (2) () = 2+ +
In this section, we restrict ourselves to functions that have only two pa-rameters.
* Method of Least Squares: For the data points
1 2 3 · · ·
1 2 3 · · ·
Thinking of as a function of suppose we decide to approximate the relationship between and with a two-paramemter function () of a parameter type. Let and represent the parameters. Then the sum
( (1)− 1) 2 + ( (2)− 2) 2 +· · · + ( ()− ) 2
is a function of and which we represent with the symbol ( )
Theorem 73 The function ( ) has exactly one critical point, and the critical point is the lower point.
Example 165 Last year a farmer planted a new type of legume on 5 acres that contained different amounts of fertilizer. Table shows each acre’s yield
Sacks of fertilizer 4 7 12 18 21
Yield, hundreds of pounds 3 7 9 6 4
Solution: = −12671133702692406241 ≈ −005 and
= 118018958825958 ≈ 13
Theorem 74 Suppose the value of that correspond to several values of are known. If is regarded as a function of the least-squares linear function that approximates the relationship between and is
() = − − 2 +
−
− 2
where and are as follows: =the number of data points
=the sum of the coordinates of the data poins =the sum of the coordinates of the data poins =the sum of the squares of the coordinates
=the sum of the products of the coordinates and the corresponding coordinates.
Example 166 For the data points
6 10 15 18 20
9 8 5 4 5
Use above theorem.