# Computational Test for Conditional Independence
## Appendix A Testing with Continous Data  
Although we focus on testing with categorical variables in this article, CCI can also be used with various data types. In Appendix A, we assess the performance of the CCI test by comparing to the GCM test, when \(Y\), \(X\), \(Z_{1}\), and \(Z_{2}\) are all continuous variables. Again we use the dependency structure depicted in Figure 1 and generate data from five multivariate distributions. Below are descriptions of various multivariate functions that generate simulated datasets:  
* Normal Data Function: Generates a dataset where both \(Z_{1}\) and \(Z_{2}\) are drawn from standard normal distributions. The variables \(X\) and \(Y\) are also normally distributed, influenced by the sum of \(Z_{1}\) and \(Z_{2}\), showcasing a simple additive model.
* Nonlinear Normal Data Function: Creates data with \(Z_{1}\) and \(Z_{2}\) as normal variables, while \(X\) includes a nonlinear transformation involving the exponential of the product \(Z_{1}\times Z_{2}\), with normal noise added. \(Y\) is formed by the product \(Z_{1}\times Z_{2}\) with additional normal noise.
* Uniform Noise Data Function: This function produces a dataset where \(Z_{1}\) and \(Z_{2}\) are normally distributed, but \(X\) and \(Y\) are derived from a linear combination of \(Z_{1}\) and \(Z_{2}\) plus a term involving their product, with uniform noise added to introduce non-normal error distribution and test model robustness against such noise.
* Exponential Noise Data: Similar to the uniform noise mode, it replaces the uniform noise with exponential noise with a rate parameter \(a=1\). This function is useful for examining the impact of skewed, heavy-tailed noise on statistical inferences.
* Poisson Noise Function: Generates data where \(Z_{1}\) and \(Z_{2}\) are normally distributed, but \(X\) and \(Y\) include Poisson-distributed noise influenced by the product of \(Z_{1}\) and \(Z_{2}\).
* Sinusoidal Data: This function creates data where \(Z_{1}\) and \(Z_{2}\) are normal, but \(X\) and \(Y\) involve sinusoidal transformations modulated by an exponential decay function based on the sum of \(Z_{1}\) and \(Z_{2}\). The sinusoidal component depends on linear combinations of \(Z_{1}\) and \(Z_{2}\).  
For each simulated distribution and test method, we perform 100 tests under both a true null and a false null hypothesis. We calculate the type I error rate by looking at the number of significant results at a significant level \(\alpha=0.05\). The power of the test under each simulated multivariate distribution is estimated by the number of rejected tests under a false null. The performance metrics for computation testing are Root Mean Square Error and Mean Absolute Error (MAE).  
In Figure 11, we see type I error rates; for these simulation examples, CCI testing is more conservative than GCM (Figure 11b). The GCM test exhibits a relatively high type I error in scenarios involving the Nonlinear, Normal, and Exponential Noise distributions. This high error rate is likely due to GCM's reliance on the even distribution of residuals around the regression line, making it susceptible to outliers, which these generating functions can produce. Assessing the power of the CCI testing, we see that with a sample of 2000, CCI testing can consistently reject a false null; GCM has a superior rejection rate with lower sample sizes.  
Figure 17: Type I error rates: Rejection rates testing a true null \(Y\perp X|Z_{1},Z_{2}\). A bluish color means the error rate is low and should ideally be around 0.05; purple, orange, yellow, and red indicate a high type I error rate. The CCI test performs better in many scenarios, as GCM relies on the assumption of “well behaved” residuals. **(a)** CCI. **(b)** GCM.  
In conclusion, we see that CCI testing is a viable testing method in continuous cases and can compete with the GCM test, given a sufficient sample size.