# GRU Neural Network Based on CEEMDAN-Wavelet for Stock Price Prediction
## 2 Preliminaries
### Ceemdan  
In 1998, empirical mode decomposition (EMD) is a signal decomposition method proposed by [PERSON] et al. [13], which is considered to be a major breakthrough in Fourier transform-based linear and steady-state spectral analysis. Before EMD was created, the processing of signal was mostly based on linear stationary, such as the moving average autoregressive model (MA) [39], autoregressive model (AR), and vector autoregressive model (VAR) [40]. In the last 20 years, EMD as a new kind of adaptive data processing and mining method is widely employed to process non-linear and non-stationary time series. Stationary time series means that their means and variances are a constant that is independent of time. Similarly, the covariance is only related to the time interval and not to time. The contribution of EMD is to decompose a complex signal into various intrinsic mode functions (IMF) and a residual. IMF means that every signal component contains only one mode of oscillation (a single instantaneous frequency), and these decomposed signal components are called intrinsic mode functions. However, there are two conditionsthat need to be met. Condition (a): the number of extreme points and the number of zero points differ by at most 1. Condition (b): the local maximum and minimum of the envelopes have a mean value of 0. The decomposition process can be defined as three steps:  
1. Find out every local maximum and minimum point in the original signal, and then construct the upper envelope and lower envelope by combining each extreme point through the curve fitting method;
2. Constructing their mean curves \(m(t)\) by using the upper envelope and lower envelope, then the mean curve is subtracted from the original signal \(f(t)\) so that the resulting \(H(t)\) is the IMF;
3. Repeating the first and the second steps until the standard deviation (\(SD\)) is less than the threshold; then we can stop, and the formula is: \[SD=\sum_{t=0}^{r}\lvert H_{k-1}(t)-H_{k}(t)\rvert^{2}/\sum_{t=0}^{T}H_{k-1}^{2 }(t)\] (1)  
\(H_{k}(t)\) is the result of the \(k\) screening. The first \(H_{k}(t)\) to meet the conditions is the IMF component. However, there is a drawback in EMD, as it is prone to the problem of modal mixing, in which a single IMF signal contains different time scales or the same time scale appears in different IMF components. To address the drawback of EMD, EEMD [41] and CEEMDAN are proposed. CEEMDAN is not an improvement on EEMD, but rather an improvement from EMD. It decomposes noise by adding Gaussian noise and averaging signals over and over again until the components meet the two requirements mentioned above. We will discuss the noise decomposition of CEEMDAN in detail as follows. In EMD, any signal can be divided into several IMFs. In order to make the instantaneous frequency meaningful, \"narrow band [42]\" is introduced as a limitation to the data. In Ref. [42], It mentioned that there are two definitions for bandwidth. The first one is used in the study of the probability properties of the signals and waves, where the processes are assumed to be stationary and Gaussian. Then, the bandwidth can be defined in terms of spectra moments as follows. The expected number of zero crossings per unit of time is given by  
\[N_{0}=\frac{1}{\pi}\left(\frac{m_{2}}{m_{0}}\right)^{1/2} \tag{2}\]  
while the expected number of extrema per unit time is given by  
\[N_{1}=\frac{1}{\pi}\left(\frac{m_{4}}{m_{2}}\right)^{1/2} \tag{3}\]  
in which \(m_{i}\) is the \(i\)th moment of the spectrum. Therefore, the parameter, \(v\), is defined as  
\[{N_{1}}^{2}-{N_{0}}^{2}=\frac{1}{\pi^{2}}\frac{m_{4}m_{0}-{m_{2}}^{2}}{m_{2}m _{0}}=\frac{1}{\pi^{2}}v^{2} \tag{4}\]  
According to the above formula, in order to make the \"narrow band\" signal \(v=0\), \(v_{1}\) and \(v_{2}\) must be equal; that is, the number of extreme points and zero-crossing points must be equal (i.e., Condition (a)). For any meaningful function, the real part of the Fourier transform of the function must have only a positive frequency, which is global.