TL;DR
Modern kernel tests (like MMD) often optimize kernel hyperparameters to maximize statistical power, but standard practice requires splitting the dataset into training and test sets to avoid inflating false positives. This paper introduces a selective hypothesis testing approach that enables learning optimal kernel combinations and running the test on the entire dataset without splitting. By conditioning on the selection event (the "active set" of kernels), the authors derive exact, closed-form null distributions that guarantee valid Type-I error control while consistently outperforming data-splitting methods in test power.
What Problem Does This Paper Address?
In hypothesis testing—such as two-sample testing with Maximum Mean Discrepancy (MMD)—the test's power depends heavily on choosing good kernel hyperparameters (e.g., bandwidths). To find the most sensitive test statistic, practitioners typically adopt a "learn-then-test" approach:
- Optimize kernel hyperparameters on a training split.
- Run the hypothesis test on an independent test split.
While splitting prevents data leakage and ensures an analytically tractable null distribution, it comes at a steep price: throwing away a fraction of your data for the testing stage reduces sample size, directly lowering test power. Conversely, reusing the same data for both learning and testing introduces statistical dependency, causing naive tests to overfit and severely inflate false positive (Type-I) errors.
The authors tackle a central question: Can we learn the test statistic and test on the complete dataset without data splitting, while maintaining rigorous Type-I error calibration?
Methods
The paper focuses on linear-time MMD estimates computed from $d$ base kernels. By the Central Limit Theorem, these base statistics converge asymptotically to a joint multivariate normal distribution $\tau \sim \mathcal{N}(\mu, \Sigma)$. To maximize the signal-to-noise ratio (SNR), the optimal test combines these base statistics linearly via weights $\beta$.
- Finite Selection (Grid Search): If selecting a single best kernel from a finite grid, the authors apply the polyhedral lemma from post-selection inference (Lee et al., 2016) to condition on the selected index, yielding a truncated normal null distribution.
- Uncountable Selection (Continuous Weights): Choosing arbitrary linear combinations over an uncountable set violates standard polyhedral conditioning. The authors analyze two continuous formulations:
- Wald Test: Unconstrained linear combinations ($\|\beta\| = 1$) yield the classic Wald statistic $\|\Sigma^{-1/2} \tau\|$, which follows a $\chi_d$ distribution under the null. However, it tests against two-sided alternatives ($\mu \neq 0$), ignoring that population MMD is strictly non-negative ($\mu \ge 0$).
- One-Sided Test (OST): To leverage the non-negativity constraint ($\Sigma \beta \ge 0$), the authors formulate an optimization problem. Instead of conditioning on the exact continuous weight vector $\beta^*$, they condition on its active set $\mathcal{U} := \{u \mid \beta^*_u \neq 0\}$ of size $l = |\mathcal{U}|$:
- If $l \ge 2$: The maximized statistic conditioned on $\mathcal{U}$ follows a $\chi_l$ distribution.
- If $l = 1$: Conditioned on the active feature and an orthogonal nuisance vector, the statistic follows a standard normal distribution truncated from below at a computable threshold $V^-$.
- This formulation yields exact test thresholds ($t_\alpha$) in closed form and runs in $\mathcal{O}(n)$ time.
┌───────────────────────────────┐
│ d Jointly Normal Base Tests │
└───────────────┬───────────────┘
│
Solve convex problem for
optimal weights β* (Σβ* ≥ 0)
│
▼
Identify Active Set U (size l)
│
┌───────────────┴───────────────┐
│ │
l = 1 l ≥ 2
│ │
Truncated Normal Threshold Chi(l) Threshold
│ │
└───────────────┬───────────────┘
▼
Compare τ_OST to t_α
Datasets
The authors evaluate two-sample tests across multiple synthetic and benchmark datasets:
- DIFF VAR ($p = 1$): Testing $P = \mathcal{N}(0, 1)$ against $Q = \mathcal{N}(0, 1.5)$.
- MNIST ($p = 49$): Downsampled $7 \times 7$ digit images; $P$ contains all digits $\{0, \dots, 9\}$, while $Q$ contains only odd digits $\{1, 3, 5, 7, 9\}$.
- Blobs ($p = 2$): A mixture of anisotropic 2D Gaussians with differing covariance orientations between $P$ and $Q$.
- Moment-Matched Synthetic 1-D: A constructed 1D distribution where $P$ and $Q$ have identical first three moments and vanishing odd moments, evaluated using homogeneous polynomial kernels of orders $1$ through $5$.
Key Insights and Ideas
- Conditioning on the active set bypasses continuous selection issues: Standard selective inference (like Lee et al.'s PSI framework for Lasso) conditions on polyhedral selection events from finite sets. By conditioning on the support (active set) rather than the continuous parameter value, the authors extend post-selection inference to an uncountable candidate set of tests.
- One-sided prior constraints provide free power: The classic Wald test tests against $\mu \neq 0$ and ignores the direction of the alternative. Incorporating the known physics of the problem—that MMD squared is non-negative ($\mu \ge 0$, leading to $\Sigma \beta \ge 0$)—restricts the search space and boosts test power over standard Wald testing.
- Data splitting exhibits an unpredictable trade-off: The optimal split ratio (e.g., 10% vs. 50% vs. 80% for training) varies wildly across tasks. If base kernels are weakly informative, spending data on selection helps; if selection is trivial, reserving data for testing is better. OST completely sidesteps this hyperparameter tuning problem.
Key Results
- Strictly Higher Power: Across all sample sizes ($n \in [500, 6000]$) on MNIST, Blobs, and Diff Var, OST achieved lower Type-II error than all data-splitting baselines, regardless of whether the split ratio favored training (80/20), equal division (50/50), or testing (10/90).
- Exact Calibration: At a target significance level $\alpha = 0.05$, OST, Wald, and data splitting maintained the nominal Type-I error rate of $\approx 0.05$. The naive baseline (optimizing and testing on the full dataset without threshold correction) severely failed calibration, producing inflated false-positive rates.
- Superiority over Wald: OST consistently demonstrated equal or lower Type-II error compared to the unconstrained Wald test across all base kernel sets ($d = 1, 2, 6$).
- Polynomial Kernel Moment Detection: On the moment-matched experiment, OST successfully identified the discriminating 4th-order polynomial without overfitting when uninformative 1st–3rd order polynomials were present.
Limitations and Future Work
- Reliance on Asymptotic Joint Normality: The closed-form conditional null distribution relies on the base statistics having an asymptotic Gaussian distribution under $H_0$. While this holds for linear-time MMD and linear-time Kernelized Stein Discrepancy (KSD), it does not directly hold for complete U-statistics (which scale quadratically with sample size and have non-Gaussian degenerate null distributions).
- Block/Incomplete U-Statistics Approximation: Applying this method to lower-variance incomplete or block MMD estimators requires treating their null distributions as approximately normal, which may introduce calibration errors at smaller sample sizes.
- Black-Box Learned Representations: The current framework cannot be trivially extended to end-to-end neural network feature extractors (e.g., deep classifier two-sample tests) where the candidate set cannot be represented as a linear combination of fixed, asymptotically normal statistics.
Summary updated