# Propagation of uncertainty through a linear system of equations

If I have a system of equations, $Ax=B$ where the elements of $B$ have been experimentally determined and as such each element has some uncertainty, how would I propagate this to the elements of $x$?

$$\left[\begin{matrix} a_{11} & a_{12}\\ a_{21} & a_{22}\\ \end{matrix}\right] \left[\begin{matrix} x_{11}\\x_{21}\end{matrix}\right]= \left[\begin{matrix} b_{11}\pm\sigma_{b_{11}}\\b_{21}\pm\sigma_{b_{21}}\end{matrix}\right]$$

For instance, in a system like the one above, how do I account for the error in $B$ when solving for $x$? I am trying to find $\sigma_{x_{11}}$ and $\sigma_{x_{12}}$.

Let me translate into statistician. So $B$ is a random variable where $B = \beta + \varepsilon$, with $\text{Var}(\varepsilon)$ = $\Sigma_B$, for $\Sigma_B$ known. An observation is taken, and the observed value of $B$ is $b$.

Assuming $A$ is invertible, the solution of $Ax = b$ is $A^{-1}b$. Let $C = A^{-1}$ for the moment.

$\text{Var}(Cb) = C\,\text{Var}(b)\,C^\top = A^{-1} \Sigma_B (A^{-1})^\top$

If the two components of $b$ are independent, then $\Sigma_B$ is diagonal, with diagonal the squares of your $\sigma$'s. That variance-covariance matrix of $x$ is in general not diagonal, meaning the values are correlated. The square roots of the diagonal elements of $A^{-1} \Sigma_B (A^{-1})^\top$ are the standard deviations of the components of $x$.

This approach applies to more than two dimensions as well.

• Thank for the clear answer, exactly what I was looking for. – johnish Apr 28 '13 at 23:41
• This assumes calculations are exact, of course; if your $A$ is near singular you also might need to worry about how the algorithm by which you calculate that quantity propagates numerical error as well. In general you wouldn't compute that quantity numerically by actual calculation of the explicit inverse of $A$. If your $A$ is far from singular, then in the 2x2 case you should be okay, but if you're writing code, you should look into more stable approaches. – Glen_b Apr 28 '13 at 23:43
• Thank you, this is such a concise and clear answer. I wish all answers on Stack Exchange were of this quality. – PlinyTheElder Dec 6 '18 at 17:40