Wasserstein Distance Between Two Empirical Distributions
The Wasserstein distance of order p measures how far apart two distributions are as the least average cost, in the units of the variable, of moving the probability mass of one onto the other. For one-dimensional samples it equals the p-th mean absolute difference between the two quantile functions.
Wasserstein 거리는 한 분포의 확률 질량을 다른 분포로 옮기는 최소 평균 비용으로 두 분포의 차이를 변수 단위 그대로 재는 거리이며, 일차원에서는 두 분위함수 차이의 p제곱 평균으로 계산된다.
How different are two whole distributions, measured in the original units of the variable?
두 집단의 분포 전체가 원래 단위로 얼마나 다른지 어떻게 잴 수 있나요?
The order-1 Wasserstein (earth mover's) distance is the area between the two empirical cumulative distribution curves, so it reflects differences in location, spread and shape at once and is easy to interpret in the variable's units. A permutation test that reshuffles group labels tells you whether the distance is larger than chance would produce.
When to use Wasserstein Distance Between Two Empirical Distributions
- You want one interpretable number for how far apart two distributions are.
- Distributions may differ in shape or spread, not only in mean or median.
- You compare a model or simulation output with observed data on the same scale.
When to use something else
- You only need a test of whether the distributions differ, with a classic statistic: use Two-Sample Kolmogorov-Smirnov Test.
- You want a distance-based test that extends to several samples or variables: use Energy Distance Test of Equal Distributions (Two- and k-Sample).
- You care about a shift in location only: use Mann-Whitney U Test.
Assumptions and requirements
- Observations are independent within and between groups.
- The variable is measured on an interval scale so that distances are meaningful.
- For the permutation p-value, group labels are exchangeable under the null hypothesis.
What the analysis reports
- Wasserstein distance of the chosen order
- Distance relative to the pooled standard deviation
- Exact or Monte Carlo permutation p-value
- Group means, medians and standard deviations
How to report it
The order-1 Wasserstein distance between the two groups was W = [value] ([value] pooled SDs); a permutation test with [value] relabellings gave p = [value].
Related methods
- Two-Sample Kolmogorov-Smirnov Test
- Energy Distance Test of Equal Distributions (Two- and k-Sample)
- Permutation Test for Two Groups
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with SciPy and direct computations (formulas, enumeration or simulation).
독립 계산. SciPy·직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Wasserstein Distance Between Two Empirical Distributions on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable and a grouping variable
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.