Calculate the covariance of $X$ and $Y$

614 Views Asked by At

Calculate $cov(X,Y)$ for $f(x,y)=2$; $0<x<y$, $0<y<1$

Using the equation $cov(x,y)=E[XY]-E[X]E[Y]$, I got that $cov(x,y)=1/4-y^2$.

My question is, can the covariance have a variable? or should I have used different bounds for the integrals with respect to $dx$ rather than $0$ and $y$?

2

There are 2 best solutions below

0
On BEST ANSWER

I suspect that you used: $$\mathsf E(XY) = \int_0^y\int_0^1 xy f(x,y)\operatorname d y\operatorname d x$$

Rather, you should use:

$$\mathsf E(XY) = \int_0^1\int_0^y xy f(x,y)\operatorname d x\operatorname d y$$

The important check:   The variable of integration for the inner integral should never appear in the bounds of the outer integral.


PS: Similarly $$\mathsf E(X) = \int_0^1\int_0^y x f(x,y)\operatorname d x\operatorname d y$$ $$\mathsf E(Y) = \int_0^1\int_0^y y f(x,y)\operatorname d x\operatorname d y$$

0
On

No, the covariance cannot be a random variable.

Your calculation should be $$\operatorname{Cov}[X,Y] = \int_{y=0}^1 \int_{x=0}^y 2xy \, dx \, dy - \int_{y=0}^1 \int_{x=0}^y 2x \, dx \, dy \int_{y=0}^1 \int_{x=0}^y 2y \, dx \, dy.$$