How to calculate $V(X+Y)$ with $X$,$Y$ dependent?

1.8k Views Asked by At

I want to calculate the covariance of two dependent variables $X$ and $Y$ and I don't know the value of $V(X+Y)$, that is, the variance of $X+Y$.

I know how the quantities relate to each other:

$$V(X+Y) = V(X) + V(Y) + 2\,\text{cov}(X,Y)$$

but I don't know how to calculate at least one of them without the other. Any tips?

I know the distributions of both $X$ and $Y$ but not the joint distribution.

2

There are 2 best solutions below

3
On

If $X$ and $Y$ are discrete, you can calculate the covariance using the formula $$\textrm{cov}(X,Y)=\sum\sum(x-\mu_X)(y-\mu_Y)f(x,y)$$ where you carry out the sum over the whole domains of both variables. If they are continuous, you may similarly use the formula $$\textrm{cov}(X,Y)=\iint (x-\mu_X)(y-\mu_Y)f(x,y) \,dx\,dy$$ where you again integrate over the whole domain. Both formulas come from the definition of covariance: $$\textrm{cov}(X,Y)=E[(X-\mu_X)(Y-\mu_Y)]$$

Of course, all of this assumes that you know the joint distribution $f(x,y)$. Otherwise, it's possible you don't have enough information to answer the question.

0
On

As you note, $$Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)$$ where $Cov(X,Y)=E(XY)-E(X)E(Y)$. If you know the variables $X$ and $Y$, then you can compute the variance of their sum directly, as $$Var(X+Y)=\sum_{x,y}((x+y)-(E(X)+E(Y))^{2}P(X=x,Y=y)$$ or you can compute $E(XY)$ directly, as $$\sum_{x,y}xyP(X=x,Y=y)$$ You just have to treat $X+Y$ and $XY$ as random variables (which they are!).