Abstract
A two-sample hypothesis test is a statistical procedure used to determine whether the distributions generating two samples are identical. We consider the two-sample testing problem in a new scenario where the sample measurements (or sample features) are inexpensive to access, but their group memberships (or labels) are costly. To address the problem, we devise the first active sequential two-sample testing framework that not only sequentially but also actively queries. Our test statistic is a likelihood ratio where one likelihood is found by maximization over all class priors, and the other is provided by a probabilistic classification model. The classification model is adaptively updated and used to predict where the (unlabelled) features have a high dependency on labels; labeling the “high-dependency” features leads to the increased power of the proposed testing framework. In theory, we provide the proof that our framework produces an anytime-valid p-value. In addition, we characterize the proposed framework’s gain in testing power by analyzing the mutual information between the feature and label variables in asymptotic and finite-sample scenarios. In practice, we introduce an instantiation of our framework and evaluate it using several experiments; the experiments on the synthetic, MNIST, and application-specific datasets demonstrate that the testing power of the instantiated active sequential test significantly increases while the Type I error is under control.
Introduction
In statistics, a "two-sample test" is fundamental for determining if two sets of data originate from the same distribution. Traditional batch testing requires pre-determining a sample size, which often leads to wasted resources if the problem is simple or insufficient power if it is complex. Sequential testing offers a solution by allowing researchers to stop as soon as sufficient evidence is gathered.
However, existing sequential tests typically assume that features and labels arrive simultaneously. In many modern applications, such as digital health, features (e.g., smartphone sensor data) are inexpensive to collect, whereas labels (e.g., clinical scans) are prohibitively expensive. This paper addresses the challenge of performing sequential testing under a tight label budget by leveraging a vast pool of unlabeled data through an active querying strategy.
Methods: The BQ-AST Framework
The authors propose BQ-AST (Bimodal Query Based Active Sequential Two-Sample Testing), the first framework to combine sequential decision-making with active learning for two-sample testing.
The framework operates through an iterative loop as shown in the figure above:
- Likelihood Ratio Statistic: The test employs a ratio where the denominator is derived from a probabilistic classifier (e.g., a Neural Network) that predicts labels from features.
- Active Bimodal Querying: Rather than random sampling, the system identifies features in the unlabeled pool that the classifier is most certain about—those with the highest probability of belonging to either Class 0 or Class 1.
- Information Maximization: The authors demonstrate that this bimodal strategy asymptotically maximizes the Mutual Information (MI) between features and labels, thereby amplifying the detectable statistical difference between groups.
- Anytime-Valid P-Values: By utilizing Ville’s maximal inequality, the framework ensures that the p-value remains valid at every step. This allows for early stopping without inflating the Type I error (false positives).
Experimental Evaluation
The BQ-AST framework was evaluated across three distinct datasets:
- Synthetic Datasets: Gaussian distributions with varying overlap were used to validate the theoretical foundations.
- MNIST: Using features from a convolutional autoencoder, the test distinguished between different digit distributions.
- ADNI (Alzheimer’s Disease Neuroimaging Initiative): This clinical application tested the dependency between inexpensive digital cognitive scores and expensive Amyloid-beta PET scans.
Key Results
- Type I Error Control: Empirical Type I errors remained strictly below the significance level ($\alpha = 0.05$) across all experiments.
- Enhanced Testing Power: In MNIST trials, the active test reached a "Reject Null" conclusion significantly faster than passive sampling.
- Clinical Efficiency: On the ADNI dataset, BQ-AST decreased Type II error (false negatives) by 58% and saved up to 62% on label queries compared to non-active sequential baselines. This indicates that clinicians could validate digital biomarkers with far fewer expensive scans.
Discussion and Future Work
The core innovation of this research is the realization that active learning can be used to "amplify" perceived differences between distributions. By focusing on high-dependency regions of the feature space, hard testing problems are transformed into simpler ones.
Despite its success, the framework faces a "cold start" problem, requiring an initial set of randomly labeled samples to warm up the classifier. Furthermore, the test's power is inherently tied to the classifier's ability to model the feature-label relationship. Future research will explore more complex query schemes and extend the framework to multi-sample testing scenarios.
Summary updated