if(rlang::is_installed("stats")) {
n <- 128
p <- 10
x <- matrix( stats::rnorm( p * n ), nrow = n, ncol = p )
y <- matrix( stats::rnorm( p * n ), nrow = n, ncol = p )
dist <- wasserstein(x,y, p = 2, ground_p = 1, observation.orientation = "rowwise",
method = "hilbert") #fast
print(dist)
}
Run the code above in your browser using DataLab