Fig. 2
From: Nearest neighbor permutation entropy detects phase transitions in complex high-pressure systems

Calculation of the k-nearest neighbor permutation entropy for sequential data. (A) Illustration of a short, unevenly sampled, hypothetical spectrum \(\{x_\lambda \}_{\lambda = \lambda _1, \dots , \lambda _{15}}\). (B) From this hypothetical spectrum, we construct a k-nearest neighbor graph (\(k=3\) in this example) using the data coordinates \((\lambda , x_\lambda )\) to define neighborhood relationships. In this graph, each observed absorbance value \(x_\lambda\) is represented by a node, with undirected edges connecting pairs of observations \(x_{\lambda _i} \leftrightarrow x_{\lambda _j}\) when \((\lambda _j, x_{\lambda _j})\) is among the k-nearest neighbors of \((\lambda _i, x_{\lambda _i})\). For ease of interpretation, the min–max normalization step has been omitted from this illustration. (C) Subsequently, we execute n biased random walks of length w starting from each node, sampling the absorbance values \((x_\lambda )\) to generate time series (\(n=2\) and \(w=5\) in this example). We then apply the Bandt-Pompe symbolization approach to each of these time series. This symbolization entails creating overlapping partitions of length d (\(d=3\) in this example) and arranging partition indices in ascending order to determine the sorting permutation for each partition. (D) Finally, we evaluate the probability of occurrence of each of the d! permutation types (ordinal distribution) and calculate its (E) Shannon entropy, thereby defining the k-nearest neighbor permutation entropy.