pairwise-distances {phutil} | R Documentation |
Pairwise distances within a set of persistence diagrams
Description
This collection of functions computes the pairwise distance matrix between all pairs in a set of persistence diagrams of the same homology dimension. The diagrams must be represented as 2-column matrices. The first column of the matrix contains the birth times and the second column contains the death times of the points.
Usage
bottleneck_pairwise_distances(
x,
tol = sqrt(.Machine$double.eps),
validate = TRUE,
dimension = 0L,
ncores = 1L
)
wasserstein_pairwise_distances(
x,
tol = sqrt(.Machine$double.eps),
p = 1,
validate = TRUE,
dimension = 0L,
ncores = 1L
)
kantorovich_pairwise_distances(
x,
tol = sqrt(.Machine$double.eps),
p = 1,
validate = TRUE,
dimension = 0L,
ncores = 1L
)
Arguments
x |
A list of either 2-column matrices or objects of class persistence specifying the set of persistence diagrams. |
tol |
A numeric value specifying the relative error. Defaults to
|
validate |
A boolean value specifying whether to validate the input
persistence diagrams. Defaults to |
dimension |
An integer value specifying the homology dimension for which
to compute the distance. Defaults to |
ncores |
An integer value specifying the number of cores to use for
parallel computation. Defaults to |
p |
A numeric value specifying the power for the Wasserstein distance.
Defaults to |
Value
An object of class 'dist' containing the pairwise distance matrix between the persistence diagrams.
Examples
spl <- persistence_sample[1:10]
# Extract the list of 2-column matrices for dimension 0 in the sample
x <- lapply(spl[1:10], function(x) x$pairs[[1]])
# Compute the pairwise Bottleneck distances
Db <- bottleneck_pairwise_distances(spl)
Db <- bottleneck_pairwise_distances(x)
# Compute the pairwise Wasserstein distances
Dw <- wasserstein_pairwise_distances(spl)
Dw <- wasserstein_pairwise_distances(x)