Skip to content

persistenceH0

function persistenceH0(vIn): PersistenceH0;

Defined in: metrics/topology.ts:54

The degree-0 persistence diagram: the scales at which connected pieces merge.

Equivalently the edge lengths of the euclidean minimum spanning tree. Returned sorted, with the endpoints each merge came from.

ParameterType
vInPointsInput

PersistenceH0

import { persistenceH0 } from "@saehrimnir/sickle";
// H0 persistence is the minimum spanning tree: every component is born at 0
// and dies when an edge joins it, so only the deaths carry information.
const d = persistenceH0(data);
d.deaths.length; // 199 — n - 1 MST edges
d.deaths[0]; // 0.8461 — deaths come sorted ascending
d.source[0]; // the two endpoints of the edge that closed this component
d.diameter; // 30.0472 — the largest pairwise distance