A Generative Conditional Distribution Equality Testing Framework and Its Minimax Analysis

Siming Zheng, Meifang Lan, Tong Wang, Yuanyuan LinarXiv 2025 · DOI

Introduction

In the fields of statistics and machine learning, a fundamental challenge involves determining whether the relationship between a set of covariates $X$ and a response variable $Y$ remains consistent across different environments or datasets. This problem, known as Conditional Distribution Equality Testing (CDET), seeks to verify if $P_1(Y|X) = P_2(Y|X)$. Such testing is critical in domains like precision medicine—for instance, determining if a specific drug's efficacy (the relationship between patient characteristics and health outcomes) is identical across different demographic populations.

The Challenges of Conditional Testing

Testing for the equality of conditional distributions is significantly more complex than standard two-sample testing due to two primary hurdles:

  1. The Sparsity Problem: In continuous covariate spaces, the probability of observing the exact same value of $X$ in two different datasets is zero. Consequently, one cannot directly compare outcomes $Y$ for a fixed $X$ across samples.
  2. Covariate Shift: The marginal distribution of $X$ often differs between datasets (e.g., one study population may be older than another). Traditional two-sample tests often fail here because they are sensitive to changes in $P(X)$, even when the underlying mechanism $P(Y|X)$ is unchanged.

Existing approaches, such as those relying on density ratio estimation, often suffer from instability in high-dimensional settings or perform poorly when sample sizes are heavily imbalanced.

The Generative Framework

This paper introduces a flexible, three-step framework that transforms the complex conditional testing problem into a simpler unconditional joint distribution test by leveraging deep generative models.

1. Conditional Generative Learning

The process begins by using the larger of the two datasets to train a conditional generator. The authors specifically utilize Mixture Density Networks (MDNs), which are designed to model complex, multi-modal conditional distributions. This model learns to produce synthetic response values $Y$ given an input $X$.

2. Sample Splitting and Synthetic Generation

The second (typically smaller) dataset is split. The generator trained in the first step is then used to create "synthetic" responses for the $X$ values present in the second dataset. This creates a controlled comparison where the covariates are identical by design.

3. Unconditional Testing

With the synthetic data generated, the problem is reduced to comparing two sets of $(X, Y)$ pairs: the real observations from the second dataset and the synthetic pairs generated from the first dataset's model. Because both sets now share the same $X$ distribution, any detected difference must stem from a difference in the conditional distributions $P(Y|X)$.

A key implementation of this framework is GCA-CDET (Generative Classification Accuracy-based Conditional Distribution Equality Test). This method trains a neural network classifier to distinguish between "real" and "synthetic" pairs. If the classifier's accuracy is no better than random chance (50%), the null hypothesis—that the conditional distributions are equal—is accepted.

Theoretical Contributions

Beyond the algorithmic framework, the paper provides a rigorous theoretical analysis of the method's consistency and efficiency:

  • Minimax Optimality: The authors prove that the proposed framework can achieve the minimax lower bounds for statistical inference, meaning it achieves the best possible theoretical error rates for this class of problems.
  • Convergence Rates: To establish these results, the authors derived new convergence rates for MDNs using offset Rademacher complexity. This modern technical approach provides a more robust foundation than the classical localization techniques used in earlier literature.

Empirical Performance

The framework was evaluated against synthetic models (ranging from linear to high-dimensional nonlinear relationships) and real-world datasets, including Bike Sharing (UCI), Wine Quality, and HIV-1 Drug Resistance data. Key findings include:

  • Robust Type I Error Control: GCA-CDET maintained the false alarm rate near the nominal 5% level, whereas competing methods like the Weighted Conditional Permutation Test (WCPT) frequently over-rejected the null hypothesis.
  • Statistical Power: In the Wine Quality and HIV-1 datasets, GCA-CDET demonstrated significantly higher power (the ability to detect actual differences) compared to the Generative Conditional Independence Test (GCIT).
  • Computational Efficiency: The framework is highly scalable. In comparative benchmarks, GCA-CDET completed tests in approximately 63 seconds, while the Doubly Robust (DRGCIT) method required over 1,800 seconds for the same task.

Conclusion and Future Directions

The proposed generative framework offers a computationally efficient and theoretically sound solution to the CDET problem, particularly in high-dimensional and imbalanced data scenarios. While the current work focuses on MDNs, the "plug-and-play" nature of the framework allows for the future integration of more advanced architectures, such as Conditional Diffusion Models or Flow Matching. Additionally, the authors suggest that the use of e-values could help mitigate the inherent randomness introduced by data splitting, leading to even more stable statistical inferences.

Summary updated

BibTeX
@misc{zheng2025generative,
  author = {Siming Zheng and Meifang Lan and Tong Wang and Yuanyuan Lin},
  title = {{A Generative Conditional Distribution Equality Testing Framework and Its Minimax Analysis}},
  year = {2025},
  eprint = {2509.17729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.17729},
}
Figure