PersistenceFilter

org.appliedtopology.tda4j.PersistenceFilter

Dropping short bars, relative to the scale of the input: the policy behind diagram.longerThanFraction(), bars.longerThanFraction() and the MATLAB/CLI default. (Zero-length bars are already gone: engines leave them out unless asked. For a fixed threshold, longerThan(eps) is simpler.)

This is a rule of thumb for what to show, not a statistical test: it keeps a bar because it is long compared with the data's scale, not because it is unlikely to be noise. For a threshold that comes from the sample itself, see BootstrapBand.

'''The scale.''' A bar is judged against a scale the caller supplies: for a point cloud or distance matrix, metricSpace.minimumEnclosingRadius (Ripser's enclosing radius: past it the Vietoris-Rips complex is a cone and nothing new is born, so every bar lies in [0, scale]; it is also the default Vietoris-Rips truncation); for a cubical image, the range of its values. It is used in the units the complex reports (diameters for Vietoris-Rips, radii for Cech/alpha). Without such a quantity, filtrationRange, the span of the barcode's own finite endpoints, is the fallback.

'''The rule.''' A bar is kept iff it is essential or its persistence is strictly greater than the threshold. A threshold <= 0 keeps everything.

Attributes

Experimental
true
Source
PersistenceFilter.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def filtrationRange(births: Array[Double], deaths: Array[Double]): Double

The span of a barcode's own finite endpoints: (largest finite endpoint) - (smallest finite birth), 0 if there is none. The fallback scale when nothing about the input itself is available (or the supplied scale is not finite).

The span of a barcode's own finite endpoints: (largest finite endpoint) - (smallest finite birth), 0 if there is none. The fallback scale when nothing about the input itself is available (or the supplied scale is not finite).

Attributes

Source
PersistenceFilter.scala
def filtrationRange[A](bars: Iterable[PersistenceBar[Double, A]]): Double

filtrationRange for a list of bars.

filtrationRange for a list of bars.

Attributes

Source
PersistenceFilter.scala
def keptIndices(births: Array[Double], deaths: Array[Double], threshold: Double): Array[Int]

Indices of the bars kept under threshold (see the object doc for the rule), in their original order.

Indices of the bars kept under threshold (see the object doc for the rule), in their original order.

Attributes

Source
PersistenceFilter.scala
def longerThanFraction[A](bars: List[PersistenceBar[Double, A]], minPersistence: Optional[Double] = ..., fraction: Double = ..., scale: Optional[Double] = ...): List[PersistenceBar[Double, A]]

The bars worth reporting: all of bars except those with persistence at or below the threshold -- minPersistence (absolute) if given, else fraction of scale (default: the bars' own filtrationRange; pass Some(metricSpace.minimumEnclosingRadius) for the standard scale). Essential bars are always kept; a threshold of 0 (minPersistence = Some(0.0) or fraction = 0.0) keeps everything. Order and annotations (representative chains) are preserved.

The bars worth reporting: all of bars except those with persistence at or below the threshold -- minPersistence (absolute) if given, else fraction of scale (default: the bars' own filtrationRange; pass Some(metricSpace.minimumEnclosingRadius) for the standard scale). Essential bars are always kept; a threshold of 0 (minPersistence = Some(0.0) or fraction = 0.0) keeps everything. Order and annotations (representative chains) are preserved.

Attributes

Source
PersistenceFilter.scala
def persistence(birth: Double, death: Double): Double

Persistence of a bar given as raw birth/death values; +Infinity for an essential (never-dying) class.

Persistence of a bar given as raw birth/death values; +Infinity for an essential (never-dying) class.

Attributes

Source
PersistenceFilter.scala
def threshold(minPersistence: Option[Double], fraction: Double, scale: => Double, fallbackScale: => Double): Double

The threshold to apply: minPersistence if given (absolute, in the barcode's own units), otherwise fraction * scale. scale is by-name and only evaluated when a fraction of it is actually needed (it can be expensive -- a minimum enclosing radius is quadratic -- and is pointless for an absolute threshold or fraction = 0); if it turns out not to be finite (a disconnected or infinite-distance input) fallbackScale is used instead. Rejects a negative or non-finite minPersistence/fraction.

The threshold to apply: minPersistence if given (absolute, in the barcode's own units), otherwise fraction * scale. scale is by-name and only evaluated when a fraction of it is actually needed (it can be expensive -- a minimum enclosing radius is quadratic -- and is pointless for an absolute threshold or fraction = 0); if it turns out not to be finite (a disconnected or infinite-distance input) fallbackScale is used instead. Rejects a negative or non-finite minPersistence/fraction.

Attributes

Source
PersistenceFilter.scala

Concrete fields

val DefaultFraction: Double

The default relative threshold: a bar must extend beyond 1% of the scale to be kept.

The default relative threshold: a bar must extend beyond 1% of the scale to be kept.

Attributes

Source
PersistenceFilter.scala