Propagation of uncertainty

From testwiki
Jump to navigation Jump to search

Template:Short description Template:For

In statistics, propagation of uncertainty (or propagation of error) is the effect of variables' uncertainties (or errors, more specifically random errors) on the uncertainty of a function based on them. When the variables are the values of experimental measurements they have uncertainties due to measurement limitations (e.g., instrument precision) which propagate due to the combination of variables in the function.

The uncertainty u can be expressed in a number of ways. It may be defined by the absolute error Template:Math. Uncertainties can also be defined by the relative error Template:Math, which is usually written as a percentage. Most commonly, the uncertainty on a quantity is quantified in terms of the standard deviation, Template:Mvar, which is the positive square root of the variance. The value of a quantity and its error are then expressed as an interval Template:Math. However, the most general way of characterizing uncertainty is by specifying its probability distribution. If the probability distribution of the variable is known or can be assumed, in theory it is possible to get any of its statistics. In particular, it is possible to derive confidence limits to describe the region within which the true value of the variable may be found. For example, the 68% confidence limits for a one-dimensional variable belonging to a normal distribution are approximately ยฑ one standard deviation Template:Math from the central value Template:Math, which means that the region Template:Math will cover the true value in roughly 68% of cases.

If the uncertainties are correlated then covariance must be taken into account. Correlation can arise from two different sources. First, the measurement errors may be correlated. Second, when the underlying values are correlated across a population, the uncertainties in the group averages will be correlated.[1]

In a general context where a nonlinear function modifies the uncertain parameters (correlated or not), the standard tools to propagate uncertainty, and infer resulting quantity probability distribution/statistics, are sampling techniques from the Monte Carlo method family.[2] For very large datasets or complex functions, the calculation of the error propagation may be very expensive so that a surrogate model[3] or a parallel computing strategy[4][5][6] may be necessary.

In some particular cases, the uncertainty propagation calculation can be done through simplistic algebraic procedures. Some of these scenarios are described below.

Linear combinations

Let {fk(x1,x2,,xn)} be a set of m functions, which are linear combinations of n variables x1,x2,,xn with combination coefficients Ak1,Ak2,,Akn,(k=1,,m): fk=โˆ‘i=1nAkixi, or in matrix notation, ๐Ÿ=๐€๐ฑ.

Also let the varianceโ€“covariance matrix of Template:Math be denoted by ๐œฎx and let the mean value be denoted by ๐: ๐œฎx=E[(๐ฑโˆ’๐)โŠ—(๐ฑโˆ’๐)]=(ฯƒ12ฯƒ12ฯƒ13โ‹ฏฯƒ21ฯƒ22ฯƒ23โ‹ฏฯƒ31ฯƒ32ฯƒ32โ‹ฏโ‹ฎโ‹ฎโ‹ฎโ‹ฑ)=(ฮฃ11xฮฃ12xฮฃ13xโ‹ฏฮฃ21xฮฃ22xฮฃ23xโ‹ฏฮฃ31xฮฃ32xฮฃ33xโ‹ฏโ‹ฎโ‹ฎโ‹ฎโ‹ฑ). โŠ— is the outer product.

Then, the varianceโ€“covariance matrix ๐œฎf of f is given by ๐œฎf=E[(๐Ÿโˆ’E[๐Ÿ])โŠ—(๐Ÿโˆ’E[๐Ÿ])]=E[๐€(๐ฑโˆ’๐)โŠ—๐€(๐ฑโˆ’๐)]=๐€E[(๐ฑโˆ’๐)โŠ—(๐ฑโˆ’๐)]๐€T=๐€๐œฎx๐€T.

In component notation, the equation ๐œฎf=๐€๐œฎx๐€T reads ฮฃijf=โˆ‘knโˆ‘lnAikฮฃklxAjl.

This is the most general expression for the propagation of error from one set of variables onto another. When the errors on x are uncorrelated, the general expression simplifies to ฮฃijf=โˆ‘knAikฮฃkxAjk, where ฮฃkx=ฯƒxk2 is the variance of k-th element of the x vector. Note that even though the errors on x may be uncorrelated, the errors on f are in general correlated; in other words, even if ๐œฎx is a diagonal matrix, ๐œฎf is in general a full matrix.

The general expressions for a scalar-valued function f are a little simpler (here a is a row vector): f=โˆ‘inaixi=๐š๐ฑ, ฯƒf2=โˆ‘inโˆ‘jnaiฮฃijxaj=๐š๐œฎx๐šT.

Each covariance term ฯƒij can be expressed in terms of the correlation coefficient ฯij by ฯƒij=ฯijฯƒiฯƒj, so that an alternative expression for the variance of f is ฯƒf2=โˆ‘inai2ฯƒi2+โˆ‘inโˆ‘j(jโ‰ i)naiajฯijฯƒiฯƒj.

In the case that the variables in x are uncorrelated, this simplifies further to ฯƒf2=โˆ‘inai2ฯƒi2.

In the simple case of identical coefficients and variances, we find ฯƒf=n|a|ฯƒ.

For the arithmetic mean, a=1/n, the result is the standard error of the mean: ฯƒf=ฯƒn.

Non-linear combinations

Template:See also When f is a set of non-linear combination of the variables x, an interval propagation could be performed in order to compute intervals which contain all consistent values for the variables. In a probabilistic approach, the function f must usually be linearised by approximation to a first-order Taylor series expansion, though in some cases, exact formulae can be derived that do not depend on the expansion as is the case for the exact variance of products.[7] The Taylor expansion would be: fkโ‰ˆfk0+โˆ‘inโˆ‚fkโˆ‚xixi where โˆ‚fk/โˆ‚xi denotes the partial derivative of fk with respect to the i-th variable, evaluated at the mean value of all components of vector x. Or in matrix notation, fโ‰ˆf0+Jx where J is the Jacobian matrix. Since f0 is a constant it does not contribute to the error on f. Therefore, the propagation of error follows the linear case, above, but replacing the linear coefficients, Aki and Akj by the partial derivatives, โˆ‚fkโˆ‚xi and โˆ‚fkโˆ‚xj. In matrix notation,[8] ฮฃf=JฮฃxJโŠค.

That is, the Jacobian of the function is used to transform the rows and columns of the variance-covariance matrix of the argument. Note this is equivalent to the matrix expression for the linear case with J=A.

Simplification

Neglecting correlations or assuming independent variables yields a common formula among engineers and experimental scientists to calculate error propagation, the variance formula:[9] sf=(โˆ‚fโˆ‚x)2sx2+(โˆ‚fโˆ‚y)2sy2+(โˆ‚fโˆ‚z)2sz2+โ‹ฏ where sf represents the standard deviation of the function f, sx represents the standard deviation of x, sy represents the standard deviation of y, and so forth.

This formula is based on the linear characteristics of the gradient of f and therefore it is a good estimation for the standard deviation of f as long as sx,sy,sz,โ€ฆ are small enough. Specifically, the linear approximation of f has to be close to f inside a neighbourhood of radius sx,sy,sz,โ€ฆ.[10]

Example

Any non-linear differentiable function, f(a,b), of two variables, a and b, can be expanded as fโ‰ˆf0+โˆ‚fโˆ‚aa+โˆ‚fโˆ‚bb. If we take the variance on both sides and use the formula[11] for the variance of a linear combination of variables Var(aX+bY)=a2Var(X)+b2Var(Y)+2abCov(X,Y), then we obtain ฯƒf2โ‰ˆ|โˆ‚fโˆ‚a|2ฯƒa2+|โˆ‚fโˆ‚b|2ฯƒb2+2โˆ‚fโˆ‚aโˆ‚fโˆ‚bฯƒab, where ฯƒf is the standard deviation of the function f, ฯƒa is the standard deviation of a, ฯƒb is the standard deviation of b and ฯƒab=ฯƒaฯƒbฯab is the covariance between a and b.

In the particular case that Template:Nowrap Template:Nowrap Template:Nowrap Then ฯƒf2โ‰ˆb2ฯƒa2+a2ฯƒb2+2abฯƒab or (ฯƒff)2โ‰ˆ(ฯƒaa)2+(ฯƒbb)2+2(ฯƒaa)(ฯƒbb)ฯab where ฯab is the correlation between a and b.

When the variables a and b are uncorrelated, ฯab=0. Then (ฯƒff)2โ‰ˆ(ฯƒaa)2+(ฯƒbb)2.

Caveats and warnings

Error estimates for non-linear functions are biased on account of using a truncated series expansion. The extent of this bias depends on the nature of the function. For example, the bias on the error calculated for log(1+x) increases as x increases, since the expansion to x is a good approximation only when x is near zero.

For highly non-linear functions, there exist five categories of probabilistic approaches for uncertainty propagation;[12] see Uncertainty quantification for details.

Reciprocal and shifted reciprocal

Template:Main In the special case of the inverse or reciprocal 1/B, where B=N(0,1) follows a standard normal distribution, the resulting distribution is a reciprocal standard normal distribution, and there is no definable variance.[13]

However, in the slightly more general case of a shifted reciprocal function 1/(pโˆ’B) for B=N(ฮผ,ฯƒ) following a general normal distribution, then mean and variance statistics do exist in a principal value sense, if the difference between the pole p and the mean ฮผ is real-valued.[14]

Ratios

Template:Main Ratios are also problematic; normal approximations exist under certain conditions.

Example formulae

This table shows the variances and standard deviations of simple functions of the real variables A,B with standard deviations ฯƒA,ฯƒB, covariance ฯƒAB=ฯABฯƒAฯƒB, and correlation ฯAB. The real-valued coefficients a and b are assumed exactly known (deterministic), i.e., ฯƒa=ฯƒb=0.

In the right-hand columns of the table, A and B are expectation values, and f is the value of the function calculated at those values.

Function Variance Standard deviation
f=aA ฯƒf2=a2ฯƒA2 ฯƒf=|a|ฯƒA
f=A+B ฯƒf2=ฯƒA2+ฯƒB2+2ฯƒAB ฯƒf=ฯƒA2+ฯƒB2+2ฯƒAB
f=Aโˆ’B ฯƒf2=ฯƒA2+ฯƒB2โˆ’2ฯƒAB ฯƒf=ฯƒA2+ฯƒB2โˆ’2ฯƒAB
f=aA+bB ฯƒf2=a2ฯƒA2+b2ฯƒB2+2abฯƒAB ฯƒf=a2ฯƒA2+b2ฯƒB2+2abฯƒAB
f=aAโˆ’bB ฯƒf2=a2ฯƒA2+b2ฯƒB2โˆ’2abฯƒAB ฯƒf=a2ฯƒA2+b2ฯƒB2โˆ’2abฯƒAB
f=AB ฯƒf2โ‰ˆf2[(ฯƒAA)2+(ฯƒBB)2+2ฯƒABAB][15][16] ฯƒfโ‰ˆ|f|(ฯƒAA)2+(ฯƒBB)2+2ฯƒABAB
f=AB ฯƒf2โ‰ˆf2[(ฯƒAA)2+(ฯƒBB)2โˆ’2ฯƒABAB][17] ฯƒfโ‰ˆ|f|(ฯƒAA)2+(ฯƒBB)2โˆ’2ฯƒABAB
f=AA+B ฯƒf2โ‰ˆf2(A+B)2(B2A2ฯƒA2+ฯƒB2โˆ’2BAฯƒAB) ฯƒfโ‰ˆ|fA+B|B2A2ฯƒA2+ฯƒB2โˆ’2BAฯƒAB
f=aAb ฯƒf2โ‰ˆ(abAbโˆ’1ฯƒA)2=(fbฯƒAA)2 ฯƒfโ‰ˆ|abAbโˆ’1ฯƒA|=|fbฯƒAA|
f=aln(bA) ฯƒf2โ‰ˆ(aฯƒAA)2[18] ฯƒfโ‰ˆ|aฯƒAA|
f=alog10(bA) ฯƒf2โ‰ˆ(aฯƒAAln(10))2[18] ฯƒfโ‰ˆ|aฯƒAAln(10)|
f=aebA ฯƒf2โ‰ˆf2(bฯƒA)2[19] ฯƒfโ‰ˆ|f||(bฯƒA)|
f=abA ฯƒf2โ‰ˆf2(bln(a)ฯƒA)2 ฯƒfโ‰ˆ|f||bln(a)ฯƒA|
f=asin(bA) ฯƒf2โ‰ˆ[abcos(bA)ฯƒA]2 ฯƒfโ‰ˆ|abcos(bA)ฯƒA|
f=acos(bA) ฯƒf2โ‰ˆ[absin(bA)ฯƒA]2 ฯƒfโ‰ˆ|absin(bA)ฯƒA|
f=atan(bA) ฯƒf2โ‰ˆ[absec2(bA)ฯƒA]2 ฯƒfโ‰ˆ|absec2(bA)ฯƒA|
f=AB ฯƒf2โ‰ˆf2[(BAฯƒA)2+(ln(A)ฯƒB)2+2Bln(A)AฯƒAB] ฯƒfโ‰ˆ|f|(BAฯƒA)2+(ln(A)ฯƒB)2+2Bln(A)AฯƒAB
f=aA2ยฑbB2 ฯƒf2โ‰ˆ(Af)2a2ฯƒA2+(Bf)2b2ฯƒB2ยฑ2abABf2ฯƒAB ฯƒfโ‰ˆ(Af)2a2ฯƒA2+(Bf)2b2ฯƒB2ยฑ2abABf2ฯƒAB

For uncorrelated variables (ฯAB=0, ฯƒAB=0) expressions for more complicated functions can be derived by combining simpler functions. For example, repeated multiplication, assuming no correlation, gives f=ABC;(ฯƒff)2โ‰ˆ(ฯƒAA)2+(ฯƒBB)2+(ฯƒCC)2.

For the case f=AB we also have Goodman's expression[7] for the exact variance: for the uncorrelated case it is V(XY)=E(X)2V(Y)+E(Y)2V(X)+E((Xโˆ’E(X))2(Yโˆ’E(Y))2), and therefore we have ฯƒf2=A2ฯƒB2+B2ฯƒA2+ฯƒA2ฯƒB2.

Effect of correlation on differences

If A and B are uncorrelated, their difference A โˆ’ B will have more variance than either of them. An increasing positive correlation (ฯABโ†’1) will decrease the variance of the difference, converging to zero variance for perfectly correlated variables with the same variance. On the other hand, a negative correlation (ฯABโ†’โˆ’1) will further increase the variance of the difference, compared to the uncorrelated case.

For example, the self-subtraction f = A โˆ’ A has zero variance ฯƒf2=0 only if the variate is perfectly autocorrelated (ฯA=1). If A is uncorrelated, ฯA=0, then the output variance is twice the input variance, ฯƒf2=2ฯƒA2. And if A is perfectly anticorrelated, ฯA=โˆ’1, then the input variance is quadrupled in the output, ฯƒf2=4ฯƒA2 (notice 1โˆ’ฯA=2 for f = aA โˆ’ aA in the table above).

Example calculations

Inverse tangent function

We can calculate the uncertainty propagation for the inverse tangent function as an example of using partial derivatives to propagate error.

Define f(x)=arctan(x), where ฮ”x is the absolute uncertainty on our measurement of Template:Mvar. The derivative of Template:Math with respect to Template:Mvar is dfdx=11+x2.

Therefore, our propagated uncertainty is ฮ”fโ‰ˆฮ”x1+x2, where ฮ”f is the absolute propagated uncertainty.

Resistance measurement

A practical application is an experiment in which one measures current, Template:Mvar, and voltage, Template:Mvar, on a resistor in order to determine the resistance, Template:Mvar, using Ohm's law, Template:Math.

Given the measured variables with uncertainties, Template:Math and Template:Math, and neglecting their possible correlation, the uncertainty in the computed quantity, Template:Math, is:

ฯƒRโ‰ˆฯƒV2(1I)2+ฯƒI2(โˆ’VI2)2=R(ฯƒVV)2+(ฯƒII)2.

See also

Template:Div col

Template:Div col end

References

Template:Reflist

Further reading

Template:Authority control