ABSTRACT
We wish to represent the approximating curve yc as a straight line of the form
1 2y c c xc = + (9.1)
where c1 and c2 are unknown constants to be determined. Let D be the sum of the square of the errors between the approximating line and the actual points. en,
( ) 2
D y y xi c i i
n∑[ ]= − =
(9.2)
y c c xi i i
n∑[ ]= − + =
(9.3)
[ ( )] [ ( )] [ ( )]1 1 2 1 2
1 2 2y c c x y c c x y c c xn n= − + + − + + + − + (9.4)
To obtain the best-›t straight-line approximating function, minimize D by
taking ∂∂ = 01 D c
and ∂∂ = 02 D c
. Taking the partial derivative of Equation (9.3) with
respect to c1 gives
0 2[ ( )][ 1] 1
1 2 D c
y c c x i
i i∑∂∂ = = − + − =
0 1
1y c x nci i
n∑ ∑= − − = =
or
∑ ∑+ =
nc x c yi i
(9.5)
Taking the partial derivative of Equation (9.3) with respect to c2 gives
0 2[ ( )][ ] 2
D c
y c c x xi i i i
n∑∂∂ = = − + − =
x y c x c xi i i
n ∑ ∑∑= − − = ==
◾
or
x c x c x yi i
(9.6)
Equations (9.5) and (9.6) describe a system of two algebraic equations in two unknowns that can be solved by the method of determinants (Cramer’s rule):
2 c
y x
x y x
n x
x x
y x x x y
n x x x
( )( ) ( )( ) ( )( )= =
−
−
(9.7)
2 c
n y
x x y
n x
x x
n x y x y
n x x x
( )( )= = −
−
(9.8)
9.2.2 Best-Fit mth-Degree Polynomial We can generalize this approach for an mth-degree polynomial ›t. In this case, take the approximating curve yc to be
y c c x c x c x c xc 1 2 3 2
m 1 m= + + + + + + (9.9)
where m ≤ n − 1, and n is the number of data points. e measured values are ( , )x yi i for i = 1, 2, …, n.