Lecture 7 Some Advanced Topics using Propagation of

advertisement

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: u x

1

± s

1 x

2

± s

2

... x n

± s n

What's the best way to combine these measurements?

u

How to calculate the variance once we combine the measurements?

u u u

Assuming Gaussian statistics, the Maximum Likelihood Methods combine the measurements as: n

 x i

/ s i

2 x = i = 1 n

 1/ weighted average s i

2 i = 1

If all the variances ( ) are the same: x =

The variance of the weighted average can be calculated using propagation of errors: s

2 x

1 n

= n

 i = 1 x i n

 i = 1

È

Í

Î

∂ x i x

˘

˙

˚

2 s i

2 unweighted average

= n 1/

 i = 1

È

Î n

 i = 1

1/ s s i

4 i

2

˘

˚

2 s i

2

=

È

Í n

Â

Î i = 1

1/

1 s i

2

˘

˚

2 n

 i = 1

1/ s i

2 s

2 x

=

1 n

 1/ s i = 1 i

2 s x

is the error in the weighted mean

K.K. Gan L7: Some Advanced Topics 1

† u

If all the variances are the same:

+ s

2 x

= n

 s i

2

= 1/[ n / s i = 1

The error in the mean ( s x

2

] = s

2

Lecture 4 n

) gets smaller as the number of measurements ( n ) increases.

n

Don't confuse the error in the mean ( s x

) 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 ( s x

) decreases

More on Least Squares Fit (LSQF)

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. However, we did not discuss two important issues: u

How to estimate the uncertainties on our slope and intercept obtained from a LSQF?

l 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: n y = a + b x

Assume we have n measurements of y 's.

n

For simplicity, assume that each y measurement has the same error s .

n

Assume that x

+ is known much more accurately than ignore any uncertainty associated with x .

y.

n

Previously we showed that the solution for a and b is: a = n

 i = 1 y i n

 n

 x i i = 1 n x n x i

2 i

2

( x y i n

 i = 1 n

 i

) i = 1

2 x i

and b = n

 i = 1 n i y i

n

 i = 1 n x i n x i

2

( x n

 i = 1

 i

)

2 y i

K.K. Gan i = 1 i = 1 i = 1 i = 1

L7: Some Advanced Topics 2

† n

Since a and b are functions of the measurements ( y i

's)

+

H use the Propagation of Errors technique to estimate s s

2

Q

= s

2 x

Ê

Á

Ë

∂ Q

∂ x

ˆ

˜

¯

2

+ s

2 y

Ê

Á

Ë

∂ Q

∂ y

ˆ

˜

¯

2

+ 2 s xy

Ê

Á

Ë

∂ Q

∂ x

ˆ

˜

¯

Ê

Á

Ë

∂ Q

∂ y

ˆ

˜

¯ a

and s b

.

Assumed that each measurement is independent of each other: s

2

Q

= s

2 x

Ê

Á

∂ Q

Ë ∂ x

ˆ

˜

¯

2

+ s

2 y

Ê ∂ Q

Á

Ë ∂ y

ˆ

˜

¯

2 s

2 a

= n

 s i = 1

2 y i

Ê

∂a

Á

Ë ∂ y i

ˆ

˜

¯

2

= s

2 n

 i = 1

Ê

∂a

Á

Ë ∂ y i

ˆ

˜

¯

2

∂a

∂ y i s

2 a

=

∂ y i n

 i = 1 y i n

 j = 1 x

2 j

n

 i = 1 x i y i n

 i

2

( n

 x i

)

2 i = 1 i = 1 n

 j = 1 x j

= s

2 n

 i = 1

Ê

Á

Á

Á n

 j = 1 x

2 j

x i n

 j = 1 x

Á

Ë n

 i = 1 i

2

( n

 i = 1 x i

) j

2

˜

˜

˜

¯

ˆ

˜

2

= n

 x j

2

x i j = 1 n

 j = 1 x j n

 i

2

( n

 x i

)

2 i = 1 i = 1

= s

2 n

 i = 1

Á

Á

Ê

Á

( n

 j = 1 x j

2

)

2

Á

Ë

+ x i

2

( n

 x j

)

2 j = 1

2 x i

( n n x i = 1 i

2

( n

 ) i = 1 x i

2

)

2 n

 j = 1 x j n

 j = 1 x j

2

ˆ

˜

˜

˜

˜

¯

K.K. Gan L7: Some Advanced Topics 3

H s

2 a

= s

2

= s

2 n ( n

Â

2 j

)

2 j = 1 x + n

 i = 1 x i

2

( n

 j = 1 x j

)

2

2( n

 j = 1 x j

)

2

( n

 i

2

( n

 x i

) i = 1 i = 1

2

)

2 n

 j = 1 x j

2 n

 j = 1 x j

2 n n

 j = 1 x

2 j

( n

 j = 1 x j

)

2

( n

 i = 1 i

2

( n

 i = 1 x i

)

2

)

2

= s

2 n ( n

Â

2 j

)

2 j = 1 x n

 i = 1 x i

2

( n

 j

) j = 1 x

2

( n

 i

2

( n

 x i

)

2 i = 1 i = 1

)

2 n

 j = 1 x

2 j s

2 a

= s

2 n

 i

2

( n

 x i

)

2 variance in the intercept i = 1 i = 1

We can find the variance in the slope ( b ) using exactly the same procedure: s

2 b

= n

 i = 1 s

2 y i

Ê

∂b

Á

Ë ∂ y i

ˆ

˜

¯

2

= s

2 n

 i = 1

Ê

∂b

Á

Ë ∂ y i

ˆ

˜

¯

2

= s

2 n

 i = 1

Ê

Á

Á

Á

Ë

∂ y i n n x i = 1 n i = 1 i n x y i

2 i

-

( n

 i = 1 n

 i = 1 x i x i n

 i = 1

)

2 y i

ˆ

˜

2

˜

˜

¯

= s

2 n

 i = 1

Á

Á

Ë

Ê

Á

Á n

 nx i = 1 i i

2

-

( n

 j = 1 x j n

 ) i = 1 x i

2

ˆ

˜

˜

2

˜

˜

¯

K.K. Gan

= s

2 n

2 n

 x j

2

+ n ( n

 x j

)

2 j = 1

2 n

 i n

 x j n

2 n

 x j

2

n ( n

 x

( n

 i = 1 j = 1 i

2

( n

 x )

2 i = 1

)

2 j = 1

= s

2 i i = 1

L7: Some Advanced Topics j = 1 j = 1

( n

 i = 1 i

2

( n

 i = 1 x i

)

2 j

)

)

2

2

4

s

2 b

= n s

2 n

 i

2

( n

 x i

)

2 i = 1 i = 1 variance in the slope n

† n

If we don't know the true value of s,

+ estimate variance using the spread between the measurements ( y i

H s

2

ª

1 n 2 n

 i = 1

( y i

y i fit

)

2

=

1 n 2 n

 i = 1

( y i n 2 = number of degree of freedom

a b x i

)

2

’s) and the fitted values of y :

= number of data points number of parameters ( a, b ) extracted from the data

If each y i s

2 a

measurement has a different error s i

=

1

D n x

 i = 1 s i

2 i

2

: s

2 b

=

1

D n

 i = 1 s

1 i

2 weighted slope and intercept

H

D = n

 i = 1 s

1 i

2 n x

 i = 1 s i

2 i

2

( n

 i = 1 s x i i

2

)

2

The above expressions simplify to the “equal variance” case.

r

Don't forget to keep track of the “ n ’s” when factoring out s . For example: n

 i = 1 s

1 i

2

= s n

2 not s

1

2

L7: Some Advanced Topics 5

l

LSQF with non-linear functions: u

For our purposes, a non-linear function is a function where one or more of the parameters that we are trying to determine (e.g. a , b from the straight line fit) is raised to a power other than 1.

n

Example: functions that are non-linear in the parameter t : y = A + x / t y = A + x t

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, for example, the techniques of linear algebra (i.e. matrices).

n

Usually non-linear problems are solved numerically using a computer.

n

Sometimes by a change of variable(s) we can turn a non-linear problem into a linear one.

H

Example: take the natural log of both sides of the above exponential equation: n n r ln y = ln A x / t = C Dx

A linear problem in the parameters C and D !

r

In fact its just a straight line!

u

Example: Decay of a radioactive substance. Fit the following data to find N

0

and t : n

N

+

= N

To measure the lifetime t (Lab 6) we first fit for D and then transform D into t .

0 e

t / t

N represents the amount of the substance present at time t.

N

0

is the amount of the substance at the beginning of the experiment ( t is the lifetime of the substance.

t = 0).

K.K. Gan L7: Some Advanced Topics 6

† i 1 2 3 4 5 6 7 8 9 t i

N i

0

106

15

80

30

98

45

75

60

74

75

73

90

49

105

38

120

37 n y i

= ln N i

4.663

4.382

4.585

D = b = n n x i = 1 n i = 1 i y i i

2

n

 y i n

 i = 1 n

( x i i = 1 i = 1

 )

2 x i

4.317

4.304

4.290

3.892

= -

10 ¥ 2560.41

40.773

¥ 675

10 ¥ 64125 (675)

2

3.638

= 0.01033

3.611

t = 1/ D = 96.80 sec

The intercept is given by: C = 4.77 = ln A or A = 117.9

y = 4.7746 + -0.010331x R= 0.93518

5

10

135

22

3.091

4.5

4

3.5

K.K. Gan

3

-20 0 20 40 60 80 100 120 140 x t

L7: Some Advanced Topics 7

† u

Example : Find the values A and t taking into account the uncertainties in the data points.

n n n n

The uncertainty in the number of radioactive decays is governed by Poisson statistics.

The number of counts N i m = N i

= Variance

in a bin is assumed to be the average ( m ) of a Poisson distribution:

The variance of y s

2 y a =

= n s

 i = 1 s n

2

N y i i

2

 i = 1 s

(

1 i

2 n

 i = 1 i

∂ y / ∂ N x s

(= ln N i n

 i = 1 x s i

2 i

2

i

2 i

2

)

2

n

Â

) can be calculated using propagation of errors:

= ( N ) i = 1

( x s n i

 i = 1 y i

2 i x s

( i n

∂ ln x

 i = 1 s i

2

)

2 i i

2

N / ∂ N

and

)

2 b =

= ( N ( N )

2

= 1/ N

The slope and intercept from a straight line fit that includes uncertainties in the data points: n

 i = 1 s n

1 i

2

 i = 1 s

1 n

 i = 1 i

2 n x s

 i = 1 i y i

2 x s i i

2 i

2

-

n

 i = 1 s

( n

 x i = 1 i i

2 s x i

 i = 1 s i

2 n

)

2 y i i

2

Taylor P. 198 and Problem 8.9

n

H

If all the s 's are the same then the above expressions are identical to the unweighted case.

a = 4.725 and b = 0.00903

t = -1/ b = 1/0.00903 = 110.7 sec

To calculate the error on the lifetime, we first must calculate the error on n 1 b : s

2 b

= n

 i = 1 s

1 i

2 n

 i = 1 s

 i = 1 s x i

2 i

2

i

2

( n

 i = 1 s x i i

2

)

2

=

652

652 ¥ 2684700 (33240)

2

= 1.01

¥ 10

6 s

2 t

= s

2 b

( ∂t / ∂b )

2

= s b

(

1/ b

2 )

=

1.005

¥ 10

3 fi s t

(9.03

¥ 10

3

)

2

+

The experimentally determined lifetime is t = 110.7 ± 12.3 sec.

K.K. Gan L7: Some Advanced Topics

= 12.3

8

Download