wasserstein.distance: L_p q-Wasserstein Distance

Description Usage Arguments Details Value Author(s) References Examples

View source: R/wasserstein_distance.R

Description

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

Usage

1
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.

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/).

Value

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

Author(s)

Tullia Padellini, Francesco Palini. The included C++ library is authored by Michael Kerber, Dmitriy Morozov, and Arnur Nigmetov

References

\insertRef

kerber2017geometrykernelTDA

Examples

1
2
3
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)

Example output

[1] 2.767767

kernelTDA documentation built on April 19, 2020, 3:56 p.m.