I have empirically noticed and interesting phenomenon. Suppose we have two continuous random variables $X$ and $Y$ which are dependent but not correlated. For instance:
$X \sim \mathcal{N(0,1)}$
$Y = cos(X) +Z$,$~~~~$ where $Z\sim \mathcal{N(0,0.5)}$
You can use the following Python code to generate samples for these variables and check that they are indeed dependent but not correlated (I use this implementation of distance correlation as a measure for dependence):
N_SAMPLES = 10000
def genSamples(n):
x = np.random.normal(0,2,size=(n))
y = np.cos(x)+np.random.normal(0,0.5, n)
return x,y
x,y = genSamples(N_SAMPLES)
plt.scatter(x,y)
plt.show()
print "CorrCoef: ", np.corrcoef(x,y)[0,1]
print "DistCorr: ", distcorr(data[:,0], data[:,1])
Now consider two additional random variables $X_{sum}$ and $Y_{sum}$ generated as the summation of $n$ realizations of the original variables. The thing I have noticed is that $X_{sum}$ and $Y_{sum}$ become more and more independent as $n$ grows.
N_SUM = 1
Xsum = np.zeros((N_SAMPLES))
Ysum = np.zeros((N_SAMPLES))
for _ in range(N_SUM):
x,y = genSamples(N_SAMPLES)
Xsum += x
Ysum += y
plt.scatter(Xsum,Ysum)
plt.show()
print np.corrcoef(Xsum,Ysum)[0,1]
print distcorr(Xsum, Ysum)
I know that by the Central Limit Theorem $X_{sum}$ and $Y_{sum}$ will be approximately normal, but why are they becoming independent? Is there a general explanation for this?. Also, I have noticed that this phenomenon only occurs if $X$ and $Y$ are not correlated.
Thanks in advance.