DKMD: A fast signed statistic for distribution comparison
New statistic preserves direction of distributional shifts with O(N log N) speed.
Researchers Shijie Zhong and Jiangfeng Fu have introduced the Directional Kernel Mean Difference (DKMD), a novel signed statistic designed for comparing univariate distributions. Unlike the widely used squared Maximum Mean Discrepancy (MMD), which discards directional information by squaring the RKHS distance, DKMD integrates the difference of kernel mean embeddings against a fixed odd weighting function. This construction yields three structural properties: antisymmetry (flipping distributions flips the sign), immunity to symmetric distributional differences, and directional monotonicity under stochastic dominance. The authors derive a data-driven Riemann estimator that maintains asymptotic consistency with the continuous formulation, ensuring theoretical guarantees carry over to empirical evaluations.
To address the quadratic computational cost typical of kernel methods, the team developed an O(N log N) prefix-suffix scanning algorithm that exploits the total order of the real line, requiring only O(N) memory. Experiments on synthetic benchmarks show DKMD correctly isolates directional shifts from symmetric perturbations, remains robust to heavy-tailed outliers that can flip the sign of the mean difference, and scales to millions of samples in seconds. This makes DKMD a practical and principled tool for tasks where understanding the direction of distributional change is critical, such as drift detection, A/B testing, and two-sample testing with directional hypotheses.
- DKMD preserves direction of distributional shifts, unlike squared MMD which discards it.
- Achieves O(N log N) time complexity and O(N) memory, scaling to millions of samples.
- Robust to heavy-tailed outliers and maintains theoretical guarantees via a data-driven Riemann estimator.
Why It Matters
Enables fast, directional distribution comparison for drift detection and A/B testing at scale.