Suppose I have a sample $(X_n,Y_n), n=1..N$ from the joint distribution of $X$ and $Y$. How do I test the hypothesis that $X$ and $Y$ are independent?
No assumption is made on the joint or marginal distribution laws of $X$ and $Y$ (least of all joint normality, since in that case independence is identical to correlation being $0$).
No assumption is made on the nature of a possible relationship between $X$ and $Y$; it may be non-linear, so the variables are uncorrelated ($r=0$) but highly co-dependent ($I=H$).
I can see two approaches:
Bin both variables and use Fisher's exact test or G-test.
- Pro: use well-established statistical tests
- Con: depends on binning
Estimate the dependency of $X$ and $Y$: $\frac{I(X;Y)}{H(X,Y)}$ (this is $0$ for independent $X$ and $Y$ and $1$ when they completely determine each other).
- Pro: produces a number with a clear theoretical meaning
- Con: depends on the approximate entropy computation (i.e., binning again)
Do these approaches make sense?
What other methods people use?