wasserstein | R Documentation |
The function wasserstein
computes the Wasserstein distance between two persistence diagrams.
wasserstein(Diag1, Diag2, p = 1, dimension = 1)
Diag1 |
an object of class |
Diag2 |
an object of class |
p |
integer specifying the power to be used in the computation of the Wasserstein distance. The default value is |
dimension |
an integer or a vector specifying the dimension of the features used to compute the wasserstein distance. 0 for connected components, 1 for loops, 2 for voids and so on. The default value is |
The Wasserstein distance between two diagrams is the cost of the optimal matching between points of the two diagrams. When a vector is given for dimension
, then maximum among bottleneck distances using each element in dimension
is returned. This function is an R wrapper of the function "wasserstein_distance" in the C++ library Dionysus. See references.
The function wasserstein
returns the value of the Wasserstein distance between the two persistence diagrams.
Jisu Kim and Fabrizio Lecci
Morozov D (2007). "Dionysus, a C++ library for computing persistent homology". https://www.mrzv.org/software/dionysus/.
Edelsbrunner H, Harer J (2010). "Computational topology: an introduction." American Mathematical Society.
bottleneck
,
alphaComplexDiag
, alphaComplexDiag
, gridDiag
, ripsDiag
,
plot.diagram
XX1 <- circleUnif(20)
XX2 <- circleUnif(20, r = 0.2)
DiagLim <- 5
maxdimension <- 1
Diag1 <- ripsDiag(XX1, maxdimension, DiagLim, printProgress = FALSE)
Diag2 <- ripsDiag(XX2, maxdimension, DiagLim, printProgress = FALSE)
wassersteinDist <- wasserstein(Diag1[["diagram"]], Diag2[["diagram"]], p = 1,
dimension = 1)
print(wassersteinDist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.