Persistence Intervals and Diagrams

PersistenceDiagrams.PersistenceIntervalType
PersistenceInterval{T<:AbstractFloat, C}

The type that represents a persistence interval. It behaves exactly like a Tuple{T, T}, but may have a representative cocycle attached to it.

source
PersistenceDiagrams.representativeMethod
representative(interval::PersistenceInterval)

Get the representative cocycle attached to interval. If representatives were not computed, throw an error.

source
PersistenceDiagrams.PersistenceDiagramType
PersistenceDiagram{P<:PersistenceInterval} <: AbstractVector{P}

Type for representing persistence diagrams. Behaves exactly like an array of PersistenceIntervals, but is aware of its dimension and supports pretty printing and plotting.

source
PersistenceDiagrams.barcodeMethod
barcode(diagram)

Plot the barcode plot of persistence diagram or multiple diagrams diagrams. The infinity keyword argument determines where the infinity line is placed. If unset, the function tries to use threshold(diagram) or guess a good position to place the line at.

source

Distances Between Persistence Diagrams

PersistenceDiagrams.matchingFunction
matching(m::Matching; bottleneck=m.bottleneck)

Get the matching of a Matching object represented by a vector of pairs of intervals. If bottleneck is set to true, only return the edges with length equal to the weight of the matching.

source
matching(::Bottleneck, left, right)

Find the bottleneck matching between persistence diagrams left and right. Infinite intervals are matched to eachother.

left = PersistenceDiagram(0, [(1.0, 2.0), (5.0, 8.0)])
right = PersistenceDiagram(0, [(1.0, 2.0), (3.0, 4.0), (5.0, 10.0)])
matching(Bottleneck(), left, right)

# Example

# output

3-element Matching with weight 2.0:
 [1.0, 2.0) => [1.0, 2.0)
 [3.0, 3.0) => [3.0, 4.0)
 [5.0, 8.0) => [5.0, 10.0)

See also

source
matching(::Wasserstein, left, right)

Find the Wasserstein matching between persistence diagrams left and right. Infinite intervals are matched to eachother.

Example

left = PersistenceDiagram(0, [(1.0, 2.0), (5.0, 8.0)])
right = PersistenceDiagram(0, [(1.0, 2.0), (3.0, 4.0), (5.0, 10.0)])
matching(Wasserstein(), left, right)

# output

3-element Matching with weight 3.0:
 [1.0, 2.0) => [1.0, 2.0)
 [3.0, 3.0) => [3.0, 4.0)
 [5.0, 8.0) => [5.0, 10.0)

See also

source
PersistenceDiagrams.distanceFunction
distance(::Matching)

Get the weight of a Matching object.

source
distance(::Bottleneck, left, right)

Compute the bottleneck distance between persistence diagrams left and right. Infinite intervals are matched to eachother.

Example

left = PersistenceDiagram(0, [(1.0, 2.0), (5.0, 8.0)])
right = PersistenceDiagram(0, [(1.0, 2.0), (3.0, 4.0), (5.0, 10.0)])
distance(Bottleneck(), left, right)

# output

2.0

See also

source
distance(::Wasserstein, left, right)

Compute the Wasserstein distance between persistence diagrams left and right. Infinite intervals are matched to eachother.

Example

left = PersistenceDiagram(0, [(1.0, 2.0), (5.0, 8.0)])
right = PersistenceDiagram(0, [(1.0, 2.0), (3.0, 4.0), (5.0, 10.0)])
distance(Wasserstein(), left, right)

# output

3.0

See also

source
PersistenceDiagrams.BottleneckType
Bottleneck

Use this object to find the bottleneck distance or matching between persistence diagrams. The distance value is equal to

\[W_\infty(X, Y) = \inf_{\eta:X\rightarrow Y} \sup_{x\in X} ||x-\eta(x)||_\infty,\]

where $X$ and $Y$ are the persistence diagrams and $\eta$ is a perfect matching between the intervals. Note the $X$ and $Y$ don't need to have the same number of points, as the diagonal points are considered in the matching as well.

Warning

Computing the bottleneck distance requires $\mathcal{O}(n^2)$ space!

Methods

source
PersistenceDiagrams.WassersteinType
Wasserstein(q=1)

Use this object to find the Wasserstein distance or matching between persistence diagrams. The distance value is equal to

\[W_q(X,Y)=\left[\inf_{\eta:X\rightarrow Y}\sum_{x\in X}||x-\eta(x)||_\infty^q\right],\]

where $X$ and $Y$ are the persistence diagrams and $\eta$ is a perfect matching between the intervals. Note the $X$ and $Y$ don't need to have the same number of points, as the diagonal points are considered in the matching as well.

Warning

Computing the Wasserstein distance requires $\mathcal{O}(n^2)$ space!

Methods

source