The Method of Least Squares
75
Slope = m =
-
(6-12a)
(6-12b)
y Intercept = b = y - mx
(6-13a)
= §Zi_ m 2£i
Use of Calculators in the Method of Least Squares
Equations 6-12a and 6-13a show the slope (m) and intercept (6) in terms more
clearly related to the raw data and to Figure 6-7, but Equations 6-12b and 6-13b
are in a form that is more ideally suited for use with computers and many
calculators. The "b" equations are related to the "a" equations in the same
way that Equation 5-7 is related to Equation 5-3 for the calculation of standard
deviation (s). Some calculators have built-in programs that require nothing
more than the entry of x, and y t through the keyboard, followed by pressing the
"least-square" keys. All programmable calculators can be arranged to accomplish the same thing. Nonprogrammable calculators must have at least four
storage registers to accumulate each of the different kinds of sums, and then
they must be operated with care. It is likely that in the near future most hand
calculators will have built-in least-squares programs. If at all possible, you
should always treat your data (to the extent they can be resolved into a linear
form) by the method of least squares. The following problem illustrates the
application of the method.
PROBLEM:
Using the data of the problem on p 67 that relates thermocouple voltages to
temperature, find the equation of the best-fit line using the method of least
squares. Draw a graph that shows the experimental points and the best-fit line.
SOLUTION:
Using your calculator, enter all of the data pairs (25, 0.23), (50, 1.20), and so on,
considering T to be.v and V to be v. If your calculator has a built-in program or is
programmable, you will have to know the proper procedure for your brand of
calculator—that is, which keys to press to enter the data pairs, and how to obtain a
display of m and b. If your calculator doesn't have the aforementioned capability
but does have at least four storage registers, you can use it to accumulate SAT,, 2*
2
,
£y,, and £x|V|, and then use Equations 6-12b and 6-13b to calculate in and b. You
will have to calculate m before b. Note that in this problem the number of data
pairs (n) is 8. Note also that Zv (
2 is not the same as (Zv,)
2 . Your calculator will show
that m = 0.04074 and b = —0.794, giving the equation for the best-fit line as
V = 0.04074T - 0.794
Précédent

- 82/476

Suivant