## 3 Hierarchical Dispersion Entropy
### Hierarchical Dispersion Entropy Algorithm Flow  
Referring to the advantages of hierarchical segmentation in hierarchical entropy, combined with the definition of dispersion entropy, the concept of hierarchical dispersion entropy is proposed. The calculation process of hierarchical dispersion entropy is as follows:  
(i) Given a time series \(\{u(i),i\ =\ 1,2,\ldots,N\}\) with the length \(N(N\ =\ 2^{n}\), \(n\) is a positive integer), define the averaging operators \(Q_{0}\) and \(Q_{1}\) for the time series as follows:  
\[Q_{0}(u)\ =\ \frac{u(2j)+u(2j+1)}{2},j\ =\ 1,2,\ldots,2^{n-1} \tag{15}\]  
\[Q_{1}(u)\ =\ \frac{u(2j)-u(2j+1)}{2},j\ =\ 1,2,\ldots,2^{n-1} \tag{16}\]  
where \(Q_{0}(u)\) and \(Q_{1}(u)\) carry the low-frequency and high-frequency features of u at scale 2, respectively. When j = 0 or j = 1, the matrix operator \(Q_{j}\) is defined as follows  
\[Q_{j}\ =\ \left[ \begin{array}{cccccc}\frac{1}{2}&\frac{(-1)^{j}}{2}&0&0& \ldots&0&0\\ 0&0&\frac{1}{2}&\frac{(-1)^{j}}{2}&\ldots&\vdots&\vdots\\ \vdots&\vdots&\vdots&\vdots&\ldots&0&0\\ 0&0&0&0&\ldots&\frac{1}{2}&\frac{(-1)^{j}}{2}\\ \end{array} \right]_{2^{n-1}\times 2^{n}} \tag{17}\]  
(ii) In order to perform the hierarchical analysis on the signal \(u(i)\), the above operators have to be employed iteratively. Let \(k\in N\) construct a vector \([\gamma_{1,}\gamma_{2},\ldots,\gamma_{k}]\in\{0,1\}\), then the integer e can be expressed as  
\[e\ =\ \sum_{j\ =\ 1}^{k}\gamma_{j}2^{k-j} \tag{18}\]  
In the formula, the vector corresponding to the positive integer e is \([\gamma_{1,}\gamma_{2},\ldots,\gamma_{n}]\); \(k\) and \(e\) are the layer number and node number, respectively. (iii) Based on the vector \([\gamma_{1,}\gamma_{2},\ldots,\gamma_{n}]\), the hierarchical component \(u_{k,e}\) is expressed as  
\[u_{k,e}\ =\ Q_{\gamma_{1}},Q_{\gamma_{2}},\ldots,Q_{\gamma_{k}}(u) \tag{19}\]  
where \(k\) represents the \(k\)-layer in the hierarchical segmentation, and the original time series \(u(i)\) is represented by \(u_{k,0}\) and \(u_{k,1}\) in the low-frequency portion and the high-frequency portion of the k + 1 layer. For different \(k\) and \(e\), the signals \(u_{k,e}\) consist of the hierarchical decomposition of signal \(u(i)\) in different scales. In Figure 4, the hierarchical decomposition of \(u(i)\) in 4 scales is illustrated in the form of a hierarchical tree. (iv) Find the dispersion entropy of each hierarchical component obtained and obtain the dispersion entropy of \(2^{k}\) hierarchical component [31]. The hierarchical component sequence \(u_{k,e}\) is mapped to \([y_{1},y_{2},\ldots,y_{2^{k}}]\) by introducing a normal cumulative distribution (NCDF). The calculation formula is \(y_{2^{k}}=\frac{1}{\sigma\sqrt{2\pi}}\int\limits_{-\infty}^{\frac{u_{k,e}}{2 \sigma^{2}}}e^{\frac{-(t-y)^{2}}{2\sigma^{2}}}dt\), and the value ranges from 0 to 1. Next, we assign each y to an integer class with labels from 1 to \(c\). For each member of the mapped signal, we use \(z_{j}^{c}=round(c*y_{j}+0.5)\), where \(z_{j}^{c}\) shows the jth member of the classification time series. (v) Introducing the embedded dimension m and the delay parameter \(d\) and reconstructing the sequence, \(z_{i}^{m,c}\) is  
\[z_{i}^{m,c}=\left\{z_{i}^{c},z_{i+d}^{c},\ldots,z_{i+(m-1)d}^{c}\right\},i=1,2,\ldots,N-(m-1)d \tag{20}\]  
Each time series \(z_{i}^{m,c}\) is mapped to a dispersion pattern \(\pi_{v_{0}v_{1}\ldots v_{m-1}}\), where \(z_{i}^{c}=v_{0},z_{i+d}^{c}=v_{1},\ldots,z_{i+(m-1)d}^{c}=v_{m-1}\). The number of dispersion patterns that can be assigned to each time series \(z_{i}^{m,c}\) is equal to \(c^{m}\) since the signal has m members and each member can be one of the integers from 1 to \(c\).