Skip to contents

Rabin et al. build their texture-mixing barycenter out of projected quantile functions, which is what lets the two clouds have different sizes: instead of pairing order statistics one for one, both projections are evaluated at a common grid of probabilities. When the clouds do have the same size the grid reproduces the order statistics exactly, so this agrees with the sorted estimator.

Usage

Otsd(X, Y, p = 2, n_proj = 32)

Arguments

X, Y

Point clouds; the counts may differ.

p

Exponent, positive.

n_proj

Number of directions.

Value

List with SW, SW_p, per_proj, n, m, d, n_proj, grid_size.

Details

Formula: \(SW_p^p = E_theta int_0^1 |Finv_mu(q) - Finv_nu(q)|^p dq\), on the midpoint grid q_k = (k - 1/2)/G – Rabin et al. (2012) Section 3.

References

Rabin, J., Peyre, G., Delon, J. and Bernot, M. (2012). Lecture Notes in Computer Science 6667:435-446. doi:10.1007/978-3-642-24785-9_37 .

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Otsd(V, V)
#> $SW
#> [1] 0
#> 
#> $SW_p
#> [1] 0
#> 
#> $per_proj
#>  [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
#> 
#> $n
#> [1] 8
#> 
#> $m
#> [1] 8
#> 
#> $d
#> [1] 1
#> 
#> $n_proj
#> [1] 32
#> 
#> $grid_size
#> [1] 8
#> 
#> $method
#> [1] "Quantile-based sliced Wasserstein distance"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"