# Math Help - Covariance - Joint PDF

1. ## Covariance - Joint PDF

Given:
$
f(x, y) = xy^2exp(-(x+1)y) \ x, y > 0
$

I needed to calculate the Cov(X,Y).

So I used the formula Cov(X, Y) = E(XY) - E(X)E(Y)

The problem occurs when I go to calculate E(X).

I know $E(X) = \int_o^\infty \! xf_x(x) \, dx.$

Where the marginal pdf of x is $f_x(x) = \frac{2x}{(1 + x)^3}$.
So the integral now is:
$
\int_o^\infty \! \frac{2x^2}{(1 + x)^3} \, dx.
$

Now when I evaluate that integral I get a divergent integral evaluating to $\infty$. I've checked my work several times, but I can't seem to find what I'm doing wrong. Any suggestions?

2. Hello,

Now when I evaluate that integral I get an improper integral. I've checked my work several times, but I can't seem to find what I'm doing wrong. Any suggestions?
Well, what is an improper integral to you ?
Because it surely is an improper integral here, caused by the infinity boundary !

Now, I get the same problems as yours...

Setting $\int_0^\infty \frac{2x^2}{(1+x)^3} ~dx=\lim_{a \to \infty} \int_0^a \frac{2x^2}{(1+x)^3} ~dx$, I get :

$\int_0^a \frac{2x^2}{(1+x)^3} ~dx=6 \left(2\ln(1+a)-2 \cdot \frac{a}{1+a}-\frac{a^2}{(1+a)^2}\right)$

And we also can see that $\frac{2x^2}{(1+x)^3} \sim \frac 2x$ as x is very big.
And $\int_1^\infty \frac 1x ~dx$ is a divergent Riemann integral !

My guess is that you should not calculate separately the expectations (you should know that you don't necessarily have $\int f+g=\int f+\int g$, especially if there are integrals that don't exist), by using the $\text{Cov}(X,Y)=\mathbb{E}\{(X-\mathbb{E}(X))(Y-\mathbb{E}(Y))\}$

We proved in our class that if X and Y are bounded, then :
$\mathbb{E}(XY)-\mathbb{E}(X)\mathbb{E}(Y)=\int_{\mathbb{R}} \int_{\mathbb{R}} \left[\mathbb{P}(X\leq x,Y\leq y)-\mathbb{P}(X\leq x)\mathbb{P}(Y\leq y)\right] ~dxdy$

But I must say I don't know if it is the correct way...

3. Originally Posted by Moo
Well, what is an improper integral to you ?
Because it surely is an improper integral here, caused by the infinity boundary !
Oops sorry I meant divergent. I'll try what you suggested and see if it works.

4. I'm doing the same question.

I tried calculating E(X), and after integrating, I found

$
\frac{4x+3}{(x+1)^2} + 2log(x+1)
$

but with the limits of integration being 0 to infinity, I stopped there, since the log(x) diverges to infinity and I get moot.

I thought that maybe after finding $E_{Y}(Y)$ that I could use

$
E_{X}(X) = E_{Y}(E_{X \mid Y}(X \mid Y=y))
$

with $E_{X \mid Y}(X \mid Y=y) = \frac{2}{y}$, (if I did my calculations correctly) but again... the integral gets weird. I'm all out of ideas...

5. Yeah I ran into both those problems as well. And now I am also officially out of ideas. I think I'll have to ask the teacher tomorrow.

6. Hmm... looks like the question changed.

For Q1(d), change the question to "Does the Cov(X,Y) exist? Show work to justify your answer."
I'd say it doesn't exist

7. Originally Posted by veol
Hmm... looks like the question changed.

[color=#FF0000]

I'd say it doesn't exist
Woot good news. Thanks for that! I was still struggling with that one. LOL.

8. i am doing the same question...but i dont know how to do part e) find explicit expression of MGF of ln Y...and specify the range of t...
anyone can help me? Thanks a lot!

9. Originally Posted by cm917
i am doing the same question...but i dont know how to do part e) find explicit expression of MGF of ln Y...and specify the range of t...
anyone can help me? Thanks a lot!
The hard way: Get the marginal of Y. Find the pdf of ln Y. Apply the definition of MGF. Do the integration.

The easy way: Get the marginal of Y. Note that $E\left( e^{t \ln Y} \right) = E\left( Y^t\right)$. Do the integration.

10. Thanks! but i dont know how to find the pdf of lny...Would you please show it to me ? Thnaks a lot!

11. Originally Posted by cm917
Thanks! but i dont know how to find the pdf of lny[snip]
Then do it the other way.

12. i tired the easy way...
E[y^t) = Integrate from 0 to infinity...( y^t) (e^-y) dy....
i applied the part rule... then I need to integrate (e^-y ) (y^(t-1)) dy again...it seems even i keep integrate it..i cant get rid of t...did i do something wrong?

13. Originally Posted by cm917
i tired the easy way...
E[y^t) = Integrate from 0 to infinity...( y^t) (e^-y) dy....
i applied the part rule... then I need to integrate (e^-y ) (y^(t-1)) dy again...it seems even i keep integrate it..i cant get rid of t...did i do something wrong?
Use the Gamma function: Gamma function - Wikipedia, the free encyclopedia