Appendix 2
The Principle of
Least Squares
A2—1 LEAST SQUARES AND SAMPLE MEANS
Consider that we make V measurements, x,, of a quantity that contains ran-
dom fluctuation. Let us calculate that value, X, whose deviations from the x,
‘are minimized in accordance with the principle of least squares. X will be
obtained from the condition
LGj-2)' = minimum
Let ¥ be the mean of the 2, Then
LEA? =L[,-H+E-
= Y@-7 +4) +2, -2- 9]
=0
of, since (3,
De-x = Lew +20]
‘This last expression clearly has a minimum value when ¥ = Y, thus conficm-
ing that the use of the mean as the most probable value for a sample is con
sistent with the principle of least squares.180 ‘THE PRINCIPLE OF LEAST SGUARES APP. 2
A2-2 LEAST-SQUARES FITTED TO STRAIGHT LINES
Consider a set of observations (x,,9,) to which we wish to fit a linear
relation
yeme+b
We assume that the x values are précise, that all the uncertainty is
contained in the y values, and that the weights of the y values are equal.
(For the definition of the concept of “weights,” see Appendix A2-3.) The
deviations of the observed points from the straight line y= mx +8 are of
the form
y,—(omx, +b)
and we wish to have @ minimum value for the sum of the squares of these
quantities. We have
Gy =[-Gm, +P
BP + 2mxb—2mx,y,—2yb
= ppm
If there are N pairs of observations, the sum of the squares, M, is given by
M= LO?
= Dy} +m Dx} + NO? +2mb Dx, -2mY xy; - 28D,
The condition for the best choice of m and b is that ))(6y,)° should be a
minimum. We need, therefore,
au
om
‘The first condition gives
amSx} 42D -2DG,
and the second gives
2Nb+2mY)
29 =0
Solution of the two simultaneous equations for m and b giFES APP. 2 APP.2 THE PRINCIPLE OF LEAST SQUARES 181
zy a (Se)
Standard Gv follows. Consider
1m frst. Because m is a computed value that is calculated in terms of the un-
certain quantities 3, ys, andthe like, we can epply the equation that we had
ancertainty is earlier (Equation 3-9) for the standard deviation of a computed value, z, that
0 fit a linear les
ues are equal. | is a function of variables, x, y, and so on. It was
x A2-3.) The
mx +b are (ary y
Wfaseof (Z)s-(Z}s-
ax) ay
| We apply this result to our case by noting that the x and y of the formula are
the yj, y2, and so on that appear in the expression for m. We can write,
therfore,
siz (2) s (2) +
ay, %,)
‘ow, in making ur set of measurements ofthe x and y values, we would not
tormully have teasured explcly the standard deviation foreach y value. In
the absence ofthese we assume thatthe values of the various scan be re-
‘ Placed by & quantity based on the scatter of they values about the line whose
wry, rm and b valves we have calculated. These intervals, 6y, have a standard de-
Wiation whose value (zquation 6-5) was
Loy
N-2
and this isthe Value that we shall use in place of all the separate Sy, Sp and
| $0 on, Justification of the term N’—2 is not attempted here. It is associated
with the fact that the 8y; are not independent but are connected by the
existence of the best line that is specified by the values of m and b, The
equation for the standard deviation ofthe slope can therefore be written
uares of these
is given by
}? should be a
S=