Abstract
Conditional Independence Testing (CIT) is fundamental to causal discovery, yet it remains challenging for "mixed" datasets containing both continuous and categorical variables. Existing methods often suffer from bias due to improper distance metrics or high variance from excessive data partitioning. We present the $MS_{0-\infty}$ estimator, a non-parametric $k$-nearest-neighbor approach that utilizes a novel $0-\infty$ distance metric to respect categorical boundaries. Our numerical evaluation demonstrates that $MS_{0-\infty}$ is scaling-invariant, provides superior power in complex cluster-dependent scenarios, and maintains robustness across varying sample sizes and data distributions compared to state-of-the-art estimators.
Introduction
Causal discovery aims to infer structural relationships from observational data, relying heavily on Conditional Independence Testing (CIT) to determine if variables $X$ and $Y$ are independent given a conditioning set $Z$. While CIT is well-established for purely continuous or purely categorical data, mixed-type data presents a significant hurdle. Current approaches typically either one-hot encode categories—treating them as numerical coordinates and introducing scaling bias—or partition the data by category, which leads to high variance and instability in small-to-medium datasets. This paper introduces a "Goldilocks" solution that balances stability and bias through a specialized distance metric.
Methods
The proposed $MS_{0-\infty}$ estimator is a variant of the $k$-nearest-neighbor ($k$-NN) mutual information estimator. Its primary innovation is the $0-\infty$ distance metric. For two data points, the metric calculates the $L_\infty$ distance if their categorical labels match; otherwise, the distance is set to infinity. This effectively restricts neighborhood searches to within the same categorical cluster, preventing the "bleeding" of information across unrelated categories that causes bias in traditional methods. Furthermore, the method employs an adaptive $k$ heuristic based on the smallest categorical group size and utilizes a local permutation scheme to generate p-values for formal statistical testing.
Results and Discussion
Numerical experiments across synthetic models—including independent Z, confounders, and cluster-dependent structures—reveal several key advantages of $MS_{0-\infty}$.
A critical finding is the estimator's scaling invariance. Standard preprocessing, such as scaling data to a $[0, 1]$ range, often degrades the performance of the traditional MS estimator. As shown in the performance metrics, $MS_{0-\infty}$ maintains high True Positive Rates (TPR) and controlled False Positive Rates (FPR) even when data is scaled, whereas the MS estimator's power can plummet.
In complex "Cluster-dependent confounder" models, where relationships change based on the category of $Z$, $MS_{0-\infty}$ significantly outperforms the original MS estimator. It successfully navigates the variance-bias tradeoff, providing more reliable results than the high-variance ZMADG approach on finite samples. The $MS_{0-\infty}$ method avoids the complex summation of multiple entropy terms required by partitioned approaches, making it computationally efficient.
Conclusion
The $MS_{0-\infty}$ estimator provides a robust framework for CIT in mixed-variable settings. By respecting categorical boundaries through a specialized distance metric, it avoids common pitfalls related to data scaling and partitioning. While the method faces challenges common to $k$-NN approaches, such as the curse of dimensionality and the need for sufficient samples per cluster, its performance on synthetic benchmarks suggests it is a powerful tool for real-world causal discovery. Future work will focus on benchmarking the method against high-dimensional genomic and climate datasets.
Summary updated