Skip to contents

Above one dimension there is no sorting shortcut, so the coupling is an assignment problem. With equal-size samples the optimal coupling is a permutation, found here by the Hungarian method – exact and deterministic, unlike entropic approximations that depend on a regularisation parameter and a stopping rule.

Usage

Wsdt2d(X_samples, Y_samples, p = 2)

Arguments

X_samples, Y_samples

Equal-size point clouds.

p

Order.

Value

List with estimate, wpp, assignment, n.

Details

Formula: W_p^p = min_sigma (1/n) sum_i ||x_i - y_sigma(i)||^p.

References

Villani, C. (2009). Optimal Transport: Old and New, Springer Grundlehren 338, ch 6; Kuhn, H. W. (1955) NRLQ 2:83-97.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Wsdt2d(V, V)
#> $estimate
#> [1] 0
#> 
#> $wpp
#> [1] 0
#> 
#> $assignment
#> [1] 0 1 2 3 4 5 6 7
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Wasserstein-p by optimal assignment"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"