{'fraction_non_alphanumeric': 0.029276479363500744, 'fraction_numerical': 0.009551632686888778, 'mean_word_length': 4.547701149425287, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 2, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Topological Signal Processing using the Weighted Ordinal Partition Network

One of the most important problems arising in time series analysis is that of bifurcation, or change point detection. That is, given a collection of time series over a varying parameter, when has the structure of the underlying dynamical system changed? For this task, we turn to the field of topological data analysis (TDA), which encodes information about the shape and structure of data. The idea of utilizing tools from TDA for signal processing tasks, known as topological signal processing (TSP), has gained much attention in recent years, largely through a standard pipeline that computes the persistent homology of the point cloud generated by the Takens' embedding. However, this procedure is limited by computation time since the simplicial complex generated in this case is large, but also has a great deal of redundant data. For this reason, we turn to a more recent method for encoding the structure of the attractor, which constructs an ordinal partition network (OPN) representing information about when the dynamical system has passed between certain regions of state space. The result is a weighted graph whose structure encodes information about the underlying attractor. Our previous work began to find ways to package the information of the OPN in a manner that is amenable to TDA; however, that work only used the network structure and did nothing to encode the additional weighting information. In this paper, we take the next step: building a pipeline to analyze the weighted OPN with TDA and showing that this framework provides more resilience to noise or perturbations in the system and improves the accuracy of the dynamic state detection.

1. Introduction. Time series are widely utilized to analyze dynamical systems with applications spanning everything from atmospheric science to zoology. In many cases, the emphasis of the analysis is to determine when qualitative changes, known as bifurcations, have occurred in the underlying dynamical system. This challenging task is important for predicting future response or to prevent detrimental system behavior. For example, a change in measured biophysical signals can indicate upcoming health problems, and a change in the vibratory signals of machines or structures can be the harbinger of imminent failure. Time series typically originate from real-life measurements of systems, and they provide only finitely sampled information from which the underlying dynamics must be gleaned. This necessitates making conclusions on the continuous structure of dynamical systems using discretely sampled and often noisy time series.
Existing tools for detecting changes in the time series include Lyapunov-based methods in the time domain [14,18,23,41], frequency domain methods developed for Hamiltonian systems [8,22,38], entropybased methods [1,4,5,29,31], Recurrence Plots (RPs) [12] which are related to the ε-recurrence networks in graph theory [11], and the 0-1 test for chaos and its extensions [17,42,43]. However, Lyapunov exponents are difficult to estimate from time series, and their estimation is sensitive to noise and to a faithful reconstruction of the dynamics [33]. Frequency domain methods are predominantly applicable only for Hamiltonian systems, and they share with all the methods mentioned above the need for careful tuning of input parameters in order to extract useful dynamic state information.
In this work, we utilize tools from the field of topological data analysis (TDA) [3,9,26] to encode the shape and structure of the attractor of the underlying dynamical system in order to determine and analyze bifurcations in the system; see Figure 1. The idea of combining TDA with time series analysis is no longer new [34,37]. There are now many examples where persistent homology [32], the flagship tool from TDA, Fig. 1. Pipeline for applying persistent homology to analyze the weighted transitional graph generated from a signal. In this work the state sequence is calculated as the permutation sequence.
can be used to measure the structure of a reconstructed attractor. For example it can be used for chatter detection in machining processes [20,45], pulse counting in noisy systems [21], financial analysis [15,16], periodicity detection [36,42,43] in video [44] and biological [35] applications.
Persistent homology, colloquially referred to as persistence, encodes structure by analyzing the changing shape of a simplicial complex (a higher dimensional generalization of a network) over a filtration (a nested sequence of subcomplexes). It should be noted that the majority of these applications utilize a relatively standard pipeline to construct this filtration. Namely, given point cloud data embedded in R n as input, construct the Vietoris Rips (VR) complex which includes a simplex at the maximum distance between any pair of its vertices. Note that when applied to time series embeddings, this construction is closely related to the recurrence plots commonly used in the time series analysis literature [24]. The persistence diagram, which is a collection of points in R 2 representing the appearance and disappearance of homological structures in the simplicial complex, can be computed and analyzed to determine whether two time series of interest have considerably distinct behavior.
Unfortunately, the persistence of point cloud data does have its drawbacks, in particular since VR complexes can become quite large (namely exponential) relative to the number of points in the original point cloud. For this reason, recent work has begun to investigate alternative representations of an attractor in a way which captures information on its structure while remaining computationally reasonable. To this end, we turn to network based representations of time series [39], focusing on the ordinal partition network [25]. Similar to the delay coordinate embedding, we study point clouds χ with points as X(t) = [x(t), x(t + τ ), · · · , x(t + (n − 1)τ )] ∈ χ but now map them to their permutation induced by the ordering; i.e. the choice of permutation π in the set of n! possible permutations for which x(t + π(0)τ ) ≤ x(t + π(1)τ ) ≤ · · · ≤ x(t + π(n − 1)τ ). We can then track the changing permutation as t is varied in an ordinal partition network: each permutation π becomes a vertex, and we include an edge from π i to π j if increasing t passes from one permutation to the other. A more detailed introduction is provided in Section 2.
Our prior work [29] computed persistent homology of this construction to show that it could be used to differentiate between different kinds of dynamical system behavior; however, that work did not make use of a great deal of information available in the ordinal partition network when performing the analysis. First, there is an inherent directionality on edges as we are always passing from one permutation to another; and second the number of times an edge is utilized can be viewed as weighting information on the network. In this paper, we seek to make use of at least part of this additional information; namely we will incorporate the weighting information on the network and show that this provides better results, particularly in the case of dynamic state detection.

Motivation and Our Contribution.
The importance of considering weight information in graph representation of time series, such as those arising from the Ordinal Partition Network (OPN) [25], is demonstrated with a simple heavily weighted cycle graph with a low weighted cut edge as in the left of Example weighted cut cycle graph. The heavily weighted cycle is not easily seen in the persistence diagram computed from the unweighted shortest path distance (center), but is correctly identified when using the diffusion distance. Fig. 2. The cut edge could be caused by additive noise, a perturbation to the system, or simply a falsely added state transition in the network formation process. We would expect our measurements to find the large, heavily weighted cycle, shown as a single point far from the diagonal in the persistence diagram. However, in this example, the shortest unweighted path distance considers all edges as equal, and thus the persistence diagram (center) has two off diagonal points for the two loops generated by the circle is split in two. We correct this shortcoming by incorporating weight information (diffusion distance in this example), and the resulting diagram shown at right correctly identifies the heavily weighted circle as being more prominent.
The goal of this work is to investigate how to fruitfully incorporate weighted edges when calculating the persistent homology of OPNs. To do this, we investigate the use of the diffusion distance, the shortest weighted path distance, and the weighted shortest path distance between each node pair in the undirected and weighted network. Using these distances we leverage topological data analysis for the characterization of ordinal partition networks.

Organization.
The manuscript is organized as follows. In Sec. 2 we introduce state space reconstruction, OPNs, and persistent homology and how we apply it to complex networks. In Sec. 3 we provide details on the four distances (diffusion distance, shortest unweighted path distance, shortest weighted path distance, and weighted shortest path distance) and demonstrate how they are calculated for defining distances in networks and give empirical results for dynamic state detection in Sec. 4. Additionally, in Sec. 3.2 we qualitatively show the differences in the resulting persistence diagrams for chaotic compared to periodic dynamics. Following the initial example, in Sec. 4 we demonstrate how the resulting persistence diagrams capture state changes in a signal using a nonlinear support vector machine kernel. Specifically, we show how the kernel can accurately separate the dynamic states using 23 example dynamical systems exhibiting both periodic and chaotic dynamics. Additionally, in Sec. 4, we provide an empirical analysis of the additive noise robustness and stability of the resulting persistence diagrams in these example systems.
2. Background. Before introducing our advancements to the method of analyzing complex weighted networks derived from dynamical system data, we first introduce the prerequisite background information.
2.1. State Space Reconstruction and the Ordinal Partition Network. Takens' embedding theorem [40] allows us to use the technique of State Space Reconstruction (SSR) for the analysis of deterministic, nonlinear time series data from flows. In summary, the theorem allows us to reconstruct a diffeomorphism of the original state space using only a single time series measurement from the dynamical system. Specifically, the state of a dynamical system at time t ∈ R is defined as a vector y ∈ M ⊆ R n , where M is the manifold that the attractor lies on. The tracking of y over time is the flow ϕ t (y). However, our measurement of the underlying system is typically an observation function of the flow β(ϕ t (x)). Using an embedding time delay τ > 0 and a sufficiently high embedding dimension n ≥ 2m + 1, where m is the dimension of the manifold M , then the SSR will be (with high probability) diffeomorphic to the original attractor and can be used to study the dynamical system without loss of information. For brevity we will call our observation function x and then define the SSR vector X(t) as In this paper, we forgo Takens embedding in favor of the ordinal partition network or graph representation of the state space.
In this work all graphs are simple (no self-loops or multiedges) and undirected. Additional stored information comes as a weighted graph, G = (V, E, ω) where ω : E → R ≥0 gives a non-negative weight for each edge in the graph. Given an ordering of the vertices V = {v 1 , · · · , v n }, a graph can be stored in an adjacency matrix A where the weighting information is obtained by setting A ij = w (vi,vj ) if v i v j ∈ E and 0 otherwise. We also make comparisons to the unweighted graph where A ij = A ji = 1 if v i v j ∈ E and 0 otherwise.
The ordinal partition network [25,39] provides a relatively simple method to assign symbolic representations for the SSR vectors to form a transition network. This construction arose as a generalization of the concept of permutation entropy [1]. Assume our data is provided as discretely sampled time series data x = [x 1 , x 2 , . . . , x L ] with L as the number of samples from a signal sampled at uniform time stamps t = [t 1 , t 2 , . . . , t L ] with sampling frequency f s . An SSR vector of a discrete sampled signal is defined as The basic idea of the OPN construction is to replace each SSR vector X i with a permutation π where the vector X i is assigned to a permutation based on the sorted order of its coordinates. Specifically, the permutation π is the one in the set of n! possible permutations for which x(t + π(0)τ ) ≤ x(t + π(1)τ ) ≤ · · · ≤ x(t + π(n − 1)τ ), where π(i) is the permutation value at index i; see Fig. 3 for an example. Then the OPN is built with a vertex set of encountered permutations in the sequence S with an edge included if the ordered point cloud passes from one permutation to the other. An example for the case of a cyclic sequence of permutations can be seen in Fig. 4.
Note that the set of all permutations of dimension n gives a cover of R n with permutation π i representing a subspace of R n given by the intersection of d 2 inequalities, and an edge is included based on passing from one of these subspaces to the other in one time step. This partitioned symbolic representation of the state  space allows the resulting ordinal partition network to capture meaningful topological information about the dynamical system's flow.

2.2.
Distances from a weighted graph. We next look at four different ways to define a distance between pairs of vertices given an input (weighted) graph. In each case, we generate a distance matrix D where entry D(a, b) gives the associated distance between vertices a and b.
The first method, the shortest unweighted path distance, ignores the weighting information entirely, using only the number of edges to get from vertex a to vertex b. Specifically, D(a, b) is the number of steps it takes to transition from a to b through the shortest path. See the example of Fig. 5. The shortest path distance is calculated using the NetworkX implementation of Dijkstra's algorithm [10] with the unweighted adjacency matrix.
The second method, the shortest weighted path, similarly only uses the number of edges between vertex a and b as the path distance. However, the weighted information is incorporated through the choice of the path. This is done by choosing the path with the lowest summed weight of all paths between a and b. To make it such that the path with the largest weights is used, the inverse of the edge weights is used when calculating the shortest path. Again, this distance is calculated using the NetworkX implementation of Dijkstra's algorithm [10] but with the inverse of the weighted adjacency matrix.
The third method, the weighted shortest path is very similar to the second method. The only variation is that the sum of the edge weights along the path is used as the distance. The path used is found using the inverse of the edge weights similar to the second method.
The fourth method for computing distances is the diffusion distance; for more details we direct the reader to [7]. This is computed using the transition probability distribution matrix P of the graph, where P(a, b) is the probability of transitioning to vertex b in the next step given you are currently at a. Given the weighted, undirected adjacency matrix A, the transitional probability matrix is calculated as .
This formulation of the probability matrix only has transition probabilities greater then zero for one step neighbors of i. However, the transition probabilities for non-adjacent neighbors of node i can be calculated using the random walk and the diffusion process. A random walk is the sequences of nodes visited (a 1 , a 2 , . . .) in t steps, where the selection of the next node is based on the transition probabilities. It is a classic exercise to show that, given P, the probability distribution for transitioning to vertex b from vertex a in t random walk steps is P t (a, b).
The diffusion distance is a measure of the degree of connectivity of two nodes in a connected graph after t steps using the lazy transition probabilityP t based on the possible random walks of length t and is calculated as where d is the degree vector of the graph with d(i) as the degree of node i andP is the lazy transition probability matrix, where the initial zero diagonal of P is set such thatP = 1/2(I + P). In other words, there is an equal probability of staying and leaving at node i in a single step. Applying the diffusion distance to all node pairs results in the distance matrix D t . Consider the diffusion distance with two nodes having a connected path with high transition probability edges or many random walk paths connecting the two, then the diffusion distance between them will be low. However, if two vertices are only connected through a single, low probability edge transition from a possible perturbation in the graph, then their diffusion distance will be large. A common example implementing the diffusion distance is based on assigning P as a function of the proximity of nodes. Using this formulation of the transition probability, it is possible to cluster the data based on the distances as demonstrated in [7]. However, due to the natural transitions that occur in transitional complex networks, the diffusion distance is a natural solution for incorporating edge weight data into the distance measurement.

Persistent
Homology. In order to analyze the shape of the constructed graphs, we turn to a generalization of the graph known as a simplicial complex, and a measurement tool known as persistent homology. We direct the interested reader looking for a more in depth discussion to [9,19,27,32].
Simplicial complexes. A simplicial complex is one way to generalize the concept of a graph to higher dimensions. Like a graph, we start with a (finite) vertex set V ; a simplex σ ⊆ V is any subset of vertices. The dimension of a simplex σ is dim(σ) = |σ| − 1. Note that graph edges are thus simplices of dimension 1. The simplex σ is a face of τ , denoted σ τ , if σ ⊆ τ . A simplicial complex K is a collection of simplices which is closed under the face relation; i.e. if σ ∈ K and τ σ, then τ ∈ K. The dimension of a simplicial complex is the largest dimension of its simplices, dim(K) = max σ∈K dim(σ). The d-skeleton of a simplicial complex is all simplices of K with dimension at most d, One way to build a simplicial complex from a graph input is to start with the graph as the 1-skeleton, and then include all higher dimensional simplices when possible: This is called the clique complex. The clique complex of the complete graph on n vertices is called the complete simplicial complex on n vertices. Homology. Traditional homology [19,27] counts the number of structures of a particular dimension in a given topological space, which in our context will be a simplicial complex. In this context, the structures measured can be connected components (0-dimensional structure), loops (1-dimensional structure), voids (2-dimensional structure), and higher dimensional analogues as needed. In this work, we focus on 0-and 1-dimensional homology.
Given a simplicial complex K, denote the d-dimensional simplices by σ 1 , · · · , σ . A d-dimensional chain is a formal sum of the d-dimensional simplices α = i=1 a i σ i . We assume the coefficients a i ∈ Z 2 = {0, 1} and addition is performed mod 2; i.e. 1 The collection of all d-dimensional chains forms a vector space denoted C d (K) with addition given by addition of coefficients. The boundary of a given d-simplex is That is, the boundary is the formal sum of faces which are exactly one lower dimension. If σ is a vertex so that dim(σ) = 0, we set ∂ d (σ) = 0. Then the boundary operator ∂ d : In particular, any 0-chain is a 0-cycle since ∂ 0 (α) = 0 for any α. A 1-chain is a 1-cycle iff the 1-simplices (i.e., edges) with a coefficient of 1 form a closed loop. It is a fundamental exercise in homology to check that We call α a representative of [α], noting that any element of [α] can be used as its representative so this choice is by no means unique. In the particular case of 0-dimensional homology, there is a unique class in H 0 (K) for each connected component of K. For 1-dimensional homology, there is one homology class in H 1 (K) for each "hole" in the complex.
Persistent homology. We next look to a more modern viewpoint of homology which is particularly useful for data analysis, persistent homology. In this case, we study a changing simplicial complex and encode this information via the changing homology. In explaining persistence, we will follow the example of Fig. 6 for the setting used in this work where the input data is a weighted network.
A filtration of a simplicial complex K is a collection of nested simplicial complexes See the bottom row of Fig. 6 for an example of a filtration. In this work, we will be focused on the following filtration which arises from finite metric space; in our case, this is given as a pairwise distance matrix D ∈ R n×n ≥0 , obtained from a weighted graph as described in Sec. 2.2. Set the vertex set to be V = [1, · · · , n] and for a fixed a ∈ R, let This can be thought of as the clique complex (Eq. 2.3) on the graph with edges given by all pairs of vertices with distance at most a. Further, since K a ⊆ K b for a ≤ b, this construction gives rise to a filtration Fix a dimension d. For any inclusion of one simplicial complex to another L → K, there is an induced map on the d-chains ι : C d (L) → C d (K) by simply viewing any chain in the small complex as one in the larger. Less obviously, this extends to a map on homology ι * : H d (L) → H d (K) by sending [α] ∈ H d (L) to the class in H d (K) with the same representative. That this is well defined is a non-trivial exercise in the definitions [19]. Putting this together, given a filtration there is a sequence of linear transformations on the homology In the case of 0-dimensional persistence, this feature is encoding the appearance of a new connected component at K ai that was not there previously, and which merges with an older component entering K aj . For 1-dimensional homology, this is the appearance of a loop structure that likewise fills in entering K aj .
The persistence diagram encodes this information as follows. For each class that is born at a i and dies at a j , the persistence diagram has a point in R 2 at (a i , a j ). Because several features can appear and disappear at the same times, we allow for repeated points at the same location. For this reason, a persistence diagram is often denoted as a multiset of its off-diagonal points, D = {(b 1 , d 1 ), · · · , (b k , d k )}. See the top right of Fig. 6 for an example. Note that the farther a point is from the diagonal, the longer that class persisted in the filtration, which signifies large scale structure. The lifetime or persistence of a point x = (b, d) in the diagram in a persistence diagram D is given by pers(x) = |b − d|. It is often of interest to investigate only a specific subset of d dimensional features from a persistence diagram, which we represent as D d .

Distances between Diagrams and Multi-dimensional Scaling (MDS).
In order to understand how similar two persistence diagrams are to each other, we turn to the bottleneck distance between diagrams. The idea is to provide a number d(D, D ) which is small if the two diagrams D and D are similar. Since diagrams could have different numbers of points, we must be a bit careful as to how to define this. Further, we want this distance to encode the idea that points far from the diagonal represent long lived features, while those close the diagonal are short lived features and thus the latter should be similar to a diagram which does not have these at all.
One of the most common options, the bottleneck distance, is given as follows. Let the two diagrams in question be defined in terms of their off diagonal points, so A partial matching is defined as a matching on a subset of the points of the diagram, i.e. for a pair S ⊆ D and S ⊆ D , we have a bijection ϕ : S → S . Then the cost of the partial matching is given as the maximum of the L ∞ distance between the matched points (those in S and S ), and of the distance between the unmatched points and the diagonal. Specifically, The bottleneck distance is then defined to be that is, the minimum cost over all possible partial matchings ϕ.
In this paper, we will be generating a persistence diagram to represent each input time series. In order to visualize the resulting separation in the metric space of persistence diagrams, we will perform a particular case of lower dimensional embedding, namely multidimensional scaling (MDS) to show separations. Given a finite metric space, in our case a collection of persistence diagrams {D i }, with a choice of distance, in our case bottleneck distance d B , MDS looks for a lower dimensional embedding of the data that preserves the distances as much as possible. That is, we wish to find X := {x i } ⊆ R d minimizing It should be noted that a major drawback of MDS that it cannot be used for machine learning processes such as supervised learning. In particular, that would require being able to learn the embedding from the training data set, and then determining the location for an unseen test data point, however this is not possible with the MDS framework. For this reason, we use MDS in this paper as a visual inspection tool to determine whether the persistence diagrams for the labeled classes are separated in persistence diagram space, rather than for traditional machine learning proceedures.

Method.
In our previous work [29], we investigated how the one-dimensional persistent homology of the shortest path distance for an unweighted complex network can be used to analyze the dynamics of the system. A natural extension of this work is on how we can incorporate more information about the graphsuch as the edge weight-to better measure the shape of the graph through persistent homology. Figure 1 shows the pipeline investigated here and an example can be seen in Fig. 6.
We begin with a signal and construct the weighted ordinal partition network as described in Sec. 2.1. As in the case of Takens' embedding, we must take care when choosing the parameters τ and n. Theoretically, nearly any time lag τ can be used for a completely noise-free and an infinitely precise signal, but in practice a τ is typically chosen using the method of mutual information [13] or autocorrelation [2] for state space reconstruction. However, in this work we choose τ using the method of multi-scale permutation entropy as suggested in [28] since we are forming permutations to construct the OPN. While an appropriate embedding dimension n for the state space reconstruction may be sufficient, it may not be a high enough dimension to capture the complexity of the time series. To alleviate this issue, Bandt and Pompe [1] suggested using higher dimensions (e.g. n ∈ [4,10]) to allow for n! different states to better capture the complexity of the time series. In this work we will use a dimension n = 6 unless otherwise stated.
We next choose a distance for the given graph input as described in Sec. 2.2. In order to compare with prior work, we examine the shortest unweighted path distance, while our main focus is on the weightincorporating shortest path distances and the diffusion distance. Given the distance matrix, we then compute the persistence diagram as described in Sec. 2.3.
It is important to mention the sensitivity of the diffusion distance D t to the selection of the number of walk steps t. We used an empirical study of 23 continuous dynamical systems to determine the optimal t such that a periodic signal creates a significant point in the persistence diagram representing the cycle. More details on this analysis are available in the appendix in Section A.2. We found an optimal value of d < t < 3d, where d is the diameter of the graph. Specifically, the diameter is measured as the maximum shortest unweighted path between any two vertices. Intuitively, this value of t seems suitable since it allows for a transition probability between all nodes in the graph. I.e., if t ≥ d then there is a probability of transitioning between every node pair in a random walk of length t.
We next demonstrate our pipeline on two simple examples to gain intuition before giving the results in Sec. 4.

First Example: Comparing Distance Measurements.
To compare the original shortest unweighted path to the weight incorporating shortest path and diffusion distances, let us look at a simple example that highlights the issue previously mentioned with the unweighted shortest path not accounting for weight information. In Fig. 7 there are two graphs: on the top is a cycle graph with edge weights of 10 and on the bottom is the same cycle graph but with an additional single perturbation edge added between nodes 0 and 8 with a weight of 1. This edge could be caused by additive noise, a perturbation to the underlying dynamical system, or simply a falsely added state transition in the OPN formation procedure. If we implement the shortest unweighted path distance for calculating the persistent homology of the cycle graph we get a single significant point in the resulting persistence diagram as shown in the top left persistence diagram of Fig. 7. However, adding the single, low-weighted edge splits the graph with the persistence diagram using the shortest unweighted path distance having two significant points in the persistence diagram (see bottom left diagram of Fig. 7). This is due to the edge weight information being discarded when using the shortest path distance.
In comparison to the shortest unweighted path distance, the second, third, and fourth columns of Fig. 7 show the persistence diagrams for both graphs using the shortest weighted path, weighted shortest path, and diffusion distances, respectively. For all three of these distance methods there is only a single onedimensional point in the persistence diagrams for both graphs. Additionally, both the shortest weighted path and weighted shortest path have identical persistence diagrams for both graphs. This is due to the shortest weighted path between any two vertices never using the edge between vertices 0 and 8. For the diffusion distance we also only have a single point in the persistence diagram for one-dimensional features. This is caused by the weighted information being used in the diffusion distance calculation where the change in distance from the nodes 0 and 8 is not significantly changed from the addition of the perturbation edge connecting them since it has a low weight relative to the cycle and the transition probability distributions between vertices 0 and 8 are dissimilar. For calculating the diffusion distance in this example we used t = 2d walk steps.

Second
Example: Periodic and Chaotic Dynamics. The second example qualitatively demonstrates that persistence of the diffusion distance for OPNs can detect the dynamic state of a signal as either periodic or chaotic. The example signal used here is from the Lorenz system defined as The system was simulated with a sampling rate of 100 Hz and system parameters σ = 10.0, β = 8.0/3.0, and ρ = 180.1 for a periodic response or ρ = 181.0 for a chaotic response. This system was solved for 100 seconds with only the last 20 seconds used to avoid transients. Figure 8 shows the resulting Lorenz system simulation signals x(t) for periodic (top row of figure) and chaotic (bottom row of figure) dynamics with the corresponding ordinal partition state sequence S using dimension n = 6 and τ = 17 selected using multi-scale permutation entropy [28], OPN, and persistence diagram. This example result demonstrates that the persistence diagram for a periodic signals tend to have one or few significant points in the persistence diagram of one dimensional features D 1 representing the cyclic nature of the signal. On the other hand, the D 1 for chaotic signal has many significant points representing the entanglement of the OPN.
The other distance methods also demonstrate similar behavior when comparing the resulting persistence diagrams from periodic and chaotic dynamics.

Results.
In this section we discuss the empirical results on the dynamic state detection capabilities and stability of the persistent homology of ordinal partition networks using the distance methods for Fig. 8. A comparison of the resulting persistence diagrams for an OPN formed from a periodic and chaotic signal from the Lorenz system. In each case, a function x(t) is shown, and the ordinal partition states for a sliding window are shown below as S(t). The resulting networks are shown in the middle column and the resulting persistence diagrams are drawn at right. Note that the the ordinal parition states labeled S do not have a natural ordering so an arbitrary one is chosen and shown.
incorporating weight information.

Dynamic State Detection.
To determine the viability of the persistence diagram for categorizing the dynamic state of a signal using the persistent homology of the shortest weighted path, weighted shortest path, and diffusion distances compared to the shortest unweighted path distance we use the lower dimensional projection of the persistence diagrams. Specifically, we implemented the Multi-Dimensional Scaling (MDS) projection to two dimensions using the bottleneck distance matrix for our 23 systems (see Table 2 for a list). These systems were simulated from the dynamical systems module in the Python package Teaspoon with details on the simulations provided in Appendix B. We then use a Support Vector Machine (SVM) with a Radial Basis Function (RBF) kernel to delineate periodic and chaotic dynamics based on the two dimensional MDS projection. The SVM fit was done using default parameters for the SKLearn SVM package in Python. The resulting separations shown in Fig. 9 are for periodic and chaotic dynamics using the persistence diagrams with the following distances: shortest unweighted path (Fig. 9 a), shortest weighted path ( Fig. 9 b), weighted shortest path (Fig. 9 c), and diffusion distance (Fig. 9 d). We again reiterate (see the discussion of Sec. 2.4) that these figures cannot be viewed as proper supervised learning testing as MDS does not allow for determining an embedding from an unseen test point (in this case, a persistence diagram). Rather, these figures are useful for a visual proof of concept ensuring that the persistence diagrams representing different states are far apart in persistence diagram space. Future work will be required in order to convert this setting into a point statistic to match to state type; however this work can be used in the case where a distribution of time series is in use and separation by clustering in persistence diagram space has potential for determining differences in the states.
The accuracy for each SVM kernel are provided as the standard distance percent accuracy in Table 1. Based on this initial analysis it is clear that the diffusion distance significantly outperforms the other distance Shortest unweighted path distance.
Shortest weighted path distance.
Weighted shortest path distance Lazy diffusion distance Fig. 9. Comparison between the (a) shortest unweighted path, (b) shortest weighted path, (c) weighted shortest path, and (d) lazy diffusion distances using a two dimensional MDS projection (random seed 42) of the bottleneck distances between persistence diagrams of the chaotic and periodic dynamics with an SVM radial bias function kernel separation. Note that the symbols are translucent so that overlapping points can be seen.
methods with an accuracy of 95.0% ± 0.9%. We theorize that one reason for the increased performance when using the diffusion distance is in how it tends to normalize the scale of the persistence diagram. Specifically, when comparing the 23 dynamical systems, the maximum lifetimes for t = 2d walk steps ranges from 0.08 to 0.21 with a mean of 0.147 and standard deviation of 0.042 or 28.6% of the average. In comparison, the maximum lifetimes for the shortest unweighted path distance range from 2 to 24 with an average of 9.38 and standard deviation of 6.36 or 67.8% of the average. This demonstrates that the persistence diagrams from the diffusion distance calculation tends to be more consistent in magnitude. We can further show this relationship using the cycle graph G cycle (n), where n as the number of nodes is increased from 2 to 500 Table 1 Accuracies of vaious distance methods (standard and normalized).

Distance Method
Percent Accuracy (%) Standard Distance Normalized Distance Shortest unweighted path 80.7 ± 1.5 91.9 ± 0.9 Shortest weighted path 88.9 ± 0.0 95.9 ± 0.8 Weighted shortest path 88.9 ± 0.0 92.6 ± 0.0 Lazy diffusion distance 95.0 ± 0.9 91.0 ± 0.7 with the maximum persistence calculated for each graph (see Appendix Section A.1). In comparison to the shortest path distances, this result shows that the persistence of the cycle graph does not continue to grow with a larger cycle graph when using the diffusion distance and trends to a plateau. The accuracy improvements from the natural normalization characteristics of the diffusion distance can be extended to the other distances by normalizing their respective distance matrix as where D * is the normalized distance matrix where max i,j D * (i, j) = 1. As theorized, repeating the MDS and SVM analysis done in Fig. 9 with the normalized distances (see Fig. 10) improves the accuracy of the other distances. Visually, the SVM kernel separates the dynamic states more accurately when using the normalized distances. When this analysis was repeated for 100 random seeds we found that there was an improvement in accuracy for each of the shortest path distances, but a slight decrease in accuracy when using the diffusion distance (see Table 1. Specifically, we found approximately a 3% decrease in accuracy when using the diffusion distance, but a significant improvement in all the shortest path distances. Overall the best performance in terms of accuracy is found when using the normalized shortest weighted path with a 95.9% ± 0.8% accuracy. This shows the importance of normalizing the distance matrix when using SVM kernels for dynamic state detection using an MDS projection.

Stability Analysis.
One drawback to using MDS in our setting is that it cannot be used for true supervised learning as data points not in the original training set cannot be assigned a projection after the fact. We can at least analyze how sensitive the bottleneck distance between persistence diagrams is to differences in the input time series, showing that the results are resilient to noise. While we would like to be able to provide a stability proof in the spirit of [6], such an investigation is outside the scope of this work (see further discussion in Sec. 5).
Instead we use an empirical study of the stability of the bottleneck distance using the same 23 systems with the periodic signals (both dissipative autonomous and driven). Specifically, we tested the stability by adding bounded Gaussian noise to the signal. The noise had Signal to Noise Ratios (SNR) from ∞ (no noise) to 15 dB (extremely noisy). The additive noise followed a zero-mean Gaussian distribution that was truncated at three standard deviations from the mean and set ε = 6σ. To make a fair comparison between each of the distance methods in terms of stability and sensitivity to noise we normalize the bottleneck distance as , Normalized shortest unweighted path distance.
Normalized shortest weighted path distance.
Normalized weighted shortest path distance Normalized lazy diffusion distance where d B is the bottleneck distance function and D 1 and D ε 1 are the noise free and noise contaminated one-dimensional persistence diagrams, respectively. Figure 11 provides a demonstrative example of the effects of noise and the stability of the persistence diagram for the Lorenz system. The persistence diagrams as ε is increased are drawn overlaid in Fig.11 (b) In Fig.11, we see the bottleneck distance from the the noise free diagram to the noise contaminated diagram as the noise amplitude ε is increased. In the case of Lorenz, all four distance methods are stable with an approximately linear change in the bottleneck distance with respect to the noise level ε for small levels of noise (less than 25 dB). Additionally, d * B tends to plateau at noise levels greater than approximately 18 dB. This is due to the minimum pairing between diagrams matching to the diagonal. It is also clear the shortest weighted path distance is significantly less sensitive to additive noise with only slight changes in its normalized bottleneck distance as ε is increased.
Some of these characteristics seen in the Lorenz systems seem to be consistent across all of the other 22 systems; see Appendix Section C for similar figures for the remaining systems. The shortest weighted path distance tends to be the least sensitive to additive noise. Additionally, the bottleneck distance tends to plateau at approximately 20 dB for most systems. Most importantly, all of the distance methods tend to have an approximately linear relationship between d * B and ε for low levels of noise (SNR ≤ 25 dB). These results empirically demonstrate that the persistence diagram is stable in this setting for limited levels of additive noise.
Some characteristics that tend to be highly dependent on the system is the sensitivity of the shortest unweighted path, weighted shortest path, and diffusion distances to additive noise. For some systems (e.g. the Rabinocih Frabrikant attractor), the weighted shortest path distance is the least sensitive to high levels of additive noise, while in other systems (e.g. the Thomas cyclically symmetric attractor) the weighted shortest path distance is the most sensitive to additive noise. In most systems the diffusion distance and shortest unweighted path are comparably sensitive to additive noise.

Conclusions.
In this work we investigated the viability of encoding the behavior of time series through the persistent homology of the weighted ordinal partition network. Our results show that there is a significant improvement when using the weighted distance methods such as the shortest weighted path, weighted shortest path, and diffusion distance. These weighted distance methods incorporate information about the edge weights that gets lost when using the unweighted shortest path distance. For our analysis we used the MDS projection and an SVM with an RBF kernel to separate periodic from chaotic dynamics with 23 continuous systems and the bottleneck distance matrix between each systems resulting persistence diagram. By using a large set of dynamic systems we are able to empirically evaluate the performance for dynamic state detection. We found an increase in dynamic state separation when using the diffusion distance over the shortest path distance. We also investigated the performance when using the normalized distances and found that this caused a significant improvement in the dynamic state detection accuracy for all of the shortest path distances.
Due to limitations of the MDS projection, we further studied the sensitivity to noise by investigating how the bottleneck distance to the noise-free diagram changes as we increase the noise added to the original time series. While this work provides an interesting empirical study suggesting stability for the distance methods, an interesting question to consider is that of proving a stability theorem. The general stability theorem for persistent homology [6] requires where f and g are functions on a topological space and d B is the bottleneck distance of the sublevel-set persistence diagram. In our work we would attempt to apply this to our distance functions by showing where D is the noise free diffusion distance matrix. However, due to the complexities of considering the effects of the choice of t and the structure of the graph being based on the ordinal partition segmentation of the state space, the difficulty of proving the stability is outside of the scope of this work but would certainly be of interest.
Another direction for future work relates to modifications of the choice of network and how much of the network information is utilized. In future work, we will investigate the directed version of the OPN and apply newly developed methods for incorporating directed edges into persistent homology. We also hope to extend this work to other choices of networks for representing dynamical systems.
Appendix A. Additional Diffusion Distance Analysis.
A.1. Persistence of Cycle Graph. The cycle graph on n vertices is the graph G = (V, E) with V = {v 1 , · · · , v n }, and E = {v i v i+1 | 1 ≤ i < n} ∪ {v n v 1 }; i.e. it forms a closed path (cycle) where no repetitions occur except for the starting and ending vertices. If we increase the number of nodes from 2 to 500 and calculate the maximum persistence or maximum lifetime, we find that it quickly reaches a maximum of L 1 = 0.216 at n = 32, and then steadily declines seeming to approach a plateau as shown in Fig. 12. This is in comparison to the unweighted shortest path distance of the cycle graph which has a maximum Fig. 12. Numerical analysis of the maximum persistence of the cycle graph G cycle (n) with size n when using diffusion distance with t = 2d. persistence of n/3 − 1 as shown in [29].
A.2. Analysis on Random Walk Steps. In this section we vary the number of random walk steps t with respect to the graph diameter d to determine how many steps is suitable for calculating the persistent homology based on the diffusion distance. We vary t/d from 1 to 5 as shown in Fig. 13. To decide on the optimal t we calculate the maximum lifetime and number of persistence pairs in each resulting persistence diagram for each of the 23 dynamical systems investigated in this work. Additionally, the average for both the maximum lifetime and number of lifetimes is plotted as shown in Fig. 13.
Based on the each systems maximum lifetimes, a suitable value for t should be greater than d based on having a t large enough that each system reaches a maximum of the max(L 1 ). We can also note that the number of persistence pairs or lifetimes in the persistence diagram does not stabalize for the majority of systems until approximately t = 2d/3. This again supports a minimum suggest t > d. The only downfall of larger values of t is that the maximum lifetime tends to diminish as shown in the max(L 1 ) figure. Therefor, we conclude that a suitable t should be within the range d < t < 3d. In this work we chose t = 2d.
Appendix B. Data. In this work we heavily rely on a 23 dynamical systems commonly used in dynamical systems analysis. All of these systems are continuous flow opposed to maps. The 23 systems are listed in Table 2. The equations of motion for each systems can be found in the python topological signal processing package Teaspoon under the module MakeData https://lizliz.github.io/teaspoon/. Specifically, these systems are described in the dynamical systems function of the make data module [30].
Each system was solved to have a time delay τ = 50, which was estimated from the multiscale permutation entropy method [28]. The signals were simulated for 750τ /f s seconds with only the last fifth of the signal used to avoid transients. It should be noted that we did not need to normalize the amplitude of the Fig. 13. Comparison of max L 1 and #{L 1 } for each system and mean when varying t in P t with respect to the diameter (t ∈ [d, 5d]). signal since the ordinal partition network is not dependent on the signal amplitude.