How to use this calculator
Measure the one-dimensional earth-mover distance between two equally weighted empirical samples, even of different sizes.
- Enter First equally weighted sample, Second equally weighted sample. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Empirical one dimensional Wasserstein distance explained
A numerical walkthrough
First equally weighted sample = 0, 1; Second equally weighted sample = 1, 3.
- Wasserstein-1 distance: 1.5 input units
The model behind the numbers
Integral of empirical CDF difference
Assumptions: observations have equal mass within each sample and share one measurement unit. This empirical distance compares the supplied samples directly; it does not infer population uncertainty.
What to enter
a— First equally weighted sample- First nonempty sample of measurements, all in one common unit; observations receive equal weight.
b— Second equally weighted sample- Second nonempty sample in that same unit. It need not have the same number of observations as the first.
Interpreting the result
The result keeps the input unit: 1.5 means the empirical distributions differ by an average absolute transport distance of 1.5 input units.
Frequently asked questions
Must samples have the same length?
No.
Does input order matter?
No, points are sorted internally.
What are the units?
The same as the sample measurements.
How do I use the Empirical one dimensional Wasserstein distance calculator?
Enter First equally weighted sample, Second equally weighted sample. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Empirical one dimensional Wasserstein distance?
First equally weighted sample = 0, 1; Second equally weighted sample = 1, 3. Wasserstein-1 distance: 1.5 input units
Read our calculation methodology.