E1C04 09/14/2010
14:7:44 Page 143
Example 4.8
The following data are suspected to follow a linear relationship. Find an appropriate equation of the
first-order form.
x (cm)
y (V)
1.0
1.2
2.0
1.9
3.0
3.2
4.0
4.1
5.0
5.3
KNOWN Independent variable x
Dependent measured variable y
N ¼ 5
ASSUMPTIONS Linear relation
FIND y c ¼ a 0 þ a 1 x
SOLUTION We seek a polynomial of the form y c ¼ a 0 þ a 1 x, that minimizes the term
D ¼
X N
i¼1
y i À y c i
À
Á 2
setting the derivatives to zero:
@D
@a 0
¼ 0 ¼ À2
X N
i¼1
y i À a 0 þ a 1 x
ð
Þ
½
Š
(
)
@D
@a 1
¼ 0 ¼ À2
X N
i¼1
y i À a 0 þ a 1 x
ð
Þ
½
Š
(
)
Solving simultaneously for the coefficients a 0 and a 1 yields
a 0 ¼
P x i
P x i y i À
P x
2
i
P y i
P x i
ð
Þ
2 À N
P x 2
i
a 1 ¼
P x i
P y i À N
P x i y i
P x i
ð
Þ
2 À N
P x 2
i
ð4:40Þ
Substituting the data set into Equation 4.40 yields a 0 ¼ 0.02 and a 1 ¼ 1.04. Hence,
y c ¼ 0:02 þ 1:04x V
COMMENT Although the polynomial described by y c is the linear curve fit for this data set, we still
have no idea of how well this curve fits this data set or even if a first-order fit is appropriate. These
questions are addressed below and in Example 4.9.
The LabView program Polynomial_Fit performs a least-squares regression analysis. It allows
the user to enter data points manually or to read data from a file. Other software packages can also do
this processing.
4.6 Regression Analysis 143
Précédent

- 155/605

Suivant