# Persistence diagram

Is there an easy way to get a persistence diagram of given planar points? For example the following points:

SeedRandom[123]
pnts0 = Table[{(1 + 0.05 RandomReal[{-1, 1}]) Cos[2 \[Pi] s], (1 + 0.05 RandomReal[{-1, 1}]) Sin[2 \[Pi] s]}, {s, 0, 10, 0.002}];
pnts1 = Join[pnts0, RandomReal[{-1, 1}, {200, 2}]];


Plotting the gives

and

respectively.

Obviously the points pnts0 have a persistent cycle that the points pnts1 lack. Is there a way to get the persistence diagram for the points pnts1?

I've seen this question and I can count the cycles, however since there are more than 1, I need to keep track of when each one appears and disappears. What is the proper way to do that?

• Can you explain what you mean by a "persistence diagram"? What should the output look like? – MassDefect Jan 24 at 18:02
• @MassDefect it denotes when a "feature" was created (the $x$ values) and when it was destroyed (the $y$ value). It looks like the right picture here: gudhi.inria.fr/python/latest/_images/3DTorus_poch.png – tst Jan 24 at 18:13