PTED: A multi-dimensional two-sample test for scientific inference and generative machine learning
Abstract
Two-sample tests are widely applicable in inference and generative modelling, yet users frequently fall back on heuristics and visual inspection due to lack of an accessible test that operates in multiple dimensions. I present Permutation Test using the Energy Distance (PTED), a Python implementation of a powerful two-sample test described in Székely and Rizzo [2004]. The test statistic is the energy distance, a metric on probability distributions that admits a natural sample estimator built from pairwise distances. A permutation test is run on energy distances to produce an exact two-sample test. Because the statistic depends on the data only through pairwise distances, the test applies in high dimensions, on learned feature representations, at large or small or imbalanced sample sizes, and to any data type on which a distance can be defined. An approximation to the formula allows PTED to scale linearly with both number of dimensions and samples while retaining most discriminative power. I highlight a number of instructive sensitivity tests on PTED alongside other multi-dimensional two-sample tests for comparison. PTED is the only method that is sensitive to all tests, though conventional Maximum Mean Discrepancy is identical for all but an over-fitting test.
Create a lesson
Metadata
- Categories
- astro-ph.IM, physics.data-an, stat.ML
- Comments
- 23 pages, 14 figures, 1 table, Proceedings of the 2026 Joint Statistical Meetings (JSM)
Related papers
High-Precision Photometry with a scientific CMOS Camera: III Lab and on-Sky testing of Andor Toran-26B
Shared title terminologyastro-ph.IMIoannis Apergis, Leonidas Asimakoulas, Daniel Bayliss et al.
SlotFlow-GB: A Neural Framework for Trans-Dimensional Inference of Overlapping Galactic Binaries
Shared title terminologyastro-ph.IMNiklas Houba, Giovanni Giarda, Davide Piras
Multi-Method Machine Learning Classification of Astronomical Sources with Rubin Data Previews: a Spectroscopy-Free Approach with DP1 and DP2
Shared title terminologyastro-ph.IMAndrés Alejandro Plazas Malagón, Yasna Ordenes-Briceño, Dan S. Taranu et al.
Prototyping the Next-Generation Spectrograph for Space Exploration: Digital Micromirror Device-based Multi-Object Spectrograph (DMD-MOS) Calibration and Performance Assessment
Shared title terminologyastro-ph.IMJiayi Emma Xu, Sarik Jeram, Shaojie Chen et al.
Inferring radio beams from sparse sampling patterns: a case study with the Murchison Widefield Array
Shared title terminologyastro-ph.IMMichael J. Wilensky, Aman Chokshi
Photometric Throughput Curve Inversion via Bayesian Inference: A New Approach to CSST-MCI Flux Calibration
Shared title terminologyastro-ph.IMJing Zhong, Zhenya Zheng, Zhaojun Yan et al.