1
$\begingroup$

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$?

$\endgroup$
  • $\begingroup$ you are confusing the variance of a random variable and the sample variance of observations from a random variable. $\endgroup$ – bdeonovic Jan 8 '17 at 14:41
  • $\begingroup$ 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? $\endgroup$ – Michael R. Chernick Jan 8 '17 at 15:16
  • $\begingroup$ Answer by method 1 is 31/24 approximately equal to 1.29. $\endgroup$ – Michael R. Chernick Jan 8 '17 at 15:31
  • $\begingroup$ 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. $\endgroup$ – Michael R. Chernick Jan 8 '17 at 15:50
  • $\begingroup$ 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. $\endgroup$ – whuber Jan 8 '17 at 17:30
3
$\begingroup$

First, $Cov(A,B)=0.5$.

Second - you get different answers because you have calculated different things.

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$.

$\endgroup$
  • $\begingroup$ This answer seems to contribute to the confusion. The OP is treating A and B as samples from two distributions in both cases. The notation is confusing as is the definition of f. $\endgroup$ – Michael R. Chernick Jan 8 '17 at 15:25
  • $\begingroup$ There is probably nothing wrong with this answer using the assumptions you have made but I think the OP was confused and was trying to compute sample estimates for both methods. The OP made several errors and I was just pointing it out by showing what the OP should have gotten using the formula in Method 1. I also demonstrated that using division by three other conflicting values arise. I think Bill Huber miunderstood what I was doing. $\endgroup$ – Michael R. Chernick Jan 8 '17 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.