# Correlation and variance and covariance calculation CRV...?

• Sep 11th 2012, 08:46 PM
Correlation and variance and covariance calculation CRV...?
Hi !
The joint pdf of X and Y is fyx = 1 for 0<x<1, x<y<x+1
Compute the covariance and the correlation of X and Y.
********
I figured out the covariance and checked that it is indeed 1/12.
So, my E[X] = 1/2 and E[Y] = 1 are correct too.
For E[Y] = integral(0 to 2)integral(y-1 to y) of y dxdy = 1 (this is correct, just to help with bounds)

I can't figure out the ****correlation**** though.
Corr(X,Y) = Cov(X,Y)/[sqrt(Var[X]Var[Y])]

Var[X] = 1/3 - 1/2^2 = 1/12
Var[Y] = 8/3 - 1^2 = 5/3

My answer came to Corr(X,Y) = 0.2227 but that's wrong !!! and i can't find the mistake...

THANKS !!!
• Sep 11th 2012, 10:44 PM
harish21
Re: Correlation and variance and covariance calculation CRV...?
Quote:

Hi !
The joint pdf of X and Y is fyx = 1 for 0<x<1, x<y<x+1
Compute the covariance and the correlation of X and Y.
********
I figured out the covariance and checked that it is indeed 1/12.
So, my E[X] = 1/2 and E[Y] = 1 are correct too.
For E[Y] = integral(0 to 2)integral(y-1 to y) of y dxdy = 1 (this is correct, just to help with bounds)

I can't figure out the ****correlation**** though.
Corr(X,Y) = Cov(X,Y)/[sqrt(Var[X]Var[Y])]

Var[X] = 1/3 - 1/2^2 = 1/12
Var[Y] = 8/3 - 1^2 = 5/3

My answer came to Corr(X,Y) = 0.2227 but that's wrong !!! and i can't find the mistake...

THANKS !!!

if you are getting E[X] = 1/2 and E[Y]=1, that means you have f(x)=1, and f(y)=1 (this is what you would get when you calculated your marginal pdfs from the joint pdf). Also since f(x,y)=1, that means X and Y would be independent, and covariance=correlation=0. Is your question posted correctly?
• Sep 12th 2012, 12:39 AM
Re: Correlation and variance and covariance calculation CRV...?
Yes, my question is posted word for word and the covariance is definitely 1/12.
f(x,y) = constant is independent even tho Y is bounded by functions of X ?
• Sep 12th 2012, 09:12 AM
harish21
Re: Correlation and variance and covariance calculation CRV...?
Quote:

Yes, my question is posted word for word and the covariance is definitely 1/12.
f(x,y) = constant is independent even tho Y is bounded by functions of X ?

So this is what I get $E[X]=\frac{1}{2},\; E[X^2] = \frac{1}{3}$ and $E[Y]=1\;and E[Y^2]=\frac{7}{6}$ which will give

$V(X)=\frac{1}{12}\;and\;V(Y)=\frac{1}{6}$

$E[XY]=\frac{7}{12}$

$Cov(X,Y)=\frac{7}{12}-\frac{1}{2}\cdot 1 =\frac{1}{12}$

$\rho_{X,y}=\dfrac{\frac{1}{12}}{\sqrt{\frac{1}{12} \frac{1}{6}}}=0.707$

which means you made a mistake while computing $E[Y^2]$
• Sep 12th 2012, 11:38 AM