I thought var(a) * var(b) = var(ab) but, it is not? (independent each other)

1.7k Views Asked by At

Let's say that we have two independent variables, r, and g.

If two variable is independent,

Var(r) * Var (g) should be Var(r*g).

However, as shown below, It is not.

I do not understand why Var(r*g) is not Var(r) * Var(g)

r <- rnorm(99999,0,1) # mean of 0, SD of 1
g <- rnorm(99999,0,2)  # mean of 0, SD 0f 2 
rg<-r*g

var(r) [1] 0.9995491

var(g) [1] 3.979795

var(rg) [1] 4.010745

However, 0.9995491 (var (r)) * 3.979795 (var(g)) is NOT 4.010745 (var(rg)). 0.9995491 * 3.979795 is 3.978001 (var(rg)).

Why variance of rg is 4.010745??

The correlation between two is:

cor(r,g) [1] 0.003893786

1

There are 1 best solutions below

0
On BEST ANSWER

If you check, you'll find the means of your two variables aren't zero.

$$\mathrm{var}[XY]=\mathrm{var}[X]\mathrm{var}[Y]$$ if $X$ and $Y$ are independent and have zero mean. The inequality clearly doesn't hold when the means aren't zero: suppose $X=2$ is constant, then $$\mathrm{var}[XY]=\mathrm{var}[2Y]=4\mathrm{var}[Y]$$

If the means are zero and the variables are independent, then $$\mathrm{var}[XY]=E[(XY)^2]-E[XY]^2=E[(XY)^2]-E[X]^2E[Y]^2=E[(XY)^2]$$ and $$E[(XY)^2]=E[X^2]E[Y^2]=(E[X^2]-E[X]^2)(E[Y^2]-E[Y]^2)=\mathrm{var}[X]\mathrm{var}[Y]$$