wasserstein

function wasserstein(x1:Real[_], x2:Real[_]) -> Real

1-Wasserstein distance between two univariate empirical distributions with equal number of samples.

  • x1: Samples from the first distribution.
  • x2: Samples from the second distribution.

Return: 1-Wasserstein distance between x1 and x2.