# The formula for covariance in terms of joint cdf [duplicate]

I want to show that $$\newcommand{\cov}{\operatorname{cov}}\newcommand{\d}{\mathrm{d}}\cov(x,y) = \iint (F_{X,Y}(x,y) - F_X(x)F_Y(y))\,\d x\,\d y$$ However, I have no idea how to start. I know that $$\cov(x,y) = \iint (x-\mu_X)(y-\mu_Y)f_{X,Y}(x,y)\,\d x\,\d y = \iint xyf_{X,Y}(x,y)\,\d x\,\d y - \mu_x \mu_y$$ where $\mu_x = \int x f_X(x)\,\d x$ and $\mu_y = \int y f_Y(y)\,\d y$.

However, I have no idea how to proceed. I would be very grateful for at least a small hint.

• The formula indicates $\int F_X(x) dx = \mu_X = \int x f_X(x) dx.$ By definition, $f_X(x) = \frac{d}{dx} F_X(x)$, allowing us to write $\mu_X = \int x d(F_X(x))$. Doesn't that suggest integration by parts?
– whuber
Feb 10, 2013 at 16:43
• @whuber: thanks a lot for a hint, it is very useful. I got that $\mu_X=xF(x)|^{\infty}_{\infty}−\int F(x)dx$. Is it usually the case that in this situation we assume that x converges to $\infty$ at slower rate than F(x) converges to 0? If it is the case, we can conclude that $\mu_X=−\int F(x)dx$. Then we have that $\mu_X \mu_Y = \int F(x)dx \int F(y)dy = \int \int F(x) F(y)dxdy$. I am not sure how to calculate the integral of $\int \int xyf(x,y)dxdy$. Feb 10, 2013 at 22:51
• Should I calculate it integral by integral with integration by parts? If it is the case, define $dv = f(x,y)dx$. What is $v$ in that case? I would say that $f(y)$, but it cannot be tha case. Feb 10, 2013 at 22:53
• See Lemma 2 in Lehmann, E.L., 1966. Some concepts of dependence. The Annals of Mathematical Statistics, pp.1137-1153. Jan 27, 2021 at 14:11

Assume $$(X_{1},Y_{1})$$ and $$(X_{2},Y_{2})$$ are independent each distributed according to the same joint CDF. Then
$$2{cov(X_{1},Y_{1})}=E((X_{2}-X_{1})(Y_{2}-Y_{1})) = E(\int\int(\delta(X_{2}<=u)-\delta(X_{1}<=u))(\delta(Y_{2}<=v)-\delta(Y_{1}<=v)) du dv)$$ where $$\delta(X<=u)=1$$ when $$X<=u$$, and $$=0$$ otherwise. We can now take the expectation under the integral. QED.