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

1. ## 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 !!!

2. ## Re: 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 !!!
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?

3. ## 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 ?

4. ## 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 ?
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]$

5. ## Re: Correlation and variance and covariance calculation CRV...?

I think my bounds are wrong (they often are!) but that's what my sketch looks like :/
x goes from 0 to 1 and is bounded by the lines y=x and y=2x...

E[y^2] = I(0 to 2)I(y-1 to y) y^2 dxdy = I(0 to 2) y^2 dy = 8/3 ...

7. ## Re: Correlation and variance and covariance calculation CRV...?

Got it thanks again !