Solving for the covariance of a joint pdf

17.1k Views Asked by At

Let X and Y have a joint pdf given by

$f_{x,y}(x,y) = \begin{cases} 1 & \text{if } 0<y<1,\text{ } y-1<x<1-y \\ 0 & \text{otherwise} \end{cases}$.

(a) Find Cov(X,Y) and Corr(X,Y). Are X and Y independent?
(b) Find Cov(|X|,|Y|) and Corr(|X|,|Y|).
(c) Find Cov(3|X|, 4|Y|) and Corr(3|X|, 4|Y|).
(d) Find Var(3X - 2Y).

So I know Covariance is E(XY)-E(X)E(Y). And since this is the indicator function, E(XY) should be 1*P(0 < y < 1, y-1 < x < 1-y) + 0*P(otherwise), which is just P(0 < y < 1, y-1 < x < 1-y). From here, I'm not sure if I take the double integral of this function with parameters listed above, or if I am taking the wrong approach. Not sure how to calculate E(X) or E(Y) either. Once I figure this part out, how absolute values will play a role?

2

There are 2 best solutions below

2
On BEST ANSWER

A picture is (to me) essential. Draw the line $x+y=1$, the line $y=x+1$. Our pairs $(X,Y)$ live in the region that lies below each of these two lines, and above the $x$-axis. The region is a triangle of area $1$. It has corners $(1,0)$, $(0,1)$, and $(-1,0)$. The hard part is now finished.

(a) We want $E(XY)-E(X)E(Y)$. By symmetry we have $E(XY)=0$ and $E(X)=0$, so the covariance is $0$, and therefore so is the correlation coefficient.

But suppose we don't notice. Then to find $E(XY)$ we need to find the integral of $xy$ over our region.

The region naturally breaks up into the part to the left of $0$ and the part to the right. We get $$E(XY)=\int_{x=-1}^0 \left(\int_{y=0}^{x+1} xy\,dy\right)\,dx+ \int_{x=0}^1 \left(\int_{y=0}^{1-x} xy\,dy\right)\,dx .$$ Calculate. We get $0$.

The random variables $X$ and $Y$ are uncorrelated. They are not independent.

The non-independence is obvious: if we know $X$ is big, then $Y$ must be small. To prove independence fails with minimal computation, note that $\Pr(X\gt 0.9)$ is non-zero, as is $\Pr(Y\gt 0.9)$. But $\Pr((X\gt 0.9)\cap (Y\gt 0,9))=0$.

(b) For the covariance of $|X|$ and $|Y|$, we will need to find $E(|X||Y|)-E(|X|)E(|Y|)$. For the correlation coefficient, we may also need the variance of $|X|$ and of $|Y|$, so we will also need $E(|X|^2)$ and $E(|Y|^2)$. So a whole lot of expectations, a whole lot of integrals.

For $E(|X||Y|)$ we need to integrate $|x||y|$ over our triangle, since the density function is $1$ in the triangle and $0$ elsewhere. When $x$ is between $-1$ and $0$, we have $|x|=-x$, and when $x$ is between $0$ and $1$, we have $|x|=x$. Thus $$E(|X||Y|)=\int_{x=-1}^0 \left(\int_{y=0}^{x+1} -xy\,dy\right)\,dx+ \int_{x=0}^1 \left(\int_{y=0}^{1-x} xy\,dy\right)\,dx .\tag{1}$$ By symmetry the two integrals are equal, so if we wish we can evaluate one of them and double.

We will also need $E(|X|)$ and $E(|Y|)$. For $E(|X|)$, we replace $-xy$ in the left integral of (1) by $-x$, and replace $xy$ in the right integral by $x$. For $E(|Y|)$, both integrands get replaced by $y$. Use of symmetry again cuts the work in half.

The integrals $E(X^2)$ and $E(Y^2)$ use the same kind of double integral.

(c) No more integration! Note that the covariance of $aU$ and $bV$ is $ab$ times the covariance of $U$ and $V$. The correlation coefficient situation is even simpler.

(d) We want $E((3X-2Y)^2)-(E(3X-2Y))^2$. Expand. Or else use a standard formula that expresses the variance of $aX+bY$ in terms of the variance of $X$, the variance of $Y$, and the covariance of $X$ and $Y$. Conveniently the covariance is $0$.

0
On

Random variables $(X,Y)$ have joint pdf $f(x,y)$:


(source: tri.org.au)

Here is a plot of the pdf, which is helpful in understanding the domain of support:


(source: tri.org.au)

The rest of the problem (parts a to d) can easily be solved using a computer algebra system. I am using the mathStatica add-on to Mathematica to do the grunt work for me (I am one of the authors of the former). I don't believe in answering homework problems, so here is the answer to only one part of each question. Presumably you will need to show your working anyway (which Andre has kindly provided detailed help on) ... and the output below will give you something to aim towards ...


(source: tri.org.au)