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