• No results found

The straight line - the standard error in the slope and intercept

In document Practical Physics (Page 178-183)

In section 4.2 we used the method of leas! squares to calculate the best values of m and c in the equation y ::::: mx +

c,

for a set of measurements consisting of n pairs (XI> yd, (Xl. Y1), . . . , (x,,, y,,) with equal weights. We here derive the expressions for the standard errors D.m and

6c

given in formulae (4.3 1) and (4.32).

Imagine that we keep repeating the measurements so that we have many sets each of n pairs, the measurements being made in such a way that the values Xl >

X2, ' " XII' are the same for <tll ihe sets. In other words, if we look at the first pair XI, YI in all the sets, XI is the same throughout, but the value of YI varies. We shall have a distribution of YIS centred about rl• the true value of y for XI_ Similarly for all the second pairs;

X2

is the same in each case, but the Y2S vary and form a distribution centred on Y2, the true value of Y for X2' And so on for all the pairs.

Since the n pairs have equal weights, the standard deviations of the n distributions are equal and we denote them by u. The situation is shown schematically in Fig. C I. We assume that for each set there is no correlation between the errors in two different ys.

Now the XI, YI values are related by

Vi ': MXi + C. (Cl)

This is the true line, and

M

and

C

are the true values of the slope and intercept.

For each set of n (XI, YI) pairs, we can calculate the values of m and

c

from the expressions given in (4.25) and (4.26). The value of m averaged over all the sets is AI, and the standard error in a single value is t:.m, where

(C2) the average again being taken over all the sets. Similarly the average value of c is

C,

and the standard error of c is t:.c, where

(0) In an actual experiment we only have one set of n(x" YI) values. The values for m and c for this particular set are our best estimates of

M

and

C.

The problem is to obtain estimates for t:.m and t:.c.

The algebra is considerably simplified if we change the independent variable from x to �, given by

� = x - .t", (CA)

Appendix C

y

x, x, X3 x.

x _

Fig. C.I. Repetition of measurements with a fixed set of x values. For each x the values of y (onn a distribution unlred about the true value Y. Since the measure­

ments at different x values have equal weights. the standard devialions of the distributions are

equal-where

Clearly

L ,, � L (X, - X) � O.

The quantity D is defined by

D = E<; = E (x; -X)2 = E x1 - nx2.

The line

y = mx + c becomes

where

y = m(<! + x) + c

= m{ + b, b = mj + c.

(C5)

(C6)

(C7) (Cg)

(C9) (CIO)

(CII) The best values of m and b for a given set of 11 pairs of measurements are obtained from (4.25) and (4.26) with c replaced by b, and x by <. Since L<; = 0, these equations become

m = JjL<;Y" I (CI2)

, 6,

,68 Appendix C From now on the symbols m and b refer to these values.

We see that m is a linear function of the h For a given set {, <!2

m = ])YI + OY2 + " (Cll)

The coefficients of the )lS are the same for all the sets. Since we are assuming that in each set there is no correlation between the errors in two different )'S, we may use (4.17) and (4.18) to calculate Am in terms of the errors in the ys.

B",

So we have

(Am)2 = 02 =

�.

Similarly,

(6b)2 = ! (f2. "

We actually require (6d. which, from (C. l l), is given by (,-,,)' � ("b)' + x'("m)'

(See comment at the end of the Appendix.)

The estimate of u is obtained as follows. If B is the true value of b, then (CI4)

(CIS)

(CI6)

(CI7)

(CIS) (CI9)

(00) Adding these equations for each i gives an expression for B (since L<i = 0).

Similarly, multiplying each one by <!i and then adding gives an expression for M.

Th"

B = ;; L Y/. I

The error in the ith Y reading is c/ = y/ - Yj = Yi - (M{i + B).

(C2I)

(C22) At the point {I, the best line gives m{, + b for the value of y. The residual d, is therefore

d/ = Yi - (m{i + b) (03)

- Fig. C.2. As in the case of a single variable, the errors i!( are not known, but the

Appendi� C Measurement x,.r,

y

Best line

"

(,

Fig. C.2. Diagram showing various quantities defined in Appendix C.

residuals d; are known. The root-mean-square value of d( for the n points is denoted by s as before.

From (C22) and (C.23)

d, � " -f(m - Ml<, + (b -E)I·

From (CI2) and (C21)

1 1

In - M = 'DL.!AY, -Yd = 'DL<;e/.

b -B ::: �I:ei. 1

(C24)

(C25) (06) Insert these expressions for m -M and b -B in (C.24), square both sides, and sum over i. This gives

, , 1 ( )' 1 ( )

'

Ed( = 2:>', - '0 I:<,ei - ;; L.:>'i .

(In summing over i we have again made use of the fact that L<i = 0.)

(C27)

Now average (C.27) over all the sets, remembering that the <, are fixed, and that the average value of e,t!j for j t j is zero. The average of the middle term on

the right-hand side is

'

"

'7' Appendix C

I

((

'

)

'

)

I ,

D L: .. ;t'; ::::: 15 = (7 . (e2S)

Equation (C27) therefore becomes

n(.�) = nu2 _ q1 _ ,,2. (09)

0'

, " ,

0-;::-, (,). (00)

Our best value of (sl) is (l/n)L:dt. From (C.16), (C.19), and (C.30) we have the required the results

("m)' -'-D

L:d,'

n -2 ' (ell)

(.6.C)2 :::::

(!

n + �D

)

L: dl , n -2 (C.32)

The generalization to the case of unequal weights is readily made. If the ilh point has weight WI, the variance of the ilh distribution is put equal to

u2(l:w;)/nw;,

where (7 is a constant. The results given on p. 40 then follow by reasoning closely similar to thai above.

Comment on the dependence of m, c, and b

Equation (el S) assumes that the values of m and b are independent, which may readily be proved by calculating (m - M)(b - B) from (CI2) and (C21). The averdge value of this quantity is seen 10 be zero. However, m and c are not independent, for

( m - M)(c -e» = -x(dm/. (C.ll)

Since m and b(= ji) are independent, while m and c are not, the best line should be written as

y = (m ± dm)(x - x) + b ± db, (C.l4)

and not as

.r = (m ± dm)x + c ± dr. (el5)

Equation (C.34) implies correctly that the error dy in the best value of y at any value of x is given by

(el6) The best line may therefore be regarded as pivoting about the centre of gravity of the points -G in Fig. C.2. The errors in the y value of the pivot and in the slope of the line contribute independently to dy. Equation (C.35) implies incorrectly that the pivot point is H.

Appendix

D

In document Practical Physics (Page 178-183)

Related documents