Propagation of uncertainty

From testwiki
Revision as of 00:51, 30 November 2024 by imported>Jpleyer (typo: expansive -> expensive; use "large datasets" instead of "expensive data" since the former is unclear)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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=knlnAikΣ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=injnaiΣ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+inj(ji)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: fkfk0+infkxixi 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, ff0+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, fkxi and fkxj. 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=(fx)2sx2+(fy)2sy2+(fz)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 ff0+faa+fbb. 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|fa|2σa2+|fb|2σb2+2fafbσ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 σf2b2σ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/(pB) 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=AB σf2=σA2+σB22σAB σf=σA2+σB22σAB
f=aA+bB σf2=a2σA2+b2σB2+2abσAB σf=a2σA2+b2σB2+2abσAB
f=aAbB σf2=a2σA2+b2σB22abσAB σf=a2σA2+b2σB22abσAB
f=AB σf2f2[(σAA)2+(σBB)2+2σABAB][15][16] σf|f|(σAA)2+(σBB)2+2σABAB
f=AB σf2f2[(σAA)2+(σBB)22σABAB][17] σf|f|(σAA)2+(σBB)22σABAB
f=AA+B σf2f2(A+B)2(B2A2σA2+σB22BAσAB) σf|fA+B|B2A2σA2+σB22BAσAB
f=aAb σf2(abAb1σA)2=(fbσAA)2 σf|abAb1σ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 σf2f2(bσA)2[19] σf|f||(bσA)|
f=abA σf2f2(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 σf2f2[(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((XE(X))2(YE(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 AB will have more variance than either of them. An increasing positive correlation (ρAB1) 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 (ρAB1) will further increase the variance of the difference, compared to the uncorrelated case.

For example, the self-subtraction f = AA 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 = aAaA 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