Partial identification of kernel based two sample tests with mismeasured data

Ron Nafshi, Maggie MakararXiv 2023

Abstract

Nonparametric two-sample tests such as the Maximum Mean Discrepancy (MMD) are often used to detect differences between two distributions in machine learning applications. However, the majority of existing literature assumes that error-free samples from the two distributions of interest are available. We relax this assumption and study the estimation of the MMD under $\epsilon$-contamination, where a possibly non-random $\epsilon$ proportion of one distribution is erroneously grouped with the other. We show that under $\epsilon$-contamination, the typical estimate of the MMD is unreliable. Instead, we study partial identification of the MMD, and characterize sharp upper and lower bounds that contain the true, unknown MMD. We propose a method to estimate these bounds, and show that it gives estimates that converge to the sharpest possible bounds on the MMD as sample size increases, with a convergence rate that is faster than alternative approaches. Using three datasets, we empirically validate that our approach is superior to the alternatives: it gives tight bounds with a low false coverage rate.

Introduction: The Challenge of Contaminated Data

In machine learning and statistics, the ability to discern whether two groups of data originate from the same distribution is fundamental. The Maximum Mean Discrepancy (MMD) has emerged as a powerful nonparametric tool for this purpose. However, a critical limitation of standard MMD applications is the assumption of "clean" data. In practice, datasets are often plagued by $\epsilon$-contamination, where a fraction $\epsilon$ of samples from one group is incorrectly labeled as belonging to the other.

Consider a clinical study seeking biomarkers for heart attacks. If the "healthy" control group inadvertently includes individuals who suffered "silent" heart attacks, the data is contaminated. The authors demonstrate that even minimal, non-random contamination renders standard MMD point estimates unreliable. Since the specific contaminated samples are unknown, a single point estimate is mathematically unjustifiable. This paper advocates for partial identification: determining the range of all possible MMD values consistent with the observed, potentially messy data.

Methodology: Stepwise Stochastic Dominance (S-SD)

The core contribution of this work is a shift from point estimation to finding the sharpest possible bounds—the tightest interval guaranteed to contain the true MMD.

From SD to S-SD

The authors first explore Stochastic Dominance (SD). For very low contamination levels, the "worst-case" samples (those maximizing or minimizing the MMD) can be identified by the highest or lowest values of the "witness function," which highlights distributional differences. However, as $\epsilon$ increases, this simple approach falters.

To address this, the authors propose Stepwise Stochastic Dominance (S-SD). This algorithm decomposes the contamination into $S$ small increments. In each step, it identifies a small subset of likely contaminated samples, reassigns them to the correct group, and updates the witness function iteratively. This stepwise refinement prevents error compounding and ensures the bounds remain tight even for larger $\epsilon$.

Advantages over Optimization

Traditional approaches often treat bound estimation as a high-dimensional optimization problem. Such methods frequently struggle with local minima or fail entirely in high-dimensional spaces. S-SD, by contrast, reduces the problem to finding quantiles of a one-dimensional distribution. This makes the method significantly faster, more robust, and theoretically sound, with a faster convergence rate to the sharpest bounds.

Empirical Evaluation

The authors validated S-SD using three datasets representing distinct statistical challenges:

  • FOREST: A cartographic dataset with 54 variables used to evaluate habitat similarity.
  • MIMIC: A medical dataset where 2D logit predictions from a deep learning model were analyzed to detect racial bias in pneumonia predictions.
  • BIO: A high-dimensional leukemia gene expression dataset with over 7,000 variables but only 72 samples, representing a "worst-case" scenario for statistical robustness.
Performance across MIMIC, FOREST, and BIO datasets

Key Results and Insights

The effectiveness of the proposed method was measured using two primary metrics: the False Coverage Rate (FCR)—the frequency with which the true MMD falls outside the estimated bounds—and the Mean Interval Width (MIW)—the tightness of those bounds.

Superior Coverage and Tightness

S-SD consistently outperformed baselines across all datasets. As shown in the results table, S-SD achieved an FCR of 0.0 in the MIMIC and FOREST datasets, meaning the true MMD was always captured within the bounds. Even in the challenging BIO dataset, it maintained a low FCR of 0.1, whereas optimization-based methods like QNO or SM reached FCRs as high as 1.0 (complete failure).

MIW and FCR vs Sample Size

Scalability and Convergence

A striking finding is S-SD's dimension independence. While optimization-based baselines struggle as the number of features grows (e.g., in the BIO dataset), S-SD remains robust because it focuses on the witness function's output rather than the raw feature space. Furthermore, empirical results confirm that as the sample size increases, S-SD's interval width (MIW) decreases while maintaining a near-zero FCR, validating its theoretical convergence properties.

Conclusion and Future Directions

This research highlights the danger of point estimates in the presence of data contamination. Partial identification via S-SD provides a mathematically "honest" framework for hypothesis testing with messy data.

While powerful, the current framework assumes the contamination proportion $\epsilon$ is known or estimable. Future work could address scenarios where $\epsilon$ is unknown or extend this logic to other statistical measures, such as the Hilbert Schmidt Independence Criterion (HSIC) for measuring variable independence.

Summary updated

BibTeX
@misc{nafshi2023partial,
  author = {Ron Nafshi and Maggie Makar},
  title = {{Partial identification of kernel based two sample tests with mismeasured data}},
  year = {2023},
  eprint = {2308.03570},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.03570},
}
Figure