Learn R Programming

kernelTDA (version 1.0.0)

wasserstein.distance: L_p q-Wasserstein Distance

Description

Compute the q-Wasserstein distance between persistence diagrams using an arbitrary L_p norm as ground metric.

Usage

wasserstein.distance(d1, d2, dimension, q, p = 2)

Arguments

d1

A persistence diagram (matrix with 3 col where the first one is the dimension, the second is the birth-time and the third is the death-time).

d2

A persistence diagram (matrix with 3 col where the first one is the dimension, the second is the birth-time and the third is the death-time).

dimension

Dimension of the topological features of interest (0 for connected components, 1 for cycles etc).

q

Order of the q-Wasserstein distance.

p

Order of the L_p norm to be used as a ground metric in the computation of the Wasserstein distance.

Value

The value for the L_p q-Wassesterstein between d1 and d2.

Details

This function provides an R interface for the efficient C++ library `HERA` by Michael Kerber, Dmitriy Morozov, and Arnur Nigmetov (https://bitbucket.org/grey_narn/hera/src/master/).

References

kerber2017geometrykernelTDA

Examples

Run this code
# NOT RUN {
diag1 <- matrix(c(1,1,1,0,2,3,2,2.5,4), ncol = 3, byrow = FALSE)
diag2 <- matrix(c(1,1,0,1,1,2), ncol = 3, byrow = FALSE)
wasserstein.distance(diag1, diag2, dimension = 1, q = 1, p = 2)
# }

Run the code above in your browser using DataLab