Skip to content

Filtrations & persistence

Persistence diagrams are precise but hard to read cold. The intuition behind them is a sweep: pick a scale, connect everything closer than that scale, and watch the shape of the data change as the scale grows.

Each point grows an “influence ball” of radius scale / 2. When two balls touch, their points connect — and separate pieces merge (a component, H₀, dies). When a ring of points is enclosed but not yet filled, there is a loop (H₁) alive; once the interior fills with triangles, the loop dies. The counts below are the Betti numbers H₀ (components) and H₁ (loops) at the current scale, from the same reducer as src/spatial/persistence.ts.

Switch the view between the flat 2-D picture, a cones scale-space — each point becomes a cone of its distance function, and a slice plane at the current scale cuts out the 2-D disks, so sweeping the plane up the cones is the filtration — or both side by side. Drag the cones to rotate.

viewH₀ –  H₁ –
Vietoris–Rips complex
colour = connected component (H₀)
persistence diagram
filled = alive at this scale · H₀ / H₁
scale0.0
  • H₀ (components) starts high — every point is its own island — and falls as balls merge islands together. The “two clusters” shape parks at H₀ = 2 for a while before merging to 1: that plateau is what makes two clusters a real, persistent feature rather than noise.
  • H₁ (loops) appears when a cycle of connections encloses empty space, and dies when that space fills in. The “ring” holds one loop across a wide band of scales; the “figure-eight” holds two. A feature that survives a wide band of scales is the robust topology — exactly what a persistence diagram records as a point far from the diagonal.

This is the filtration a Vietoris–Rips persistence reducer walks through. The toolbox’s job is to build this filtration efficiently — including the density- adaptive CkNN variant — and hand it to the reducer, which reads off how long each component and loop survives.

The sweep above grows hard balls: a point is in the set or it isn’t, and the boundary of a union of balls has corners where two balls meet. That hard threshold is the same boxcar we replaced with a smooth window everywhere else in this toolbox (see Fuzzy TDA), and it has the same costs: the boundary is non-smooth, and a single stray outlier spawns a full-strength ball at radius 0 — a long, important-looking bar that is really just noise.

The fuzzy filtration replaces each hard ball with a smooth Gaussian kernel and thresholds the resulting density field — the superlevel-set filtration of a KDE. Now the boundary is C-infinity (no corners), and how strongly a region counts depends on how much density is piled there, so sparse noise is demoted toward the diagonal. The robust-statistics version, distance-to-measure (DTM), makes this a theorem: its persistence is provably stable to outliers in the bottleneck/Wasserstein sense, which Čech/Vietoris–Rips is not.

Sweep the same parameter through both. Turn outliers on and watch the hard diagram (left) sprout points far from the diagonal while the fuzzy diagram (right) keeps the noise near it and the true feature prominent. Switch the fuzzy field between KDE and DTM.

The second row of controls exposes the parameters that decide what counts as structure. Falloff is the kernel bandwidth σ (or, for DTM, the neighbour count k): widen it and nearby features merge; narrow it and a smooth ring shatters into a necklace of separate density beads (H₀ climbs). Resolution is the grid the field is sampled on. Noise band is the persistence threshold below which a feature is treated as noise — the shaded strip along the diagonal — i.e. the line between signal and chatter that a hard filtration forces you to draw by hand.

fuzzy fieldCPU
hard — union of balls distance, sublevel
hover a component or a hole to inspect it
fuzzy — KDE superlevel set density, superlevel
hover a component or a hole to inspect it
H₀ –  H₁ – · spurious bars cluster off the diagonal
H₀ –  H₁ – · noise stays near the diagonal
sweep0%
  • This toolbox — the Betti counts come from src/spatial/persistence.ts (standard boundary-matrix reduction over ℤ/2); the density-adaptive scale variant is CkNN. The diagram conventions follow the persistence diagram primitive.
  • R. Ghrist, Barcodes: the persistent topology of data, Bull. Amer. Math. Soc. 45 (2008) — the most readable entry point.
  • G. Carlsson, Topology and data, Bull. Amer. Math. Soc. 46 (2009).
  • H. Edelsbrunner & J. Harer, Computational Topology: An Introduction (AMS, 2010) — the standard textbook for the reduction algorithm and Vietoris–Rips/Čech complexes.
  • N. Otter et al., A roadmap for the computation of persistent homology, EPJ Data Science 6 (2017) — practical, computation-focused (open access).

On the fuzzy / robust filtrations in the second demo:

  • F. Chazal, D. Cohen-Steiner & Q. Mérigot, Geometric inference for probability measures, Found. Comput. Math. 11 (2011) — the distance-to-measure function.
  • F. Chazal, B. Fasy, F. Lecci, B. Michel, A. Rinaldo & L. Wasserman, Robust Topological Inference: Distance To a Measure and Kernel Distance, JMLR 18 (2017) — stability of DTM- and KDE/kernel-distance filtrations to noise and outliers.
  • H. Anai, F. Chazal, M. Glisse, Y. Ike, H. Inakoshi, R. Tinarrage & Y. Umeda, DTM-based filtrations, SoCG 2019 — the weighted-Rips construction this demo’s DTM field is the field analogue of.