cot.rpw

cot.rpw(DA=None, SB=None, dist=None, eps=0.1, k=1, p=1)[source]

Computes the approximated Robust Partial p-Wasserstein (RPW) distance [4] between two discrete distributions. The RPW metric provides a robust distance between distributions by considering partial optimal transport plan.

Parameters:
  • DA (numpy array, shape (n,)) – A n by 1 array, each DA(i) represent the mass of demand on ith type a vertex. The sum of DA should equal to 1.

  • SB (numpy array, shape (n,)) – A n by 1 array, each SB(i) represent the mass of supply on ith type b vertex. The sum of SB should equal to 1.

  • dist (numpy array, shape (n, n)) – A n by n cost matrix, each C(i,j) represents the cost between ith type b and jth type a vertex.

  • eps (float, default=0.1) – The additive error of OT-Profile, the value of \(\epsilon\) in paper [4].

  • k (int, default=1) – Scaling factor in the RPW distance.

  • p (int, default=1) – The order of the Wasserstein distance.

Returns:

pk_rpw – The computed approximated RPW distance between the two distributions.

Return type:

float

References