Estimation of mutual information (MI) from observed samples is a fundamental primitive in machine learning. It is heavily utilized in tasks ranging from correlation mining and feature selection to understanding complex gene regulatory networks. While MI is mathematically well-defined for almost any probability space, estimating it in practice presents significant challenges—especially when dealing with "mixed" random variables that contain both discrete and continuous components.
This paper introduces a novel, consistent estimator for MI specifically designed to handle these discrete-continuous mixtures. By directly estimating the Radon-Nikodym derivative using $k$-nearest neighbor distances, the authors successfully bypass the limitations of traditional entropy-based methods.
The Challenge of Mixed Data
In practice, MI is usually estimated using the 3H-principle, which calculates the three (differential) entropies of $X$, $Y$, and the pair $(X,Y)$:
$$I(X; Y) = H(X) + H(Y) - H(X, Y)$$
This formula works perfectly if $X$ and $Y$ are both purely discrete or both purely continuous. The trouble begins with discrete-continuous mixtures.
Imagine a dataset where a variable represents "rainfall amount": it is exactly 0 on dry days (a discrete mass) but can be any positive real number when it rains (a continuous density). In these scenarios, individual Shannon or differential entropies ($H$) are not well-defined or diverge to infinity.
Existing workarounds often fail to capture this nuance. Adding tiny amounts of noise to "smear" discrete points into a continuum, or quantizing continuous data into bins, frequently leads to significant bias or poor performance, particularly in high-dimensional spaces.
A Novel $k$-NN Approach
To solve this, the authors propose a new estimator that avoids calculating individual entropies altogether. Instead, it directly estimates the Radon-Nikodym derivative—the ratio of the joint distribution to the product of the marginals—at each sample point.
The estimator builds on the foundations of the popular KSG (Kraskov-Stögbauer-Grassberger) estimator but introduces a clever modification to handle discrete "clumping":
- Distance Metric: For each sample point $i$, the algorithm finds the distance $\rho_{i,xy}$ to its $k$-th nearest neighbor in the joint space.
- The "Discrete Check": If $\rho_{i,xy} = 0$, it indicates multiple samples at the exact same coordinate, which is a hallmark of discrete data. The algorithm counts these identical samples ($\tilde{k}_i$).
- Marginal Counting: It then independently counts how many samples fall within that same radius $\rho_{i,xy}$ in the $X$-space ($n_{x,i}$) and $Y$-space ($n_{y,i}$).
- The Formula: The MI is estimated by averaging a term involving the digamma function $\psi(\cdot)$ across all samples: $$\hat{I}^{(N)}(X; Y) = \frac{1}{N} \sum_{i=1}^N [\psi(\tilde{k}_i) + \log N - \log(n_{x,i} + 1) - \log(n_{y,i} + 1)]$$
This approach is elegant because it naturally "degenerates" into the standard plug-in estimator for purely discrete data and the KSG estimator for purely continuous data, providing a unified and robust framework.
Key Results and Empirical Performance
The authors evaluated their estimator using a mix of synthetic and real-world-inspired scenarios, including combinations of 2D Gaussians and discrete point masses, Zero-inflated Poissonization models (common in biological sequencing), and the DREAM5 Challenge dataset for reconstructing gene regulatory networks.
Superior Accuracy and Consistency
The paper provides a rigorous theoretical proof that the estimator is $L_2$ consistent, meaning that as more data is collected, the estimate converges to the true MI value.
Empirically, in synthetic experiments where the ground truth MI was known, the proposed estimator's Mean Squared Error (MSE) consistently decreased as sample size increased. In stark contrast, baselines like "Noisy KSG" and "Partitioning" often hit an error floor or failed to converge entirely.
Robustness and Feature Selection
In the gene regulatory network task (DREAM5), the proposed method maintained a higher AUROC (Area Under the ROC Curve) across various levels of simulated "dropout" noise compared to traditional methods. Furthermore, the estimator proved significantly better at identifying which features were truly related to a target variable in mixed-type datasets, outperforming standard toolboxes by gracefully bypassing the "curse of dimensionality" that plagues binning methods.
Limitations and Future Directions
While this estimator represents a significant step forward for mixed data analysis, a few areas remain open for exploration:
- Hyperparameter Sensitivity: Like all $k$-NN methods, the choice of $k$ matters. While the estimator is consistent for a wide range of $k$, selecting the optimal value for small sample sizes isn't always straightforward.
- Computational Complexity: Finding $k$-nearest neighbors in very high dimensions can be computationally expensive, though efficient tree-based search algorithms can help mitigate this.
- Extension to Conditional MI: The current work focuses on pairwise mutual information. Extending this logic to Conditional Mutual Information ($I(X;Y|Z)$) for mixed variables would be a highly useful next step, particularly for causal inference applications.
Summary updated