# Calculating variance of $c=a/b$ based on $\sigma_a$ and $\sigma_b$ (error propagation)

My problem concerns the calculation of variances in 2 different ways (the variances calculated in the 2 different ways do not seem to match)...

I have the following data:

For variable $A$: $\;\;\;\;$ 2, 1, 2

For variable $B$: $\;\;\;\;$ 8, 3, 1

Now define variable $f$ as follows: $f:=A/B$, so:

for variable $f$ this becomes: $\;\;\;\;$ $\frac{1}{4}$, $\frac{1}{3}$, 2

Now the variance of $f$ can be computed through 2 methods:

Method 1

$$var(f)= \frac{1}{3-1} \sum_{i=1}^3 (f_i - \bar f)^2,$$ where $\bar f$ is the average of the $f_i$'s (simple computation yields: $\bar f= \frac{31}{36} )$

This gives: $var(f)\approx 0.975$.

Method 2

Through propagation of uncertainty (see: https://en.wikipedia.org/wiki/Propagation_of_uncertainty)

For $f$ the following holds true (see above wiki link): $$var(f)= \sigma_f^2 =f^2 \left( \left(\frac{\sigma_A}{A}\right)^2 +\left(\frac{\sigma_B}{B}\right)^2 - 2 \frac{\sigma_{AB}}{A\times B} \right).$$ where $\sigma_{AB}$ is the covariance.

It is easy to calculate (using the sample variance formula) that: $\sigma_A^2 = \frac{1}{3}\approx 0.3333$ and $\sigma_B^2 =13$.

Furthermore (using Excel), $\sigma_{AB}=Cov(A,B)=\frac{1}{3}\approx 0.3333$.

Substituting $\sigma_{AB}$, $\sigma_{B}$, $\sigma_{B}$ and $A=\bar A$, $B=\bar B$, $f=\bar f$ into the above formula for $var(f)$ yields:

$var(f)\approx 0.617$

My question is: why do I get 2 different numbers for the variance of $f$?

• you are confusing the variance of a random variable and the sample variance of observations from a random variable. Commented Jan 8, 2017 at 14:41
• In the first case you made an error. You got 31/36 for the mean by dividing by 3 when you your equation says to divide by 3-1=2. Also in using A and B you are pairing the three obs in A with the three in B to get the variable for the ratio. Is that consistently done in both computations? Commented Jan 8, 2017 at 15:16
• Answer by method 1 is 31/24 approximately equal to 1.29. Commented Jan 8, 2017 at 15:31
• In method 2 if you use the sample variance formula for A as you claim you should get 0.4787/2 =0.2393 approximately. This is not 1/3 even if you divide by 3. The sample variance for B is 26/2 =13 as the OP get correctly. If division by 3 you would get 26 /3=8.67 approximately. Commented Jan 8, 2017 at 15:50
• You misunderstand Wikipedia by overlooking its repeated references to "approximation" and "estimation": Method 1 gives the variance whereas "propagation of uncertainty" (Method 2) is merely approximate. At the end of a recent post I list the assumptions needed for the approximation to be reliable. In your case, taking the reciprocal $a/b$ is highly nonlinear in the range of values in your example, indicating the approximation is likely to be poor. BTW, I suggest ignoring the comments by @Michael: he makes extensive arithmetical errors.
– whuber
Commented Jan 8, 2017 at 17:30

First, $Cov(A,B)=0.5$.
In first case you calculating variance of $f$ as if it is a random variable. So if we wish to write our $f$ like $Mean\pm Var$ we wold get $0.861\pm 0.975$.
In second case you know that $f$ is not random by itself but created from two random variables with their own errors. Our estimation of $f$ in not $Mean(A/B)$ but $Mean(A)/Mean(B)$ (beacause $E[f(A,B)]\approx E[A]/E[B]$ for ratios). And using same notation as in first ($Mean\pm Var$) and formula for variance of ratio: $$Var(f)=Var(A/B)\approx\frac{E^2[A]}{E^2[B]}\left(\frac{Var(A)}{E^2[A]}+\frac{Var(B)}{E^2[B]} - 2\frac{Cov(A,B)}{E[A]E[B]}\right)$$ we get $f$ as $0.417\pm 0.136$. If we assume A and B to be independent, we can drop covariance term and get $Var(f) = 0.161$.