# Lecture 7 Some Advanced Topics using Propagation of Errors and Least Squares Fitting

Error on the mean (review from Lecture 4)
l

Question: If we have a set of measurements of the same quantity: x1 ± s 1 x2 ± s 2 ... x n ± s n u What's the best way to combine these measurements? u How to calculate the variance once we combine the measurements? u Assuming Gaussian statistics, the Maximum Likelihood Methods combine the measurements as: n Â xi / s i2 x = i=1 weighted average n 2 Â1/ s i
u
2 2 2 If all the variances ( s 1 = s 2 = ...s n ) are the same: 1 n x = Â xi unweighted average n i=1 The variance†of the weighted average can be calculated using propagation of errors: 2 nÈ ∂ ˘ n n 1/ s i4 1 2 2 s x = Â Í x˙ s i = Â s i2 = Â1/ s i2 2 2 Èn i=1Î∂xi ˚ i=1È n 2˘ 2 ˘ i=1 Í Â1/ s i ˙ Í Â1/ s i ˙ Îi=1 ˚ Îi=1 ˚ 1 s2 = n sx is the error in the weighted mean x 2 Â1/ s i

i=1

u

i=1

K.K. Gan

L7: Some Advanced Topics

1

( Â xi )2 K. n Previously we showed that the solution for a and b is: n n n n n n n 2 n Â xi yi . + ignore any uncertainty associated with x.( Â xi ) n Â xi . we did not discuss two important issues: u How to estimate the uncertainties on our slope and intercept obtained from a LSQF? u How to apply the LSQF when we have a non-linear function? Estimation of Errors from a LSQF u Assume we have data points that lie on a straight line: y = a + bx n Assume we have n measurements of y's. However. n Assume that x is known much more accurately than y. Gan i=1 i=1 L7: Some Advanced Topics i=1 i=1 2 † .Â xi yi Â xi i=1 i=1 i=1 i=1 a = i=1 i=1 and b = i=1n n n n 2 2 2 n Â xi .K. n Don't confuse the error in the mean (sx) with the standard deviation of the distribution (s)! n If we make more measurements + the standard deviation (s) of the distribution remains the same + the error in the mean (sx) decreases More on Least Squares Fit (LSQF) l l In Lec 5. we discussed how we can fit our data points to a linear function (straight line) and get the "best" estimate of the slope and intercept.u † If all the variances are the same: n s2 2 2 2 Lecture 4 s x = 1/ Â1/ s i = 1/[n / s ] = n i=1 + The error in the mean (sx) gets smaller as the number of measurements (n) increases.Â xi Â yi Â yi Â xi . n For simplicity. assume that each y measurement has the same error s.

K.( Â xi )2 i=1 i=1 n n n Ê n 2 ˆ2 Ê n 2 2 2 n ˆ ( Â x j ) + xi ( Â x j )2 .( Â xi )2 )2 i i ˜ Á Á ˜ i=1 i=1 i=1 Ë i=1 ¯ Ë ¯ † K. Gan L7: Some Advanced Topics 3 .xi Â x j ˜ j nÁ nÁ j=1 j=1 j=1 j=1 ˜ 2 2 Á j=1 2 Á j=1 ˜ =s Â sa = s Â n n n n ˜ 2 i=1Á n Â x 2 .( Â x )2 ˜ i=1Á (n Â xi . 2 2 Ê ∂Q ˆÊ ∂Q ˆ 2 2 Ê ∂Q ˆ 2 Ê ∂Q ˆ s Q = s x Á ˜ + s y Á ˜ + 2s xy Á ˜Á ˜ Ë ∂x ¯ Ë ∂x ¯Ë ∂y ¯ Ë ∂y ¯ H Assumed that each measurement is independent of each other: 2 sQ 2 2 2 Ê ∂Q ˆ 2 Ê ∂Q ˆ = s xÁ ˜ +s yÁ ˜ † Ë ∂x ¯ Ë ∂y ¯ 2 n 2 sa 2 2 Ê ∂a ˆ = Â s yi Á ˜ Ë ∂yi ¯ i=1 n n n Ê ∂a ˆ2 = s ÂÁ ˜ i=1Ë ∂yi ¯ n n 2 Â x j .xi Â x j n n i=1 n j=1 j=1 n j=1 n ∂a ∂ = ∂yi ∂yi 2 Â yi Â x j .Â xi yi Â x j i=1 n Â xi2 .n Since a and b are functions of the measurements (yi's) + use the Propagation of Errors technique to estimate sa and sb.( Â xi )2 i=1 i=1 j=1 n = n Â xi2 .2xi Â x j Â x 2 ˜ Â x j .

( Â x )2 ˜ i=1Á n Â x 2 .Â xi ( Â x j )2 j=1 i=1 j=1 n n (n Â xi2 .2( Â x j ) Â x 2 j j=1 i=1 j=1 j=1 j=1 2 =s =s2 n n (n Â xi2 .K.n( Â x j )2 j=1 = s 2 j=1 n n (n Â xi2 .( Â xi )2 )2 i=1 i=1 2 n n n n n 2 2 2 2 2 n( Â x j ) + Â xi ( Â x j ) .( Â xi )2 i=1 i=1 n n n 2 2 2 n( Â x j ) .( Â xi )2 )2 i=1 i=1 n K.Â xi Â yi ˜ 2 n n Ê ∂b ˆ nÁ ∂ nÁ Ê ∂b ˆ2 j=1 2 i=1 i=1 i=1 ˜ = s 2 Á ˜ s b = Â s 2i Á ˜ = s 2 Â Á ˜ = s 2 Â Á Â n y n n n Ë ∂yi ¯ i=1 i=1Ë ∂yi ¯ i=1Á ∂yi n Â x 2 .Â x j ˜ n Â xi yi .( Â xi )2 )2 i=1 i=1 n n 2 n Â x j .2 sa 2 sa H † We can find the variance in the slope (b) using exactly the same procedure: n Ê ˆ2 n n n Ê ˆ2 nxi . Gan L7: Some Advanced Topics 4 † .( Â xi )2 )2 i=1 i=1 n n 2 n Â x j .( Â x )2 ˜ Á ˜ i i i i ˜ Á Ë ¯ i=1 i=1 i=1 Ë i=1 ¯ n =s2 2 n n n 2 2 Â x j + n( Â x j ) .2n Â xi Â x j j=1 j=1 i=1 j=1 n n (n Â xi2 .( Â x j )2 n j=1 2 = s Â x 2 j=1 j n n j=1 (n Â x 2 .( Â x )2 )2 i i i=1 i=1 n 2 Âxj variance in the intercept = s 2 n j=1 n n Â xi2 .

a .( Â i2 )2 i=1s i i=1s i i=1s i The above expressions simplify to the “equal variance” case.2 i=1 n . Gan † L7: Some Advanced Topics 5 .yi ) = Â (yi . For example: n 1 n 1 Â 2 = 2 not 2 s s i=1s i K.( Â xi ) i=1 n 2 variance in the slope If we don't know the true value of s.number of parameters (a.2 i=1 H n .2 sb = ns 2 n Â xi2 i=1 n . + estimate variance using the spread between the measurements (yi’s) and the fitted values of y: † 1 n 1 n 2 fit 2 s ª Â (yi .2 = number of degree of freedom = number of data points . r Don't forget to keep track of the “n’s” when factoring out s.bxi )2 n . b) extracted from the data n If each yi measurement has a different error si: † 1 n xi2 2 sa = Â 2 D i=1s i n 2 sb 1 n 1 = Â 2 D i=1s i n weighted slope and intercept H † n x 1 n xi2 D = Â 2 Â 2 .K.

Gan L7: Some Advanced Topics 6 . for example. K. n t is the lifetime of the substance. n Example: functions that are non-linear in the parameter t: y = A + x /t y = A + xt 2 † y = Ae-x / t H These functions are linear in the parameters A. u The problem with most non-linear functions is that we cannot write down a solution for the parameters in a closed form using. the techniques of linear algebra (i.e.K. n Sometimes by a change of variable(s) we can turn a non-linear problem into a linear one.Dx r A linear problem in the parameters C and D! r In fact its just a straight line! + To measure the lifetime t (Lab 6) we first fit for D and then transform D into t. a non-linear function is a function where one or more of the parameters that we are trying to determine (e. b from the straight line fit) is raised to a power other than 1.g. n N0 is the amount of the substance at the beginning of the experiment (t = 0). Fit the following data to find N and t: u 0 -t / t N = N0e n N represents the amount of the substance present at time t. †Example: Decay of a radioactive substance. † n Usually non-linear problems are solved numerically using a computer. H Example: take the natural log of both sides of the above exponential equation: ln y = ln A .l LSQF with non-linear functions: u For our purposes.x / t = C . matrices). a.

i ti Ni yi = ln Ni 1 0 106 4.5 Y(x) lnN(t) 4 3.638 9 120 37 3.80 sec n The intercept is given by: C = 4. Gan t L7: Some Advanced Topics 7 .091 n Â xi yi .290 7 90 49 3.773¥ 675 = 0.93518 † 4.5 3 -20 0 20 40 60 x 80 100 120 140 K.40.611 10 135 22 3.(675) t = 1/ D = 96.Â yi Â xi D = -b = i=1 i=1 n 2 n Â xi .663 n i=1 n 2 15 80 4.585 n 4 45 75 4.77 = ln A or A = 117.010331x R= 0.K.01033 2 10 ¥ 64125 .304 6 75 73 4.7746 + -0.41.317 5 60 74 4.892 8 105 38 3.382 n 3 30 98 4.( Â xi )2 i=1 i=1 =- 10 ¥ 2560.9 5 y = 4.

00903 t = -1/b = 1/0. a = 4. n The uncertainty in the number of radioactive decays is governed by Poisson statistics.005 ¥10 -3 = 12.3 (∂t /∂b ) ﬁ s t = s b 1/ b = -3 2 (9.9 i -( i )2 i -( i )2 Â 2Â 2 Â 2 Â 2Â 2 Â 2 s i i=1s i si i=1 i=1 i=1s i i=1s i i=1s i H If all the s's are the same then the above expressions are identical to the unweighted case. Gan L7: Some Advanced Topics 8 † . 198 a = i=1 i i=1 i 2 i=1 i i=1 i and b = i=1 i i=1 i 2 i=1 i i=1 i n 1 n x n x n 1 n x n x and Problem 8.03¥10 ) The experimentally determined lifetime is t = 110.K. n The number of counts Ni in a bin is assumed to be the average (m) of a Poisson distribution: m = Ni = Variance n The variance of yi (= ln Ni) can be calculated using propagation of errors: 2 2 2 2 s 2 = s N (∂y / ∂N ) = (N)(∂ ln N / ∂N ) = (N)(1/ N ) = 1/ N y n The slope and intercept from a straight line fit that includes uncertainties in the data points: n y n x2 n x y n x n 1 n x y n x n y i i i i i i i Â 2Â 2 Â 2 Â 2 Â 2 Â 2 Â i2 Â i2 s s s s s s s s Taylor P.u † † † Example: Find the values A and t taking into account the uncertainties in the data points.7 sec n To calculate the error on the lifetime.3 sec.725 and b = -0.00903 = 110.7 ± 12. we first must calculate the error on b: n 1 Â 2 652 i=1s i 2 sb = = = 1.01¥10 -6 n 1 n x2 n x 652 ¥ 2684700 . 2 st 2 = sb 2 ( 2 ) + K.(33240)2 i -( i )2 Â 2Â 2 Â 2 i=1s i i=1s i i=1s i 1.

Sign up to vote on this title