Topological data analysis

In applied mathematics, topological data analysis (TDA) is an approach to the analysis of datasets using techniques from topology. Extraction of information from datasets that are high-dimensional, incomplete and noisy is generally challenging. TDA provides a general framework to analyze such data in a manner that is insensitive to the particular metric chosen and provides dimensionality reduction and robustness to noise. Beyond this, it inherits functoriality, a fundamental concept of modern mathematics, from its topological nature, which allows it to adapt to new mathematical tools.
The initial motivation is to study the shape of data. TDA has combined algebraic topology and other tools from pure mathematics to allow mathematically rigorous study of "shape". The main tool is persistent homology, an adaptation of homology to point cloud data. Persistent homology has been applied to many types of data across many fields. Moreover, its mathematical foundation is also of theoretical importance. The unique features of TDA make it a promising bridge between topology and geometry.
Basic theory.
Intuition.
The premise underlying TDA is that shape matters. Real data in high dimensions is nearly always sparse, and tends to have relevant low dimensional features. One task of TDA is to provide a precise characterization of this fact. An illustrative example is a simple predator-prey system governed by the Lotka–Volterra equations. One can easily observe that the trajectory of the system forms a closed circle in state space. TDA provides tools to detect and quantify such recurrent motion.
Many algorithms for data analysis, including those used in TDA, require the choice of various parameters. Without prior domain knowledge, the correct collection of parameters for a data set is difficult to choose. The main insight of persistent homology is that we can use the information obtained from all values of a parameter. Of course this insight alone is easy to make; the hard part is encoding this huge amount of information into an understandable and easy-to-represent form. With TDA, there is a mathematical interpretation when the information is a homology group. In general, the assumption is that features that persist for a wide range of parameters are "true" features. Features persisting for only a narrow range of parameters are presumed to be noise, although the theoretical justification for this is unclear.
Early history.
Precursors to the full concept of persistent homology appeared gradually over time. In 1990, Patrizio Frosini introduced the size function, which is equivalent to the 0th persistent homology. Nearly a decade later, Vanessa Robins studied the images of homomorphisms induced by inclusion. Finally, shortly thereafter, Edelsbrunner et al. introduced the concept of persistent homology together with an efficient algorithm and its visualization as a persistence diagram. Carlsson et al. reformulated the initial definition and gave an equivalent visualization method called persistence barcodes, interpreting persistence in the language of commutative algebra. 
In algebraic topology the persistent homology has emerged through the work of Sergey Barannikov on Morse theory. The set of critical values of smooth Morse function was canonically partitioned into pairs "birth-death", filtered complexes were classified, their invariants, equivalent to persistence diagram and persistence barcodes, together with the efficient algorithm for their calculation, were described under the name of canonical forms in 1994 by Barannikov.
Concepts.
Some widely used concepts are introduced below. Note that some definitions may vary from author to author.
A point cloud is often defined as a finite set of points in some Euclidean space, but may be taken to be any finite metric space.
The Čech complex of a point cloud is the "nerve" of the "cover" of balls of a fixed radius around each point in the cloud.
A persistence module formula_1 indexed by formula_2 is a vector space formula_3 for each formula_4, and a linear map formula_5 whenever formula_6, such that formula_7 for all formula_8 and formula_9 whenever formula_10 An equivalent definition is a functor from formula_2 considered as a partially ordered set to the category of vector spaces.
The persistent homology group formula_12 of a point cloud is the persistence module defined as formula_13, where formula_14 is the Čech complex of radius formula_15 of the point cloud formula_16 and formula_17 is the homology group.
A persistence barcode is a multiset of intervals in formula_18, and a persistence diagram is a multiset of points in formula_19(formula_20).
The Wasserstein distance between two persistence diagrams formula_16 and formula_22 is defined as formula_23where formula_24 and formula_25 ranges over bijections between formula_16 and formula_22. Please refer to figure 3.1 in Munch for illustration.
The bottleneck distance between formula_16 and formula_22 is formula_30 This is a special case of Wasserstein distance, letting formula_31.
Basic property.
Structure theorem.
The first classification theorem for persistent homology appeared in 1994 via Barannikov's canonical forms. The classification theorem interpreting persistence in the language of commutative algebra appeared in 2005: for a finitely generated persistence module formula_32 with field formula_33 coefficients, 
formula_34
Intuitively, the free parts correspond to the homology generators that appear at filtration level formula_35 and never disappear, while the torsion parts correspond to those that appear at filtration level formula_36 and last for formula_37 steps of the filtration (or equivalently, disappear at filtration level formula_38).
Persistent homology is visualized through a barcode or persistence diagram. The barcode has its root in abstract mathematics. Namely, the category of finite filtered complexes over a field is semi-simple. Any filtered complex is isomorphic to its canonical form, a direct sum of one- and two-dimensional simple filtered complexes.
Stability.
Stability is desirable because it provides robustness against noise. If formula_16 is any space which is homeomorphic to a simplicial complex, and formula_40 are continuous tame functions, then the persistence vector spaces formula_41 and formula_42 are finitely presented, and formula_43, where formula_44 refers to the bottleneck distance and formula_45 is the map taking a continuous tame function to the persistence diagram of its formula_46-th homology.
Workflow.
The basic workflow in TDA is:
Graphically speaking, 
Computation.
The first algorithm over all fields for persistent homology in algebraic topology setting was described by Barannikov through reduction to the canonical form by upper-triangular matrices. The first algorithm for persistent homology over formula_51 was given by Edelsbrunner et al. Zomorodian and Carlsson gave the first practical algorithm to compute persistent homology over all fields. Edelsbrunner and Harer's book gives general guidance on computational topology.
One issue that arises in computation is the choice of complex. The Čech complex and Vietoris–Rips complex are most natural at first glance; however, their size grows rapidly with the number of data points. The Vietoris–Rips complex is preferred over Čech complex because its definition is simpler and the Čech complex requires extra effort to define in a general finite metric space. Efficient ways to lower the computational cost of homology have been studied. For example, the α-complex and witness complex are used to reduce the dimension and size of complexes.
Recently, Discrete Morse theory has shown promise for computational homology because it can reduce a given simplicial complex to a much smaller cellular complex which is homotopic to the original one. This reduction can in fact be performed as the complex is constructed by using matroid theory, leading to further performance increases. Another recent algorithm saves time by ignoring the homology classes with low persistence.
Various software packages are available, such as javaPlex, Dionysus, Perseus, PHAT, DIPHA, GUDHI, Ripser, and TDAstats. A comparison between these tools is done by Otter et al. Giotto-tda is a Python package dedicated to integrating TDA in the machine learning workflow by means of a scikit-learn API. An R package TDA is capable of calculating recently invented concepts like landscape and the kernel distance estimator. The Topology ToolKit is specialized for continuous data defined on manifolds of low dimension (1, 2 or 3), as typically found in scientific visualization. Another R package, TDAstats, implements the fast C++ Ripser library to calculate persistent homology. It also uses the ubiquitous ggplot2 package to generate reproducible, customizable, publication-quality visualizations of persistent homology, specifically topological barcodes and persistence diagrams. The sample code below gives an example of how the R programming language can be used to compute persistent homology.
install.packages("TDAstats")
library("TDAstats")
data("unif2d")
data("circle2d")
unif.phom <- calculate_homology(unif2d)
circ.phom <- calculate_homology(circle2d)
plot_persist(unif.phom)
plot_barcode(circ.phom)
Visualization.
High-dimensional data is impossible to visualize directly. Many methods have been invented to extract a low-dimensional structure from the data set, such as principal component analysis and multidimensional scaling. However, it is important to note that the problem itself is ill-posed, since many different topological features can be found in the same data set. Thus, the study of visualization of high-dimensional spaces is of central importance to TDA, although it does not necessarily involve the use of persistent homology. However, recent attempts have been made to use persistent homology in data visualization.
Carlsson et al. have proposed a general method called MAPPER. It inherits the idea of Serre that a covering preserves homotopy. A generalized formulation of MAPPER is as follows:
Let formula_16 and formula_53 be topological spaces and let formula_54 be a continuous map. Let formula_55 be a finite open covering of formula_53. The output of MAPPER is the nerve of the pullback cover formula_57, where each preimage is split into its connected components. This is a very general concept, of which the Reeb graph and merge trees are special cases.
This is not quite the original definition. Carlsson et al. choose formula_53 to be formula_18 or formula_60, and cover it with open sets such that at most two intersect. This restriction means that the output is in the form of a complex network. Because the topology of a finite point cloud is trivial, clustering methods (such as single linkage) are used to produce the analogue of connected sets in the preimage formula_61 when MAPPER is applied to actual data.
Mathematically speaking, MAPPER is a variation of the Reeb graph. If the formula_62 is at most one dimensional, then for each formula_63, formula_64 The added flexibility also has disadvantages. One problem is instability, in that some change of the choice of the cover can lead to major change of the output of the algorithm. Work has been done to overcome this problem.
Three successful applications of MAPPER can be found in Carlsson et al. A comment on the applications in this paper by J. Curry is that "a common feature of interest in applications is the presence of flares or tendrils."
A free implementation of MAPPER is available online written by Daniel Müllner and Aravindakshan Babu. MAPPER also forms the basis of Ayasdi's AI platform.
Multidimensional persistence.
Multidimensional persistence is important to TDA. The concept arises in both theory and practice. The first investigation of multidimensional persistence was early in the development of TDA, and is one of the founding papers of TDA. The first application to appear in the literature is a method for shape comparison, similar to the invention of TDA.
The definition of an "n"-dimensional persistence module in formula_65 is 
It might be worth noting that there are controversies on the definition of multidimensional persistence.
One of the advantages of one-dimensional persistence is its representability by a diagram or barcode. However, discrete complete invariants of multidimensional persistence modules do not exist. The main reason for this is that the structure of the collection of indecomposables is extremely complicated by Gabriel's theorem in the theory of quiver representations, although a finitely n-dim persistence module can be uniquely decomposed into a direct sum of indecomposables due to the Krull-Schmidt theorem.
Nonetheless, many results have been established. Carlsson and Zomorodian introduced the rank invariant formula_73, defined as the formula_74, in which formula_75 is a finitely generated n-graded module. In one dimension, it is equivalent to the barcode. In the literature, the rank invariant is often referred as the persistent Betti numbers (PBNs). In many theoretical works, authors have used a more restricted definition, an analogue from sublevel set persistence. Specifically, the persistence Betti numbers of a function formula_76 are given by the function formula_77, taking each formula_78 to formula_79, where formula_80 and formula_81.
Some basic properties include monotonicity and diagonal jump. Persistent Betti numbers will be finite if formula_16 is a compact and locally contractible subspace of formula_65.
Using a foliation method, the k-dim PBNs can be decomposed into a family of 1-dim PBNs by dimensionality deduction. This method has also led to a proof that multi-dim PBNs are stable. The discontinuities of PBNs only occur at points formula_84 where either formula_85 is a discontinuous point of formula_86 or formula_87 is a discontinuous point of formula_88 under the assumption that formula_89 and formula_16 is a compact, triangulable topological space.
Persistent space, a generalization of persistent diagram, is defined as the multiset of all points with multiplicity larger than 0 and the diagonal. It provides a stable and complete representation of PBNs. An ongoing work by Carlsson et al. is trying to give geometric interpretation of persistent homology, which might provide insights on how to combine machine learning theory with topological data analysis.
The first practical algorithm to compute multidimensional persistence was invented very early. After then, many other algorithms have been proposed, based on such concepts as discrete morse theory and finite sample estimating.
Other persistences.
The standard paradigm in TDA is often referred as sublevel persistence. Apart from multidimensional persistence, many works have been done to extend this special case.
Zigzag persistence.
The nonzero maps in persistence module are restricted by the preorder relationship in the category. However, mathematicians have found that the unanimity of direction is not essential to many results. "The philosophical point is that the decomposition theory of graph representations is somewhat independent of the orientation of the graph edges". Zigzag persistence is important to the theoretical side. The examples given in Carlsson's review paper to illustrate the importance of functorality all share some of its features.
Extended persistence and levelset persistence.
Some attempts is to lose the stricter restriction of the function. Please refer to the Categorification and cosheaves and Impact on mathematics sections for more information.
It's natural to extend persistence homology to other basic concepts in algebraic topology, such as cohomology and relative homology/cohomology. An interesting application is the computation of circular coordinates for a data set via the first persistent cohomology group.
Circular persistence.
Normal persistence homology studies real-valued functions. The circle-valued map might be useful, "persistence theory for circle-valued maps promises to play the role for some vector fields as does the standard persistence theory for scalar fields", as commented in D. Burghelea et al. The main difference is that Jordan cells (very similar in format to the Jordan blocks in linear algebra) are nontrivial in circle-valued functions, which would be zero in real-valued case, and combining with barcodes give the invariants of a tame map, under moderate conditions.
Two techniques they use are Morse-Novikov theory and graph representation theory. More recent results can be found in D. Burghelea et al. For example, the tameness requirement can be replaced by the much weaker condition, continuous.
Persistence with torsion.
The proof of the structure theorem relies on the base domain being field, so not many attempts have been made on persistence homology with torsion. Frosini defined a pseudometric on this specific module and proved its stability. One of its novelty is that it doesn't depend on some classification theory to define the metric.
Categorification and cosheaves.
One advantage of category theory is its ability to lift concrete results to a higher level, showing relationships between seemingly unconnected objects. Bubenik et al. offers a short introduction of category theory fitted for TDA.
Category theory is the language of modern algebra, and has been widely used in the study of algebraic geometry and topology. It has been noted that "the key observation of is that the persistence diagram produced by depends only on the algebraic structure carried by this diagram." The use of category theory in TDA has proved to be fruitful.
Following the notations made in Bubenik et al., the indexing category formula_91 is any preordered set (not necessarily formula_92 or formula_18), the target category formula_45 is any category (instead of the commonly used formula_95), and functors formula_96 are called generalized persistence modules in formula_45, over formula_91.
One advantage of using category theory in TDA is a clearer understanding of concepts and the discovery of new relationships between proofs. Take two examples for illustration. The understanding of the correspondence between interleaving and matching is of huge importance, since matching has been the method used in the beginning (modified from Morse theory). A summary of works can be found in Vin de Silva et al. Many theorems can be proved much more easily in a more intuitive setting. Another example is the relationship between the construction of different complexes from point clouds. It has long been noticed that Čech and Vietoris-Rips complexes are related. Specifically, formula_99. The essential relationship between Cech and Rips complexes can be seen much more clearly in categorical language.
The language of category theory also helps cast results in terms recognizable to the broader mathematical community. Bottleneck distance is widely used in TDA because of the results on stability with respect to the bottleneck distance. In fact, the interleaving distance is the terminal object in a poset category of stable metrics on multidimensional persistence modules in a prime field.
Sheaves, a central concept in modern algebraic geometry, are intrinsically related to category theory. Roughly speaking, sheaves are the mathematical tool for understanding how local information determines global information. Justin Curry regards level set persistence as the study of fibers of continuous functions. The objects that he studies are very similar to those by MAPPER, but with sheaf theory as the theoretical foundation. Although no breakthrough in the theory of TDA has yet used sheaf theory, it is promising since there are many beautiful theorems in algebraic geometry relating to sheaf theory. For example, a natural theoretical question is whether different filtration methods result in the same output.
Stability.
Stability is of central importance to data analysis, since real data carry noises. By usage of category theory, Bubenik et al. have distinguished between soft and hard stability theorems, and proved that soft cases are formal. Specifically, general workflow of TDA is 
The soft stability theorem asserts that formula_100 is Lipschitz continuous, and the hard stability theorem asserts that formula_101 is Lipschitz continuous.
Bottleneck distance is widely used in TDA. The isometry theorem asserts that the interleaving distance formula_102 is equal to the bottleneck distance. Bubenik et al. have abstracted the definition to that between functors formula_103 when formula_91 is equipped with a sublinear projection or superlinear family, in which still remains a pseudometric. Considering the magnificent characters of interleaving distance, here we introduce the general definition of interleaving distance(instead of the first introduced one): Let formula_105 (a function from formula_91 to formula_91 which is monotone and satisfies formula_108 for all formula_109). A formula_110-interleaving between F and G consists of natural transformations formula_111 and formula_112, such that formula_113 and formula_114.
The two main results are 
These two results summarize many results on stability of different models of persistence.
For the stability theorem of multidimensional persistence, please refer to the subsection of persistence.
Structure theorem.
The structure theorem is of central importance to TDA; as commented by G. Carlsson, "what makes homology useful as a discriminator between topological spaces is the fact that there is a classification theorem for finitely generated abelian groups." (see the fundamental theorem of finitely generated abelian groups).
The main argument used in the proof of the original structure theorem is the standard structure theorem for finitely generated modules over a principal ideal domain. However, this argument fails if the indexing set is formula_126.
In general, not every persistence module can be decomposed into intervals. Many attempts have been made at relaxing the restrictions of the original structure theorem. The case for pointwise finite-dimensional persistence modules indexed by a locally finite subset of formula_18 is solved based on the work of Webb. The most notable result is done by Crawley-Boevey, which solved the case of formula_18. Crawley-Boevey's theorem states that any pointwise finite-dimensional persistence module is a direct sum of interval modules.
To understand the definition of his theorem, some concepts need introducing. An interval in formula_126 is defined as a subset formula_130 having the property that if formula_131 and if there is an formula_132 such that formula_72, then formula_134 as well. An interval module formula_135 assigns to each element formula_134 the vector space formula_46 and assigns the zero vector space to elements in formula_138. All maps formula_139 are the zero map, unless formula_140 and formula_69, in which case formula_139 is the identity map. Interval modules are indecomposable.
Although the result of Crawley-Boevey is a very powerful theorem, it still doesn't extend to the q-tame case. A persistence module is q-tame if the rank of formula_139 is finite for all formula_144. There are examples of q-tame persistence modules that fail to be pointwise finite. However, it turns out that a similar structure theorem still holds if the features that exist only at one index value are removed. This holds because the infinite dimensional parts at each index value do not persist, due to the finite-rank condition. Formally, the observable category formula_145 is defined as formula_146, in which formula_147 denotes the full subcategory of formula_148 whose objects are the ephemeral modules (formula_149 whenever formula_150).
Note that the extended results listed here do not apply to zigzag persistence, since the analogue of a zigzag persistence module over formula_151 is not immediately obvious.
Statistics.
Real data is always finite, and so its study requires us to take stochasticity into account. Statistical analysis gives us the ability to separate true features of the data from artifacts introduced by random noise. Persistent homology has no inherent mechanism to distinguish between low-probability features and high-probability features.
One way to apply statistics to topological data analysis is to study the statistical properties of topological features of point clouds. The study of random simplicial complexes offers some insight into statistical topology. K. Turner et al. offers a summary of work in this vein.
A second way is to study probability distributions on the persistence space. The persistence space formula_152 is formula_153, where formula_154 is the space of all barcodes containing exactly formula_155 intervals and the equivalences are formula_156 if formula_157. This space is fairly complicated; for example, it is not complete under the bottleneck metric. The first attempt made to study it is by Y. Mileyko et al. The space of persistence diagrams formula_158 in their paper is defined as formula_159where formula_19 is the diagonal line in formula_60. A nice property is that formula_158 is complete and separable in the Wasserstein metric formula_163. Expectation, variance, and conditional probability can be defined in the Fréchet sense. This allows many statistical tools to be ported to TDA. Works on null hypothesis significance test, confidence intervals, and robust estimates are notable steps.
A third way is to consider the cohomology of probabilistic space or statistical systems directly, called information structures and basically consisting in the triple (formula_164), sample space, random variables and probability laws. Random variables are considered as partitions of the n atomic probabilities (seen as a probability (n-1)-simplex, formula_165) on the lattice of partitions (formula_166). The random variables or modules of measurable functions provide the cochain complexes while the coboundary is considered as the general homological algebra first discovered by Hochschild with a left action implementing the action of conditioning. The first cocycle condition corresponds to the chain rule of entropy, allowing to derive uniquely up to the multiplicative constant, Shannon entropy as the first cohomology class. The consideration of a deformed left-action generalises the framework to Tsallis entropies. The information cohomology is an example of ringed topos. Multivariate k-Mutual information appear in coboundaries expressions, and their vanishing, related to cocycle condition, gives equivalent conditions for statistical independence. Minima of mutual-informations, also called synergy, give rise to interesting independence configurations analog to homotopical links. Because of its combinatorial complexity, only the simplicial subcase of the cohomology and of information structure has been investigated on data. Applied to data, those cohomological tools quantifies statistical dependences and independences, including Markov chains and conditional independence, in the multivariate case. Notably, mutual-informations generalize correlation coefficient and covariance to non-linear statistical dependences. These approaches were developed independently and only indirectly related to persistence methods, but may be roughly understood in the simplicial case using Hu Kuo Tin Theorem that establishes one-to-one correspondence between mutual-informations functions and finite measurable function of a set with intersection operator, to construct the Čech complex skeleton. Information cohomology offers some direct interpretation and application in terms of neuroscience (neural assembly theory and qualitative cognition ), statistical physic, and deep neural network for which the structure and learning algorithm are imposed by the complex of random variables and the information chain rule.
Persistence landscapes, introduced by Peter Bubenik, are a different way to represent barcodes, more amenable to statistical analysis. The persistence landscape of a persistent module formula_75 is defined as a function formula_168, formula_169, where formula_170 denotes the extended real line and formula_171. The space of persistence landscapes is very nice: it inherits all good properties of barcode representation (stability, easy representation, etc.), but statistical quantities can be readily defined, and some problems in Y. Mileyko et al.'s work, such as the non-uniqueness of expectations, can be overcome. Effective algorithms for computation with persistence landscapes are available. Another approach is to use revised persistence, which is image, kernel and cokernel persistence.
Applications.
Classification of applications.
More than one way exists to classify the applications of TDA. Perhaps the most natural way is by field. A very incomplete list of successful applications includes data skeletonization, shape study, graph reconstruction, 
image analysis,
 material, progression analysis of disease, sensor network, signal analysis, cosmic web, complex network, fractal geometry, viral evolution, propagation of contagions on networks
, bacteria classification using molecular spectroscopy, hyperspectral imaging in physical-chemistry and remote sensing.
Another way is by distinguishing the techniques by G. Carlsson,
Characteristics of TDA in applications.
There are several notable interesting features of the recent applications of TDA:
One of the main fields of data analysis today is machine learning. Some examples of machine learning in TDA can be found in Adcock et al. A conference is dedicated to the link between TDA and machine learning. In order to apply tools from machine learning, the information obtained from TDA should be represented in vector form. An ongoing and promising attempt is the persistence landscape discussed above. Another attempt uses the concept of persistence images. However, one problem of this method is the loss of stability, since the hard stability theorem depends on the barcode representation.
Impact on mathematics.
Topological data analysis and persistent homology have had impacts on Morse theory. Morse theory has played a very important role in the theory of TDA, including on computation. Some work in persistent homology has extended results about Morse functions to tame functions or, even to continuous functions. A forgotten result of R. Deheuvels long before the invention of persistent homology extends Morse theory to all continuous functions.
One recent result is that the category of Reeb graphs is equivalent to a particular class of cosheaf. This is motivated by theoretical work in TDA, since the Reeb graph is related to Morse theory and MAPPER is derived from it. The proof of this theorem relies on the interleaving distance.
Persistent homology is closely related to spectral sequences. In particular the algorithm bringing a filtered complex to its canonical form permits much faster calculation of spectral sequences than the standard procedure of calculating formula_172 groups page by page. Zigzag persistence may turn out to be of theoretical importance to spectral sequences.
Further reading.
Brief Introduction 
Monograph
Video Lecture
Textbook on Topology
Other Resources of TDA