Design of a Network Permutation Entropy and Its Applications for Chaotic Time Series and EEG Signals

Measuring the complexity of time series provides an important indicator for characteristic analysis of nonlinear systems. The permutation entropy (PE) is widely used, but it still needs to be modified. In this paper, the PE algorithm is improved by introducing the concept of the network, and the network PE (NPE) is proposed. The connections are established based on both the patterns and weights of the reconstructed vectors. The complexity of different chaotic systems is analyzed. As with the PE algorithm, the NPE algorithm-based analysis results are also reliable for chaotic systems. Finally, the NPE is applied to estimate the complexity of EEG signals of normal healthy persons and epileptic patients. It is shown that the normal healthy persons have the largest NPE values, while the EEG signals of epileptic patients are lower during both seizure-free intervals and seizure activity. Hence, NPE could be used as an alternative to PE for the nonlinear characteristics of chaotic systems and EEG signal-based physiological and biomedical analysis.


Introduction
Measuring the nature of the complexity of obtained time series can provide a better understanding of nonlinear systems. This has aroused much interest from researches. Currently, the complexity of different kinds of nonlinear time series such as EEG signals [1,2], ECG signals [3,4], EMG signals [5], stock data [6], traffic time series [7], and tea category identification [8] has been investigated. Meanwhile, the complexity analysis of chaotic systems has been reported in many literature works, and the dynamics of chaotic systems has garnered further study [9][10][11][12]. It also provides a reference for the parameter choice of chaotic systems in real applications [13].
To measure the complexity of nonlinear time series, various types of algorithms are designed. Firstly, according to whether the Shannon entropy [14] is used or not, the complexity measuring algorithms can be categorized into the complexity methods and entropy methods. The Kolmogorov complexity algorithm [15,16], C 0 algorithm [17], ApEn [18], SampEn [19], FuzzyEn [20], the Lempel-Ziv complexity measuring algorithm [21], and the statistical complexity measure method [22] belong to the complexity methods, while permutation entropy (PE) [23], spectral entropy (SE) [24], and wavelet entropy (WE) [25] belong to the entropy algorithms. Meanwhile, according to which domain is used to measure the complexity, the complexity measuring algorithms can be defined as time domain method and frequency domain methods. The SE algorithm [24], C 0 algorithm [17], and WE algorithm [25] are frequency domain methods since the Fourier transformation or the wavelet transformation is used. However, most of the other algorithms measure complexity directly in the time domain. Recently, Coast et al. [26] proposed the multi-scale coarse graining process and designed the multiscale entropy Step 1: For a given time series {x(n), n = 1, 2, 3, · · · , N} and reconstruction dimension d, the reconstructed series is denoted by: where i = 1, 2, · · · , N − d + 1.
Step 3: Define the order pattern of X(i) as π j . If we give each pattern π j a value, a pattern series {s(i), i = 1, 2, · · · , N − d + 1} can be obtained. The Bandt-Pompe probability distribution p(π j ) is denoted by: Let us take d = 3 as an example; there are six possible patterns: The six different patterns can also be found in Figure 1. In our implementation, we used the MATLAB function [Reorder, index] = sort(·) for each vector. The pseudocode for obtaining the pattern is shown in Algorithm 1. For each pattern, there is a unique return value. For instance, in the pattern 3,2]. Its value is calculated by S = r 0 × 10 2 + r 1 × 10 1 + r 2 × 10 0 = 132. As a result, different patterns have different values. Algorithm 1 Set a unique value for a given pattern (vector X); the function name is GetPattern(·).

The Deficiency of the Bandt-Pompe Probability Distribution
Firstly, the existing problems of the PE algorithm are listed as follows: • As shown in Figure 1, there are many different cases for each pattern, but the Bandt-Pompe patterns are recognized as the same case. Thus, the Bandt-Pompe patterns cannot detect the nonlinearity in time series effectively.

•
The pattern series {s(n), n = 1, 2, · · · , N} of a periodic time series is also periodic [53]. The corresponding Bandt-Pompe probability distribution p(π j ) could be a uniform distribution or other cases. Thus, sometimes, PE measuring results cannot distinguish the periodic state and the chaotic state [53].
As for the sensibility of the Bandt-Pompe patterns, some explanation are presented here. The vectors such as [1,2,3], [1.1, 1.2, 3], and [1, 2.8, 3] will be symbolized as the same pattern Chen et al. [35] proposed the improved permutation entropy (IPE), where the probability distribution is obtained as follows.
Step 1: The quantization process is given by: where x max and x min are the maximum and minimum values of the time series x. Thus, an integer number ranging from 0-L − 1 can be obtained.
Step 3: For each vector, there are L d possibilities. Thus, the probability distribution is defined as: where j = 1, 2, · · · , L d . Let us give some examples to explain this method. Suppose that x min = 0, x max = 3, and L = 4; the vectors are given as ], and [1, 2.8, 3]. In this case, the patterns are symbolized as 113, 103, and 133. Obviously, they are not the same patterns. In fact, L d d! when L takes values larger than d. This means more permutation patterns will be obtained. As a result, IPE patterns are more sensitive to the changes in the vectors.
Meanwhile, Fadlallah et al. [33] proposed the weighted PE (WPE) for better measuring results. The WPE is calculated as follows. For the vector X(i), its weight is calculated by: whereX(i) is the mean value of vector X(i). The probability distribution is calculated by [33]: In this method, the denominator is the summation of weights of all vectors, while the numerator is the summation of weights of each pattern. Compared with PE, WPE considers the weights of the vector; thus, it can provide more information about the nonlinearity of the time series.
Obviously, compared with the original Bandt-Pompe patterns, there is more information considered in the modified methods. The probability distribution is more reliable, and more satisfying measuring results can be obtained for the nonlinear time series.
However, these two methods still cannot solve the second problem illustrated. In our previous work, we pointed out that the PE algorithm cannot always detect the periodic state effectively [53]. Here, we explain the given example again. Suppose that there is a periodic time series, which is given by {1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, · · · }, and the Bandt-Pompe patterns are applied to detect the complexity. When Obviously, an unsatisfying complexity estimation is obtained when d ≥ 5. For WPE and IPE, the pattern series is also periodic, and the deduced probability distribution may be quite balanced, while high complexity measuring results are obtained. The main reason for those improved PE algorithms is that they mainly focused on the patterns, but did not try to establish connections between the patterns. In real applications, we hope that the complexity measuring results are low for those periodic time series, while high for those nonlinear and complex time series. Thus, it is still necessary to modify the PE algorithm.

Network Permutation Entropy
To improve the PE algorithm with a better ability to detect complexity in the nonlinear time series and to identify the periodic time series, the network permutation entropy (NPE) is designed. The key is to use the concept of the "connection" of different vectors. This means that we need to use the knowledge of the network.
For a given time series {x(n), n = 1, 2, 3, · · · , N}, the steps to calculate the NPE are listed as follows.
Step 2: Calculate the weights of each vector using Equation (8), and the results are saved in the weight series {w(i), i = 1, 2, · · · , N − d + 1}. In this step, we also calculate another index to decide whether the weights are positive or negative. The index is give by: If f lag i ≥ 0, then the weight w(i) is positive; otherwise, w(i) is negative.
Step 4: Record the connected information. Here, we use two variables. One is used to record the probability distribution, and it is denoted as {P(i), i = 1, 2, · · · , N − d + 1} and initialized as tiny constants. In this study, P(i) = 10 −5 . The other one is to record the connection information, which is given by {M(i, j), i, j = 1, 2, · · · , N − d + 1}. The matrix M is initialized as a zero matrix. In each step, if two connected vectors X(i, :) and X(n, :) are found, then: Step 5: Let: where i = 1, 2, · · · , N − d + 1. Then, the NPE is defined as: The schematic diagram of the NPE algorithm is presented in Figure 2. Meanwhile, a toy example is given to help describe the procedure. Here, set error = 0.5. Now, we need to scan the pattern series and weight series. Let us start at i = 2. We need to check whether s(1) = s(2). Since s(1) = s(2) and |w (1) − w (2)| = 0.8889 > error, the connection is not found. Increase the value of i, Let it be 3-7, and check whether the connections can be found between s(i) and s(1 → i − 1). There are no connections found since s(i) = s(1 → i − 1) (i = 3, · · · 7). When i = 8 and 9, there exists s(8, 9) = s(1), but only |w (9) − w (1)| < error. Until now, the first connection is found between vector X(1) and X(9). When i = 10, we have s(10) = s(5), and |w (5) − w (10)| = 0 < error. Thus, the second connection is found between vectors X(10) and X(5). Firstly, the NPE is proposed based on the Bandt-Pompe patterns and their weights. Thus, it contains the characteristics of PE algorithm and WPE algorithm. Secondly, the connections are checked to build the probability distribution. In this method, the smaller the error is, the more difficult it is to find a connection. Thirdly, based on the matrix M, the corresponding network can be plotted to show the complexity of the time series. Finally, to better show the process of the NPE, the pseudocode of NPE is illustrated in Algorithm 2.

Algorithm 2 Pseudocode of the NPE algorithm.
Input: x, d, error

Performance of the Algorithm
To analyze the proposed NPE algorithm, four segments of time series with a length of 10 3 are generated. Firstly, a random time series and a periodic time series, which is denoted as {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, · · · }, are generated. Then, two chaotic time series are generated. One is produced by the logistic map: where µ = 4; the other one is produced by the simplified Lorenz system [54]: where the bifurcation parameter is c = 2.
The networks and probability distributions of different kinds of time series are shown in Figure 3, where d = 3, error = 0.005. Figure 3a,b shows the network and probability distribution of a random time series. Compared with other cases, the random sequence has a more uniform probability distribution. Specifically, the periodic signal has a concentrated distribution. For many complexity measuring algorithms, including PE, ApEn, SampEn, and FuzzyEn, the measuring results for discrete chaotic systems are significantly higher than those of continuous chaotic systems. However, as shown in Figure 3, the uniformity of the the two probability distributions is at about the same level, which means that the measuring results of continuous chaotic systems and discrete chaotic systems could be at about the same level. Moreover, as shown in those networks, the more complex the time series has, the more different the structures presented.
Let d = 4 and d = 5; the networks and the corresponding probability distributions of the logistic map are illustrated in Figure 4. Basically, the different values of d can deduce the complexity of the time series. Meanwhile, the NPE of the logistic map time series with increasing error and different d is shown in Figure 5. It is shown in Figure 5 that the NPE decreases with the increase of error at the beginning, then it remains stable. According to the NPE algorithm, a smaller error means more difficulty in finding a connection. As a result, the probability distribution P is more "flat", and the estimated NPE value is larger. Meanwhile, it is shown in Figure 5 that the NPE has a larger measuring result with larger d. In this paper, we chose d > 3 for real applications.

Applications to Chaotic Systems
Chaotic systems can be divided into continuous chaotic systems and discrete chaotic systems. Furthermore, those systems can be classified into fractional-order chaotic systems and integer-order chaotic systems. Meanwhile, the chaotic systems have rich dynamics with the variation of the system parameters. NPE is applied to analyze the complexity of different chaotic systems.

Applications to the Integer-Order Chaotic Systems
Here, the complexity of the logistic map and the simplified Lorenz system are analyzed. The equations of these two systems are presented in Equations (14) and (15), respectively. The analysis results for the logistic map are shown in Figure 6. The parameter µ varies from 3.4-4 with a step size of ∆µ = 0.0024. Meanwhile, the NPE and PE complexity analysis results of the simplified Lorenz system are illustrated in Figure 7, where the bifurcation parameter varies from −2-8 with a step size of ∆c = 0.04. It is shown in Figure 7 that the complexity of the simplified Lorenz system decreases with the increase of c. Compared with the PE measuring result, the NPE measuring result has better consistency with the corresponding Lyapunov exponents, which are shown in Figure 8a. In fact, the maximum Lyapunov exponents (MLEs) of the simplified Lorenz system are shown in Figure 8b. It is shown that the NPE analysis results agree better with the MLEs of the system when compared with the PE results. For the PE algorithm, when the system is periodic, the measuring results can be larger than those of the chaotic state. As with the PE algorithm, the NPE algorithm is reliable for complexity analysis of chaotic systems.

Applications to the Fractional-Order Chaotic Systems
The fractional-order Hénon map is defined as: where t ∈ N t 0 +1−v , 0 < v ≤ 1 and a and b are the bifurcation parameters. Here, the Caputo difference C ∆ ν t 0 x [55] is used. By employing the numerical solution scheme, its solution is denoted as: where ϕ (i, j, υ) = Γ(i−j+ν) Γ(ν)·Γ(i−j+ν) . The complexity of the fractional-order Hénon map is analyzed in the parameter planes b − ν, a − ν, and a − b. The parameter a varies from 0.4-1.5 with a step size of ∆a = 0.011; the parameter b varies from 0-0.35 with a step size of ∆b = 0.0035; and the fractional derivative order ν varies from 0.4-1 with a step size of ∆ν = 0.006. Thus, each parameter plane is divided as a 101 × 101 grid. By fixing b = 0.2, d = 5, Figure 9 shows the complexity analysis results in the a − ν parameter plane. It is shown that both the NPE and PE algorithms are effective for the complexity analysis of the fractional-order Hénon map, since both the NPE and PE analysis results agree well with the SALIdetecting result and the SE analysis result as given in [56]. Moreover, the NPE in the parameter planes b − ν and a − b is shown in Figure 10. Here, the complexity in the a − b parameter plane is analyzed with different ν.
According to Figure 10, the fractional-order Hénon map has a wide region of high complexity, and it provides a good model for real applications. The fractional-order simplified Lorenz system is given by [56]: where x 1 , x 2 , and x 3 are state variables. c is the bifurcation parameter, and q is the fractional derivative order. In this study, the Caputo fractional calculus [57] is used, and the system is solved by the Adams-Bashforth-Moulton (ABM) algorithm [58].
Let the derivative order q vary from 0.9-1 with a step size of ∆q = 0.004 and the bifurcation parameter c vary from −2-8 with a step size of ∆c = 0.04. The analysis results are shown in Figure 11. The high complexity region matches well with the results in the previous work [56]. It shows the effectiveness of the proposed NPE algorithm. Meanwhile, it is shown in Figure 11 that the NPE produces good measure results as the PE algorithm analysis results for the continuous chaotic system.

Applications to EEG Signals
The EEG signals of three groups [52], which are denoted as A001-A100, C001-C100, and E001-E100, were analyzed. The descriptions of each group of EEG recordings are presented in Table 1. The data were downloaded from the web site http://epileptologie-bonn.de/cms/front_content.php?idcat= 193&lang=3&changelang=3. According to [52], the chosen Dataset A is the surface EEG recordings that were obtained from five healthy volunteers using a standardized electrode placement scheme, while Datasets C and E originated from the EEG archive of presurgical diagnosis.
Specifically, segments of Group A were taken from the depicted electrodes of healthy volunteers, Segments of Group C were taken from the depicted electrodes of the epileptogenic zone of patients during the seizure-free intervals, and segments of Group E were taken from the depicted electrodes of epileptogenic zone of patients during seizure activity. Figure 12 shows the data of A050, C050, and E050. More details about the EEG signals can be found in [11,29,52].
We investigated the complexity of these EEG signals by employing the fractional FuzzyEn algorithm [11] and the multiscale permutation Rényi entropy [29]. The effectiveness of the proposed methods is shown. In fact, the NPE algorithm can be used to analyze the complexity of different kinds of time series including these biomedical signals.
In this study, the NPE was employed to measure the complexity of the EEG signals and to verify the effectiveness of the proposed method. As in [11,29], the sliding window method was employed, where the length of each window was 1000, the sliding step was 30, and the number of windows was 100.

Datasets Data Description
Set A Signals from healthy volunteers relaxed in an awake state with eyes open; data are presented as A001-A100 Set C Signals from epileptic patients during seizure-free intervals; data are presented as C001-C100 Set E Signals from epileptic patients during seizure activity; data are presented as E001-E100 Firstly, the NPE complexity of (A020, C020, E020), (A040, C040, E040), (A070, C070, E070), and (A100, C100, E100) was analyzed, and the results are shown in Figure 13. It is shown that the NPE algorithm can distinguish different states. As shown in Figure 13, the EEG signal of the epileptic patients during seizure activity had the lowest complexity, while the EEG signal of healthy volunteers had the largest complexity. According to [11,29], the EEG and ECG signals of healthy persons had higher complexity than the signals of unhealthy persons. As shown in Figure 13, the epileptic patients during both the seizure-free intervals and the seizure activity intervals had EEG signals of lower complexity than those of the healthy volunteers. Secondly, the PE and NPE complexity of all the data was estimated, and its statistic analysis was carried out. We took the mean value of the 100 measuring results as the final PE and NPE result of each signal. Then, the NPE results of A001-A100, C001-C100, and E001-E100 were obtained. The analysis results are illustrated in the boxplot in Figure 14. Obviously, the NPE results showed that the rank of complexity yield was Set A > Set C > Set E. However, to verify this result, further statistical analysis was needed. In this study, one-way analysis of variance (ANOVA) was applied to check whether the deduced conclusion was true. Meanwhile, the experiments were carried out by employing MATLAB by using the function p = anova1(X), where X contains the NPE results. As a result, Figure 14a was produced by this function. Meanwhile, Table 2 shows that the p-value was 1.54997 × 10 −35 and the F value was 106. Since the p-value was smaller than 0.005, we could reject the null hypothesis, which meant that the NPE complexity analysis results of Set A, Set C, and Set E were statistically significant. Table 3 illustrates the statistical analysis results between Set A and Set C, Set A and Set E, and Set C and Set E. It is shown in Table 3 that all p-values were smaller than 0.005; thus, the analysis results were statistically significant among each other. Figure 14b shows the boxplot of the PE algorithm-based complexity analysis results. It indicates that the PE complexity of Set A data and Set C data overlapped with each other greatly. According to Table 4, the p-value between Set A and Set C was 0.1682, which is larger than 0.005. This meant that there was no difference between the PE measure results for Set A data and Set C data, statistically. Thus, the PE algorithm cannot distinguish Set A and Set C. In conclusion, the NPE algorithm was an effective method for the complexity of nonlinear time series, and the complexity of the three sets of EEG signals were ranked as Set A > Set C > Set E.

Discussions and Conclusions
Currently, many entropy measure algorithms have been proposed where the Shannon entropy or generalized fractional entropy was employed. Thus, how to extract a proper probability distribution that can reflect more information of the time series is the key for a more satisfying entropy result. In this paper, the network permutation entropy (NPE) was proposed to measure the complexity of nonlinear time series. Compared to the Bandt-Pompe probability distribution in the PE algorithm, the probability distribution of the NPE algorithm considered both the Bandt-Pompe patterns and the weights of the reconstructed vectors. Moreover, let us take the given periodic time series {1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, ...} of length 20,480 as an example to show the superiority of the NPE algorithm for the periodic time series. The estimated value for the normalized PE with d = 3 is PE = 0.5303, with d = 4 is PE = 0.4192, with d = 5 is PE = 0.3362, and with d = 6 is PE = 0.2446. The measure results of this periodic time series decrease with the increase of d. However, when the complexity of the time series is measured by the NPE with error = 0.0005, the results are d = 3 for NPE = 0.0957, d = 4 for NPE = 0.1342, d = 5 for NPE = 0.1621, and d = 6 for NPE = 0.1621. Thus, the complexity measure results of the new method are much closer to the ideal minimum value (zero) for the complexity of "simple" time series. Since the NPE algorithm combines the characteristics and advantage of PE, WPE and the network and extracts more information about the nonlinearity of the time series, a more satisfying measure result is obtained. Meanwhile, there are many other network entropy algorithms proposed. Compared with those network entropy algorithms, the NPE algorithm had about the same the calculation complexity since the time and space complexity degrees were both defined as O(n).
As an application, NPE was employed to analyze the complexity of different chaotic systems including the logistic map, the integer-order simplified Lorenz system, the fractional-order Hénon map, and the fractional-order simplified Lorenz system. It was shown that the NPE was an effective method for complexity analysis of chaotic systems. Both the PE and NPE measured the complexity of chaotic systems effectively, but the analysis results of the NPE algorithm matched better with the MLEs of the continuous chaotic systems. Meanwhile, the NPE algorithm-based contour plots showed that the systems had wide ranges of high complexity. Those contour plots showed more information on the dynamics of the chaotic systems. This provides a new approach for the parameter choice of chaotic systems in real applications.
Moreover, the nature of the complexity of EEG signals was investigated by employing the NPE algorithm. Here, the EEG signals were exemplary time series such as Z093, O015, N062, F021, and S056. The statistic analysis between the complexity analysis results of different sets of data was carried out based on the ANOVA and LSD. Accordingly, the NPE algorithm could distinguish different sets of EEG data. Meanwhile, the analysis results showed that the NPE complexity in descending order was: Set A (healthy volunteers), Set C (epileptic patients during seizure-free intervals), and Set E (epileptic patients during seizure activity). Hence, it was shown that the proposed NPE was effective for the complexity analysis of nonlinear time series. Our future work will focus on the complexity analysis of more real biological signals such as EEG signals and ECG signals by employing the proposed NPE algorithm and a proper neural network.