# EL-MTSA: Stock Prediction Model Based on Ensemble Learning and Multimodal Time Series Analysis
## 3 Model Construction
### Deep-Learning-Based Sequential Prediction Network
By selecting the top \(k\) frequencies with the highest amplitudes, the most significant periodic patterns in the time series can be determined as follows:  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{11}\]5  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{11}\]6  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{11}\]7  
Here \(X\in\mathbb{R}^{T\times C}\) represents the input time series, where \(T\) is the length of the series and \(C\) is the number of feature dimensions, \(FFT(X)\) denotes the fast Fourier transform applied to the time series, and \(Amp(\cdot)\) calculates the amplitude at each frequency, while \(Avg(\cdot)\) computes the average amplitude across all feature dimensions. The set \(\{f_{1},f_{2},\cdots,f_{k}\}\) consists of the \(k\) frequencies with the highest amplitudes; \(p_{i}\) is the period corresponding to the \(i\)-th frequency; and \(A\) represents the average amplitude. In real-world scenarios, the time series frequently exhibits multi-periodicity, where overlapping and interacting periods complicate the modeling of temporal dynamics. To address this challenge, we propose a transformation of the one-dimensional time series, initially processed via the fast Fourier transform (FFT), into a set of two-dimensional tensors based on multiple periodic components. This transformation extends the analysis of temporal variations into a two-dimensional space, enabling the embedding of intra-period variations into the columns of the tensor and inter-period variations into its rows. By leveraging this structured representation, the two-dimensional patterns of temporal changes can be efficiently modeled using two-dimensional convolutional kernels, as illustrated in \[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{11}\]8 This approach allows the model to more effectively capture the intricate dynamics inherent in the time series, significantly improving its predictive accuracy and generalization capabilities. The transformation formulation is shown as follows:  
\[i_{t}=\sigma(W_{i}\cdot[h_{t-1},x_{t}]+b_{i}) \tag{11}\]9  
where \(X_{i}^{2D}\in\mathbb{R}^{p_{i}\times f_{i}\times C}\) represents the transformed two-dimensional tensor. The function \(\text{{Padding}}(X)\) is used to zero-pad the time series to ensure it can be evenly divided by \(p_{i}\) and \(f_{i}\). The function \(\text{Reshape}_{p_{i},f_{i}}(\cdot)\) rearranges the time series into a two-dimensional tensor, where \(p_{i}\) denotes the number of rows (period length) and \(f_{i}\) represents the number of columns (number of points within a period). Multi-scale features are extracted by applying two-dimensional convolution, as described in the following formula, to effectively capture both intra-period and inter-period variations. \[\widetilde{C}_{t}=\tanh(W_{c}\cdot[h_{t-1},x_{t}]+b_{c}) \tag{12}\]0  
where \(\widetilde{X}_{i}^{2D}\) represents the feature map processed by two-dimensional convolution. The Inception module [44], denoted as \(\text{{Inception}}(\cdot)\), includes multiple convolutional kernels of different sizes, enabling the simultaneous capture of both local and global features. The Softmax function is employed to transform the FFT output into a probability distribution. Specifically, it processes the weights corresponding to feature representations across different periods, normalizing them to facilitate more effective integration and fusion of these features. \[\widetilde{C}_{t}=\tanh(W_{c}\cdot[h_{t-1},x_{t}]+b_{c}) \tag{12}\]1 Structure illustration of cycle layer. Suppose the model identifies \(N\) periods, with each period corresponding to a feature representation \(X_{1},X_{2},\cdots,X_{N}\), and their respective weights being \(A_{1},A_{2},\cdots,A_{N}\).