2

Sometimes it appears that the covariance is not sufficient to express how much two random variables are related.

Bellow, I have draw random samples from a multivariate normal distribution with two random variables X and Y.

First case : Cov(X,Y) $\simeq$ 0 Dispersion of two random variables X and Y

Second case : Cor(X,Y) $\simeq$ 1 enter image description here

Third case: Cor(X,Y) $\simeq$ 0, ok but then is there a better metric than correlation in this case ?

enter image description here

Remark : Here the python code to draw the examples :

import numpy as np
import matplotlib.pyplot as plt

s1 = np.random.normal(0, 5, 500)
s2 = np.random.normal(0, 1, 500)

f, axarr = plt.subplots(2, 2)

axarr[0, 0].scatter(s1, s2)
axarr[0, 0].set_title('X,Y ')

axarr[0, 1].scatter(s1, s1+s1)
axarr[0, 1].set_title('X, X+X')

axarr[1, 0].scatter(s1, s1*s1)
axarr[1, 0].set_title('X,X*X')

axarr[1, 1].scatter(s1, s1+s2)
axarr[1, 1].set_title('X,X+Y')

plt.show()
Cryckx
  • 123
  • 5
  • Covariance is a linear measure. The metric works well for your first and second case. – SmallChess Aug 14 '18 at 12:05
  • Yes the two first cases are linear so it works well, is there an other metric for non linear cases ? – Cryckx Aug 14 '18 at 12:18
  • With 'how to measure the relation' you mean not 'measuring/determining the *shape* of the relation' but rather measuring 'whether there is any relation at all' (where relation means difference from $f_{X,Y}(x,y)=f_X(x)f_Y(y)$, or difference from independence)? – Sextus Empiricus Aug 14 '18 at 13:26
  • @MartijnWeterings I don't know this notation, what do your function $f_{X,Y}$ mean? Yes, I would like to verify if "there is any relation at all" between the two RV $X$ and $Y$ since I already know that $Y$ is equal to $X^2$ in the third case. – Cryckx Aug 14 '18 at 14:32
  • @FlorentJousse with $f_{X,Y}$ I mean the joint probability density function. That formula is a way to define independence (https://en.wikipedia.org/wiki/Independence_(probability_theory)#Two_random_variables). If that is what you mean than you could use https://en.wikipedia.org/wiki/Distance_correlation , but maybe it is something else that you want. – Sextus Empiricus Aug 14 '18 at 14:36
  • thank you, let me check that, I'm not yet familiar to all these terms. – Cryckx Aug 14 '18 at 14:37

0 Answers0