Independence test I'm working on Bayesian Network and I need to find a broad range of statistical test for testing independence and conditional independence between 2 variables with a potential conditioning set of important size.
My data is a mix of normal (not the most common), non normal (the most common), continuous (the most common), discrete, with dependences being not linear.
So far I was using Z-fisher test as I found a nice implementation in the bnt toolbox for MATLAB (I'm not so good in developing) but it assumes linearity and normality which are really heavy assumptions.
I found two or three implementation of the Hilbert Schmidt Independence Criteria but, unfortunately, they perform quite poorly.
Do you have some advice? Pointers?
I would like to design a kind of super class of test which will have access to a specific test depending on the nature of the parameters (testing continuous independent of discrete conditional on a continuous variable is still a bit unclear for me).
 A: The paper Detecting novel associations in large datasets by Reschef et al introduces a flexible measure of dependence for continuous variables, that should also work for discrete ordinal variables.  The paper has a nice discussion of the pitfalls of various dependence measures that could be useful by itself.  There is code provided on that site.
A: This is an important problem! I don't have a full answer but I can point you in some directions.
Joe Ramsey has developed a test called Conditional Correlation Independence (CCI) for testing the independence between non-Gaussian variables with non-linear dependencies. It scales better than tests that use Reproducing Kernel Hilbert Spaces, so it may perform better than the Hilbert Schmidt Independence Criterion.
Regarding mixtures of discrete and continuous variables: At one point I needed to test $X \perp Y | Z$, where $X$ and $Z$ were continuous and $Y$ was discrete. I simply did a logistic regression of $Y$ onto $X$ and $Z$, and tested the significance of the coefficient for $X$. I think this is consistent - that coefficient is zero iff $X$ and $Y$ are independent conditional on $Z$. You can use multinomial logistic regression for non-binary discrete variables. 
One thing to worry about is that your different families of tests will have different degrees of sensitivity. You may need to control the false discovery rate for each type of test separately.
