Propagation of uncertainty

In statistics, propagation of uncertainty (or propagation of error) is the effect of variables' uncertainties (or errors) on the uncertainty of a function based on them. Mainly, the variables are measured in an experiment, and have uncertainties due to measurement limitations (e.g. instrument precision) which propagate to the result.

The uncertainty is usually defined by the absolute error — a variable that is probable to get the values x±Δx is said to have an uncertainty (or margin of error) of Δx. In other words, for a measured value x, it is probable that the true value lies in the interval [x&minus;Δx, x+Δx]. Uncertainties can also be defined by the relative error Δx/x, which is usually written as a percentage. In many cases it is assumed that the difference between a measured value and the true value is normally distributed, with the mean being the true value and the standard deviation used as the uncertainty of the measurement (although this means the true value will only sit within the error bar 68% of the time).

This article explains how to calculate the uncertainty of a function if the variables' uncertainties are known.

General formula
Let $$f(x_1,x_2,...,x_n)$$ be a function which depends on $$n$$ variables $$x_1,x_2,...,x_n$$. The uncertainty of each variable is given by $$\Delta x_j$$:


 * $$x_j \pm \Delta x_j\, .$$

If the variables are uncorrelated, we can calculate the uncertainty Δf of f that results from the uncertainties of the variables:


 * $$\Delta f = \Delta f \left(x_1, x_2, ..., x_n, \Delta x_1, \Delta x_2, ..., \Delta x_n \right) = \left( \sum_{i=1}^n \left(\frac{\partial f}{\partial x_i}\Delta x_i \right)^2 \right)^{1/2} \, ,$$

where $$\frac{\partial f}{\partial x_j}$$ designates the partial derivative of $$f$$ for the $$j$$-th variable.

If the variables are correlated, the covariance between variable pairs, Ci,k := cov(xi,xk), enters the formula with a double sum over all pairs (i,k):


 * $$\Delta f = \left( \sum_{i=1}^n \sum_{k=1}^n \left(\frac{\partial f}{\partial x_i}\frac{\partial f}{\partial x_k}C_{i,k} \right) \right)^{1/2}\, ,$$

where $$C_{i,i} = var[x_i] = \Delta x_i^2\, .$$

After calculating $$\Delta f$$, we can say that the value of the function with its uncertainty is:


 * $$f \pm \Delta f \, .$$

In terms of variances, $$var[f] = \sum_{i=1}^n \left(\frac{\partial f}{\partial x_i}\right)^2 var[x_i]$$.

This comes from calculating the variance of a first-order Taylor series expansion of f.

Example formulas
This table shows the uncertainty of simple functions, resulting from uncorrelated, normally-distributed real variables $$A\text{, }B\text{, }C\!\,$$ with uncertainties $$\Delta A\text{, }\Delta B\text{, }\Delta C\!\,$$, and precisely-known real-valued constants $$a\text{, }b\text{,}\!\,$$ and $$c\!\,$$.

(Note that some references use $$\Delta A\!\,$$ to mean the variance of $$A\!\,$$. In this table, $$(\Delta A)^2\!\,$$ is the variance of $$A\!\,$$.)


 * {| class="wikitable" style="text-align:center; background: white"

! style="background:#ffdead;" | Function !! colspan="2" style="background:#ffdead;" | Uncertainty
 * $$X = c \cdot A$$ || $$\Delta X = |c| \cdot \Delta A$$
 * $$X = A \pm B$$ || $$\Delta X = \sqrt{(\Delta A)^2 + (\Delta B)^2}$$
 * $$X = A \pm B \pm C \pm \ldots$$ || $$\Delta X = \sqrt{(\Delta A)^2 + (\Delta B)^2 + (\Delta C)^2 + \ldots}$$
 * $$X = A \cdot B \text{ or } X = \frac{A}{B}$$ || $$\frac{\Delta X}{|X|} = \sqrt{\left(\frac{\Delta A}{A}\right)^2 + \left(\frac{\Delta B}{B}\right)^2}$$
 * $$X = A \cdot B \cdot C \cdots$$ || $$\frac{\Delta X}{|X|} = \sqrt{\left(\frac{\Delta A}{A}\right)^2 + \left(\frac{\Delta B}{B}\right)^2 + \left(\frac{\Delta C}{C}\right)^2 + \ldots}$$
 * $$X = A^a \!\,$$ || $$\frac{\Delta X}{|X|} = |a| \frac{\Delta A}{|A|}$$
 * $$X = A^a \cdot B^b \cdot C^c \cdots$$ || $$\frac{\Delta X}{|X|} = \sqrt{a^2\left(\frac{\Delta A}{A}\right)^2 + b^2\left(\frac{\Delta B}{B}\right)^2 + c^2\left(\frac{\Delta C}{C}\right)^2 + \ldots}$$
 * $$X = c \cdot \ln(A/a) \!\,$$ || $$\Delta X = |c| \, \frac{\Delta A}{|A|}$$
 * $$X = c \cdot e^{A/a} \!\,$$ || $$\frac{\Delta X}{|X|} = \frac{\Delta A}{|a|}$$
 * }
 * $$X = A^a \!\,$$ || $$\frac{\Delta X}{|X|} = |a| \frac{\Delta A}{|A|}$$
 * $$X = A^a \cdot B^b \cdot C^c \cdots$$ || $$\frac{\Delta X}{|X|} = \sqrt{a^2\left(\frac{\Delta A}{A}\right)^2 + b^2\left(\frac{\Delta B}{B}\right)^2 + c^2\left(\frac{\Delta C}{C}\right)^2 + \ldots}$$
 * $$X = c \cdot \ln(A/a) \!\,$$ || $$\Delta X = |c| \, \frac{\Delta A}{|A|}$$
 * $$X = c \cdot e^{A/a} \!\,$$ || $$\frac{\Delta X}{|X|} = \frac{\Delta A}{|a|}$$
 * }
 * $$X = c \cdot \ln(A/a) \!\,$$ || $$\Delta X = |c| \, \frac{\Delta A}{|A|}$$
 * $$X = c \cdot e^{A/a} \!\,$$ || $$\frac{\Delta X}{|X|} = \frac{\Delta A}{|a|}$$
 * }
 * }

Partial derivatives
Given $$X=f(A, B, C, \cdots)$$
 * {| class="wikitable" style="text-align:center; background: white"

! style="background:#ffdead;" | Absolute Error !! style="background:#ffdead;" | Variance
 * $$\Delta X=\left |\frac{\partial f}{\partial A}\right |\cdot \Delta A+\left |\frac{\partial f}{\partial B}\right |\cdot \Delta B+\left |\frac{\partial f}{\partial C}\right |\cdot \Delta C+\cdots$$ || $$\sigma_X^2=\left (\frac{\partial f}{\partial A}\sigma_A\right )^2+\left (\frac{\partial f}{\partial B}\sigma_B\right )^2+\left (\frac{\partial f}{\partial C}\sigma_C\right )^2+\cdots$$
 * }
 * }

Example calculation: 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(\theta) = \arctan{\theta}$$,

where $$\sigma_{\theta}$$ is the absolute uncertainty on our measurement of $$\theta$$.

The partial derivative of $$f(\theta)$$ with respect to $$\theta$$ is


 * $$\frac{\partial f}{\partial \theta} = \frac{1}{1+\theta^2}$$.

Therefore, our propagated uncertainty is


 * $$\sigma_{f} = \frac{\sigma_{\theta}}{1+\theta^2}$$,

where $$\sigma_{f}$$ is the absolute propagated uncertainty.

Example application: Resistance measurement
A practical application is an experiment in which one measures current, I, and voltage, V, on a resistor in order to determine the resistance, R, using Ohm's law, $$R = V / I.$$

Given the measured variables with uncertainties, I±ΔI and V±ΔV, the uncertainty in the computed quantity, ΔR is


 * $$\Delta R = \left( \left(\frac{\Delta V}{I}\right)^2+\left(\frac{V}{I^2}\Delta I\right)^2\right)^{1/2} = R\sqrt{\left(\frac{\Delta V}{V}\right)^2+\left(\frac{\Delta I}{I}\right)^2}.$$

Thus, in this simple case, the relative error ΔR/R is simply the square root of the sum of the squares of the two relative errors of the measured variables.