Lecture 4 Propagation of errors Introduction l
l
†
Example: we measure the current (I) and resistance (R) of a resistor. u Ohm's law: V = IR u If we know the uncertainties (e.g. standard deviations) in I and R, what is the uncertainty in V? Given a functional relationship between several measured variables (x, y, z), Q = f (x, y,z) u What is the uncertainty in Q if the uncertainties in x, y, and z are known? n To answer this question we use a technique called Propagation of Errors. u Usually when we talk about uncertainties in a measured variable such as x, we assume: n the value of x represents the mean of a Gaussian distribution n the uncertainty in x is the standard deviation (s) of the Gaussian distribution n not all measurements can be represented by Gaussian distributions (more on that later)
Propagation of Error Formula l
†
To calculate the variance in Q as a function of the variances in x and y we use the following: 2 2 Ê ∂Q ˆÊ ∂Q ˆ 2 2 Ê ∂Q ˆ 2 Ê ∂Q ˆ s Q = s x Á ˜ + s y Á ˜ + 2s xy Á ˜Á ˜ Ë ∂x ¯ Ë ∂x ¯Ë ∂y ¯ Ë ∂y ¯ u If the variables x and y are uncorrelated (sxy = 0), the last term in the above equation is zero. u Assume we have several measurement of the quantities x (e.g. x1, x2...xN) and y (e.g. y1, y2...yN). n The average of x and y: 1 N 1 N m x =  xi and m y =  yi N i=1 N i=1 K.K. Gan
†
L4: Propagation of Errors
1
define: Qi ≡ f (xi , yi ) Q ≡ f (m x , m y ) evaluated at the average values u expand Qi about the average values: Ê ∂Q ˆ Ê ∂Q ˆ Qi = f (m x , m y ) + (xi - m x )Á ˜ + (yi - m y )Á ˜ + higher order terms Ë ∂x ¯ m Ë ∂y ¯ m x y † u assume the measured values are close to the average values + neglect the higher order terms: Ê ∂Q ˆ Ê ∂Q ˆ Qi - Q = (xi - m x )Á ˜ + (yi - m y )Á ˜ † Ë ∂x ¯ m Ë ∂y ¯ m x u
y
2 sQ
1 N = Â (Qi - Q)2 N i=1 2 2 Ê ∂Q ˆ Ê ∂Q ˆ 1 N 1 N 2 N 2 Ê ∂Q ˆ 2 Ê ∂Q ˆ = Â (xi - m x ) Á ˜ + Â (yi - m y ) Á ˜ + Â (xi - m x )(yi - m y )Á ˜ Á ˜ Ë ∂x ¯mx N i=1 Ë ∂x ¯mx Ë ∂y ¯m N i=1 Ë ∂y ¯m N i=1 y
2 2 Ê ∂Q ˆ = s xÁ ˜ Ë ∂x ¯mx
u
†
Ê ∂Q ˆ Ê ∂Q ˆ 1 N + 2Á ˜ Á ˜ Â (x - m x )(yi - m y ) Ë ∂x ¯mx Ë ∂y ¯m N i=1 i y If the measurements are uncorrelated + the summation in the above equation is zero 2 2 2 2 Ê ∂Q ˆ 2 Ê ∂Q ˆ sQ = s xÁ ˜ +s yÁ ˜ uncorrelated errors Ë ∂x ¯mx Ë ∂y ¯my K.K. Gan
†
2 2 Ê ∂Q ˆ +s yÁ ˜ Ë ∂y ¯my
L4: Propagation of Errors
2
y
u
If x and y are correlated, define sxy as: 1 N s xy = Â (xi - m x )(yi - m y ) N i=1
s Q2
2 2 Ê ∂Q ˆ = s xÁ ˜ Ë ∂x ¯mx
2 2 Ê ∂Q ˆ +s yÁ ˜ Ë ∂y ¯my
Ê ∂Q ˆ Ê ∂Q ˆ + 2Á ˜ Á ˜ s xy Ë ∂x ¯mx Ë ∂y ¯m
correlated errors
y
Example: Power in an electric circuit. P = I2R u Let I = 1.0 ± 0.1 amp and R = 10 ± 1 W † + P = 10 watts u calculate the variance in the power using propagation of errors 2 2 2 2 Ê ∂P ˆ 2 Ê ∂P ˆ s P = s I Á ˜ +s RÁ ˜ = s 2I (2IR)2 + s R2 (I 2 )2 = (0.1)2 (2 ⋅1⋅10)2 + (1)2 (12 )2 = 5 watts2 Ë ∂I ¯I=1 Ë ∂R ¯R=10 + P = 10 ± 2 watts n If the true value of the power was 10 W and we measured it many times with an uncertainty (s) of ± 2 W and Gaussian statistics apply † + 68% of the measurements would lie in the range [8,12] W u Sometimes its convenient to put the above calculation in terms of relative errors: 2 2 Ê 0.1 ˆ2 Ê 1 ˆ2 s P2 s I2 Ê ∂P ˆ s 2R Ê ∂P ˆ 4s 2I s 2R 2 = + = + = 4 + = 0.1 (4 +1) Á ˜ Á ˜ Á ˜ Á ˜ Ë 1 ¯ Ë10 ¯ P 2 P 2 Ë ∂I ¯ P 2 Ë ∂R ¯ I2 R2 n the uncertainty in the current dominates the uncertainty in the power + current must be measured more precisely to greatly reduce the uncertainty in the power l
† K.K. Gan
L4: Propagation of Errors
3
l
Example: The error in the average. u The average of several measurements each with the same uncertainty (s) is given by: 1 m = (x1 + x2 + ...xn ) n
2 2 2 2 2 Ê ∂m ˆ2 Ê 1 ˆ2 2 Ê ∂m ˆ 2 Ê ∂m ˆ 2Ê1 ˆ 2Ê1 ˆ 2Ê1 ˆ = s x Á ˜ + s x Á ˜ + ...s x Á ˜ = s Á ˜ + s Á ˜ + ...s Á ˜ = ns Á ˜ 1 ∂x 2 ∂x n ∂x Ën¯ Ën¯ Ën¯ Ën¯ Ë 1¯ Ë 2¯ Ë n¯ s sm = “error in the mean” n
s m2
+ +
†
n n n
2
We can determine the mean better by combining measurements. The precision only increases as the square root of the number of measurements. Do not confuse sm with s! s is related to the width of the pdf (e.g. Gaussian) that the measurements come from. s does not get smaller as we combine measurements. 100 m = 20.0 sm = 0.3
dN/dy
80 60 40 20
Problem in the Propagation of Errors l
l
0
0 10 In calculating the variance using propagation of errors u we usually assume the error in measured variable (e.g. x) is Gaussian If x is described by a Gaussian distribution u f(x) may not be described by a Gaussian distribution!
K.K. Gan
L4: Propagation of Errors
s = 4.0 20 y
30
40
4
l
What does the standard deviation that we calculate from propagation of errors mean? u Example: The new distribution is Gaussian. n Let y = Ax, with A = a constant and x a Gaussian variable. + my = Amx and sy = Asx n Let the probability distribution for x be Gaussian: Ê y my Á ËA A
p(x, m x , s x )dx =
+
dx =
1
Ê s y ˆ2 2Á ˜ Ë A¯
1 1 dy = e A s y 2p
-
( y-my ) 2 2s y2
y = 2x with x = 10 ± 2 sy = 2sx = 4
80 dN/dy
s x 2p
e
-
e dy = p(y, m y , s y )dy sy 2p A The new probability distribution for y, p(y, my, sy), is also described by a Gaussian.
100
†
1
( x-mx ) 2 2s x2
ˆ2 ˜ ¯
Start with a Gaussian with m = 10, s = 2 Get another Gaussian with m = 20, s = 4
60 40 20 0
0
K.K. Gan
10
20 y
30
40
L4: Propagation of Errors
5
u
Example: When the new distribution is non-Gaussian: y = 2/x. n The transformed probability distribution function for y does not have the form of a Gaussian. 100
y = 2/x with x = 10 ± 2 sy = 2sx /x2
dN/dy
80
Start with a Gaussian with m = 10, s = 2. DO NOT get another Gaussian! Get a pdf with m = 0.2, s = 0.04. This new pdf has longer tails than a Gaussian pdf: Prob(y > my + 5sy) = 5x10-3, for Gaussian ª 3x10-7
60 40 20 0 0.1
0.2
0.3
y
0.4
0.5
0.6
Unphysical situations can arise if we use the propagation of errors results blindly! ! u Example: Suppose we measure the volume of a cylinder: V = pR2L. n Let R = 1 cm exact, and L = 1.0 ± 0.5 cm. n Using propagation of errors: sV = pR2sL = p/2 cm3. V = p ± p/2 cm3 ! n If the error on V (sV) is to be interpreted in the Gaussian sense + finite probability (≈ 3%) that the volume (V) is < 0 since V is only 2s away from than 0! + Clearly this is unphysical! + Care must be taken in interpreting the meaning of sV. l
K.K. Gan
L4: Propagation of Errors
6