Predicting Stock Prices Multiple Steps Ahead Using Recurrent Fuzzy Neural Networks and Variational Mode Decomposition
An Advanced Approach Combining Neural Networks and Signal Decomposition for Accurate Future Stock Price Forecasting
If you prefer listening over reading, you can now listen to the article. You can also download the source code using the link provided at the end.
In today’s rapidly fluctuating financial markets, the ability to accurately predict stock prices has become more crucial than ever. Investors and financial analysts rely heavily on precise forecasts to make informed decisions, optimize investment strategies, and mitigate risks. The dynamic nature of stock markets, influenced by a myriad of economic indicators, geopolitical events, and investor sentiments, underscores the necessity for sophisticated prediction models that can adapt to ever-changing conditions. Accurate stock price predictions not only enhance individual investment outcomes but also contribute to the stability and efficiency of the broader economy by enabling more effective capital allocation.
However, forecasting stock prices poses significant challenges due to the inherent complexity and volatility of financial time series data. Traditional prediction models often focus on one-step-ahead forecasting, which limits their utility in long-term investment planning. These models struggle to capture the non-linear patterns and abrupt fluctuations characteristic of financial markets, leading to suboptimal prediction accuracy. Moreover, financial data exhibit high volatility and non-stationarity, making it difficult for conventional models to maintain consistent performance over extended prediction horizons.
Existing decomposition-based methods have made strides in addressing some of these challenges by breaking down complex time series into simpler components. While these approaches have shown promise, they typically approximate only a single function, which hampers their ability to achieve high accuracy in multi-step-ahead predictions. This limitation is particularly problematic in financial markets, where the interplay of multiple factors necessitates models capable of capturing diverse patterns and relationships over time. As a result, there remains a critical need for advanced prediction techniques that can effectively handle the multifaceted nature of financial data and provide reliable forecasts over multiple future time steps.
To bridge this gap, innovative methods that integrate advanced signal processing techniques with robust neural network architectures are essential. By leveraging such hybrid approaches, it is possible to enhance the predictive performance and adaptability of stock price forecasting models. This article delves into two novel methodologies designed to improve multi-step-ahead stock price predictions. These methods utilize Discrete Cosine Transform (DCT) and Variational Mode Decomposition (VMD) in conjunction with Multi-functional Recurrent Fuzzy Neural Networks (MFRFNN), aiming to simplify the time series structure and enable the simultaneous approximation of multiple functions.
The subsequent sections of this article will provide a comprehensive overview of the proposed methodologies, detailing their underlying principles and operational frameworks. Following this, the experimental setup and evaluation metrics used to assess the performance of these models will be discussed. The article will then present and analyze the empirical results, highlighting the effectiveness of the proposed approaches compared to existing state-of-the-art methods. Finally, the conclusion will summarize the key findings and suggest potential avenues for future research in the realm of financial time series prediction.
Background and Literature Review
Financial time series encompass sequential data points representing financial variables such as stock prices, exchange rates, and market indices, recorded over consistent time intervals. Accurate prediction of these series is paramount for investors, financial analysts, and policymakers, as it informs investment strategies, risk management, and economic forecasting. The ability to anticipate future price movements enables stakeholders to make informed decisions, optimize portfolio allocations, and enhance market stability. Financial markets are inherently volatile and influenced by a multitude of factors, including economic indicators, geopolitical events, and investor sentiment, making precise prediction a complex yet critical endeavor.
Forecasting in financial time series can be categorized into one-step-ahead and multi-step-ahead predictions. One-step-ahead forecasting involves predicting the immediate next value in the series, offering short-term insights that are valuable for day trading and quick decision-making. In contrast, multi-step-ahead forecasting extends the prediction horizon to multiple future points, providing a broader perspective essential for long-term investment planning and strategic decision-making. While one-step predictions are relatively straightforward, multi-step forecasting poses greater challenges due to the accumulation of prediction errors and the intricate dependencies over extended periods.
Decomposition-based methods have emerged as effective strategies to enhance the accuracy of financial time series predictions by breaking down complex data into simpler, more manageable components. Empirical Mode Decomposition (EMD) is a widely used technique that adaptively decomposes a time series into Intrinsic Mode Functions (IMFs) and a residual trend. EMD is particularly adept at handling non-linear and non-stationary data, making it suitable for financial applications. However, EMD suffers from several limitations, including mode mixing — where a single IMF may contain oscillations of widely disparate scales — and high sensitivity to noise, which can compromise the reliability of the decomposition.
To address these shortcomings, Variational Mode Decomposition (VMD) was introduced as an advanced alternative to EMD. VMD offers a more robust decomposition by formulating it as a variational problem, ensuring that each IMF is confined within a specific bandwidth and effectively mitigating mode mixing. This enhanced capability makes VMD more resilient to noise and more accurate in isolating intrinsic oscillatory modes, thereby providing cleaner and more distinct components for subsequent analysis and prediction.
In the realm of time series prediction, neural networks have demonstrated significant potential due to their ability to model complex, non-linear relationships. Feedforward Neural Networks (FFNN) are among the simplest types of neural networks used for time series forecasting. They consist of layers of interconnected neurons where data flows in one direction — from input to output — without cycles. FFNNs can capture basic patterns in data but often fall short in handling temporal dependencies inherent in financial time series.
Long Short-Term Memory (LSTM) networks, a specialized form of recurrent neural networks (RNNs), have been developed to address the limitations of FFNNs by effectively capturing long-term dependencies in sequential data. LSTMs incorporate memory cells and gating mechanisms that allow them to retain information over extended time periods, making them highly effective for modeling the temporal dynamics of financial markets. Their ability to remember and utilize past information enhances their predictive accuracy, especially in volatile and non-linear environments.
Building upon these advancements, Recurrent Fuzzy Neural Networks (MFRFNN) integrate fuzzy logic with recurrent neural architectures to further improve prediction performance. MFRFNNs are designed to approximate multiple functions simultaneously by identifying and modeling different states of the system. This multi-functional capability allows MFRFNNs to better capture the diverse and dynamic behaviors exhibited by financial time series, leading to more accurate and reliable predictions.
Several hybrid models have been proposed that combine decomposition methods with neural networks to leverage the strengths of both approaches. For instance, EMD-LSTM integrates Empirical Mode Decomposition with LSTM networks, where EMD decomposes the time series into IMFs that are individually modeled by LSTMs. Similarly, MEMD-LSTM employs Multivariate EMD to handle multiple related time series simultaneously before applying LSTM for prediction. These hybrid models have demonstrated improved performance over standalone neural networks by effectively simplifying the prediction task through decomposition.
Despite these advancements, there remains a significant research gap in developing models that can accurately perform multi-step-ahead predictions while effectively handling the complex, non-linear nature of financial data. Existing decomposition-based methods typically approximate only a single function, limiting their ability to capture the multifaceted dynamics required for long-term forecasting. Addressing this gap necessitates the development of innovative models that integrate advanced signal processing techniques with sophisticated neural network architectures capable of approximating multiple functions simultaneously, thereby enhancing the accuracy and reliability of multi-step financial predictions.
Research Objectives and Contributions
The primary objective of this study is to advance the field of financial time series forecasting by developing two innovative methodologies, namely DCT-MFRFNN and VMD-MFRFNN, specifically designed for multi-step-ahead stock price prediction. These methods aim to overcome the inherent limitations of existing models that rely on single-function approximation, which often fail to capture the complex, non-linear dynamics of financial markets. By addressing this limitation, the proposed models seek to enhance prediction accuracy and reliability, thereby providing more robust tools for investors and financial analysts in making informed decisions.
A key contribution of this research is the introduction of DCT-MFRFNN, which synergistically combines the Discrete Cosine Transform (DCT) with a Multi-functional Recurrent Fuzzy Neural Network (MFRFNN). This integration effectively reduces high-frequency noise and simplifies the structure of financial time series data, making it easier for the neural network to model underlying patterns. Additionally, the study presents VMD-MFRFNN, which merges Variational Mode Decomposition (VMD) with MFRFNN. This hybrid approach decomposes the time series into several Intrinsic Mode Functions (IMFs), allowing each component to be predicted separately by individual MFRFNN models. This decomposition enhances the model’s ability to handle different frequency components independently, thereby improving overall prediction performance.
Furthermore, the research develops novel training algorithms tailored for these hybrid models, ensuring optimal parameter tuning and convergence during the learning process. The empirical evaluation of DCT-MFRFNN and VMD-MFRFNN across multiple financial indices, including the Hang Seng Index, Shanghai Stock Exchange, and Standard & Poor’s 500 Index, demonstrates their superior performance compared to state-of-the-art models. These advancements underscore the potential impact of the proposed methods in enhancing the accuracy and reliability of financial forecasts, ultimately aiding investors in making more strategic and profitable investment decisions.
Methodology
Accurate multi-step-ahead stock price prediction necessitates sophisticated methodologies capable of handling the inherent complexities of financial time series data. This study introduces two innovative approaches — Discrete Cosine Transform — Multi-functional Recurrent Fuzzy Neural Network (DCT-MFRFNN) and Variational Mode Decomposition — Multi-functional Recurrent Fuzzy Neural Network (VMD-MFRFNN) — designed to enhance prediction accuracy by simplifying data structures and leveraging advanced neural network architectures.
Both proposed methods integrate signal decomposition techniques with a Multi-functional Recurrent Fuzzy Neural Network (MFRFNN) to address the challenges posed by volatile and non-linear financial data. While DCT-MFRFNN employs the Discrete Cosine Transform (DCT) to reduce high-frequency noise, VMD-MFRFNN utilizes Variational Mode Decomposition (VMD) to break down the time series into Intrinsic Mode Functions (IMFs). These decomposed components are then individually processed by separate MFRFNN models, whose predictions are subsequently aggregated to form the final multi-step-ahead forecast.
A. Discrete Cosine Transform — Multi-functional Recurrent Fuzzy Neural Network (DCT-MFRFNN)
Discrete Cosine Transform (DCT)
The Discrete Cosine Transform (DCT) plays a pivotal role in transforming time series data from the time domain to the frequency domain. By converting the data into its frequency components, DCT facilitates the identification and attenuation of high-frequency noise, which often obscures the underlying trends in financial data. In the DCT-MFRFNN framework, a specified percentage (λ) of the highest-frequency DCT coefficients are systematically dropped. This reduction serves to minimize fluctuations and noise, effectively smoothing the time series and simplifying its structure. The selection of λ is critical; it must balance the removal of noise without discarding essential information that contributes to accurate predictions.
Signal Reconstruction
Following the attenuation of high-frequency components, the inverse Discrete Cosine Transform (IDCT) is applied to reconstruct the time series. This process synthesizes a smoothed version of the original data, characterized by reduced volatility and more pronounced trends. The reconstructed signal retains the fundamental patterns necessary for reliable forecasting while eliminating the erratic variations that can hinder predictive accuracy.
MFRFNN Integration
The smoothed time series generated through IDCT is then fed into the Multi-functional Recurrent Fuzzy Neural Network (MFRFNN) for training and prediction. MFRFNN is distinguished by its dual-network architecture, comprising an output network and a state network. The output network generates the predicted values, while the state network identifies the current state of the system, enabling the model to approximate multiple functions simultaneously. This capability is particularly advantageous for financial data, which often exhibit state-dependent behaviors and complex, non-linear relationships.
Training Algorithm
The training of DCT-MFRFNN involves several key steps, encapsulated in a structured algorithm:
Apply DCT: Transform the input time series into the frequency domain to obtain DCT coefficients.
Filter High-Frequencies: Set λ percent of the highest-frequency DCT coefficients to zero, effectively reducing noise.
Reconstruct Signal: Use IDCT to synthesize the smoothed time series from the filtered coefficients.
Train MFRFNN: Input the reconstructed signal into the MFRFNN model for training, utilizing optimization techniques such as Particle Swarm Optimization (PSO) to fine-tune network parameters.
Generate Prediction: Deploy the trained MFRFNN to produce multi-step-ahead stock price forecasts.
This algorithm ensures that the MFRFNN operates on a cleaner, more stable dataset, thereby enhancing its ability to capture underlying patterns and improve prediction accuracy.
B. Variational Mode Decomposition — Multi-functional Recurrent Fuzzy Neural Network (VMD-MFRFNN)
Variational Mode Decomposition (VMD)
Variational Mode Decomposition (VMD) is an advanced signal processing technique designed to decompose complex time series data into multiple Intrinsic Mode Functions (IMFs) with specific bandwidths. Unlike traditional Empirical Mode Decomposition (EMD), VMD formulates the decomposition as a variational problem, ensuring that each IMF is optimally confined within its respective frequency band. This approach effectively mitigates common issues such as mode mixing and enhances the robustness of the decomposition process.
In the VMD-MFRFNN framework, the input time series is decomposed into K distinct IMFs, each representing a different frequency component of the original signal. By isolating these components, VMD facilitates the modeling of simpler, more stationary sub-series, which are inherently easier to predict accurately.
Prediction and Reconstruction
Once the time series is decomposed into IMFs, each IMF is individually processed by a separate MFRFNN model. This parallel processing allows each network to specialize in forecasting its respective frequency component, leveraging the MFRFNN’s ability to handle multiple functions simultaneously. The predictions from all MFRFNN models are then aggregated by summing the individual IMF forecasts, thereby reconstructing the final multi-step-ahead stock price prediction. This hierarchical approach ensures that both high-frequency fluctuations and low-frequency trends are accurately captured and integrated into the final forecast.
Training Algorithm
The training of VMD-MFRFNN follows a systematic procedure outlined in the following steps:
Decomposition Phase: Apply VMD to the input time series to obtain K IMFs, each with a specific frequency range.
Prediction Phase:
Train Separate MFRFNNs: Assign each IMF to a distinct MFRFNN model for individual training and prediction.
Predict IMFs: Each MFRFNN generates predictions for its assigned IMF, handling the specific dynamics of that frequency component.
Reconstruction Phase: Sum the predicted IMFs to form the comprehensive multi-step-ahead stock price forecast.
This algorithm capitalizes on the strengths of both VMD and MFRFNN, ensuring that each frequency component is effectively modeled and integrated into the overall prediction.
Parameter Selection and Optimization
The efficacy of both DCT-MFRFNN and VMD-MFRFNN hinges on the careful selection and optimization of key parameters. Critical parameters include the number of IMFs (K) in VMD-MFRFNN, the percentage of high-frequency coefficients (λ) in DCT-MFRFNN, and the number of fuzzy rules within the MFRFNN models. These parameters are typically determined through a trial-and-error process using validation sets, allowing for fine-tuning based on empirical performance.
Additionally, the training process employs Particle Swarm Optimization (PSO) to optimize network parameters. PSO leverages adaptive inertia weights and cognitive/social acceleration coefficients to navigate the parameter space efficiently, ensuring convergence to optimal solutions. This optimization technique enhances the learning capability of MFRFNN models, enabling them to more accurately approximate the underlying functions governing stock price movements.
Architectural Diagrams
To facilitate a comprehensive understanding of the proposed methodologies, the structural frameworks of DCT-MFRFNN and VMD-MFRFNN can be visualized through architectural diagrams (referenced as Figures 2 and 3). These diagrams illustrate the sequential processes of signal transformation, decomposition, reconstruction, and neural network integration, providing a clear depiction of the model workflows. In practice, including these figures in the article would offer readers a visual representation of the complex interactions between different components, enhancing their grasp of the methodologies’ operational dynamics.
Conclusion of Methodology
The integration of advanced signal processing techniques with sophisticated neural network architectures marks a significant advancement in multi-step-ahead stock price prediction. By leveraging DCT and VMD to simplify and decompose financial time series data, and employing MFRFNN’s multi-functional capabilities, the proposed methods achieve a higher degree of accuracy and reliability. This methodological innovation not only addresses the limitations of existing models but also sets a new benchmark for future research in financial forecasting.
Experimental Setup
To rigorously evaluate the effectiveness of the proposed multi-step-ahead stock price prediction models, a comprehensive experimental setup was established using three prominent financial indices: the Hang Seng Index (HSI), the Shanghai Stock Exchange (SSE), and the Standard & Poor’s 500 Index (SPX). These datasets were meticulously sourced from Yahoo Finance, ensuring reliable and standardized data for analysis.
Datasets
Hang Seng Index (HSI): Comprising 2,261 samples, the HSI dataset spans a nine-year period from January 4, 2010, to March 8, 2019. As a primary indicator of Hong Kong's stock market performance, the HSI reflects the economic health and investor sentiment within one of Asia's most significant financial hubs.
Shanghai Stock Exchange (SSE): This dataset includes 2,218 samples collected over nine years, from December 31, 2010, to February 21, 2020. Representing one of the world's largest and most dynamic stock markets, the SSE dataset provides insights into the behavior of a developing market characterized by rapid growth and high trading volumes.
Standard & Poor’s 500 Index (SPX): With 2,769 samples spanning eleven years from January 4, 2010, to December 31, 2020, the SPX dataset is pivotal for evaluation due to its representation of 500 leading publicly traded companies in the United States. As a barometer of the U.S. economy, the SPX offers a comprehensive view of market trends and investor confidence in one of the most mature financial markets globally.
Data Partitioning
Each dataset was strategically divided into training, validation, and test sets to ensure robust model training and unbiased evaluation:
HSI: 1,509 samples for training, 376 for validation, and 376 for testing.
SSE: 1,478 samples for training, 370 for validation, and 370 for testing.
SPX: 1,845 samples for training, 462 for validation, and 462 for testing.
This partitioning approach allows the models to learn from a substantial portion of historical data while reserving adequate samples for fine-tuning and performance assessment.
Prediction Horizons
The models were tasked with predicting stock prices at three distinct horizons:
One-Step-Ahead Prediction: Forecasting the immediate next value, crucial for short-term trading decisions and tactical investment strategies.
Three-Step-Ahead Prediction: Providing intermediate forecasts that aid in medium-term planning and adjusting investment portfolios.
Five-Step-Ahead Prediction: Enabling long-term investment strategies by anticipating future market movements over extended periods.
These varying horizons are essential for investors seeking to balance immediate gains with sustained growth, catering to diverse investment timelines and risk appetites.
Baseline Models for Comparison
To benchmark the proposed models’ performance, several established methods were employed:
ARIMA (Autoregressive Integrated Moving Average): A traditional statistical model renowned for its simplicity and effectiveness in time series forecasting, serving as a fundamental benchmark.
Feedforward Neural Networks (FFNN): Representing traditional machine learning approaches, FFNNs offer a baseline for evaluating neural network-based predictions without temporal dependencies.
Long Short-Term Memory (LSTM): A sophisticated deep learning model adept at capturing long-term dependencies in sequential data, making it a strong contender for time series prediction.
EMD-LSTM and MEMD-LSTM: Hybrid models that integrate Empirical Mode Decomposition (EMD) and Multivariate EMD (MEMD) with LSTM, respectively, enhancing prediction accuracy by decomposing complex time series into simpler components before forecasting.
MFRFNN (Multi-functional Recurrent Fuzzy Neural Network): Serving as the base model, MFRFNN incorporates fuzzy logic and recurrent connections to handle non-linearity and state-dependent behaviors in time series data.
Evaluation Metrics
The models’ predictive performance was assessed using two primary metrics:
Mean Absolute Percentage Error (MAPE): Calculated as the average absolute percentage difference between predicted and actual values, MAPE provides a clear measure of prediction accuracy, making it easy to interpret and compare across different scales.
Root Mean Square Error (RMSE): Defined as the square root of the average squared differences between predicted and actual values, RMSE effectively penalizes larger errors, providing a robust measure of prediction deviations.
Statistical Testing
To ensure the reliability and significance of the results, Welch’s t-test was employed. This non-parametric test is particularly suited for comparing the means of two samples with unequal variances, thereby providing a robust assessment of whether the observed performance improvements are statistically significant. A significance threshold of α = 0.05 was adopted, ensuring that the probability of observing such results due to random chance is less than 5%.
Through this meticulous experimental setup, the study aims to provide a comprehensive evaluation of the proposed models, demonstrating their superiority and practical applicability in the realm of financial time series prediction.
Results and Discussion
The effectiveness of the proposed DCT-MFRFNN and VMD-MFRFNN models was rigorously evaluated against established baseline models across three significant financial indices: the Hang Seng Index (HSI), the Shanghai Stock Exchange (SSE), and the Standard & Poor’s 500 Index (SPX). The evaluation encompassed various prediction horizons—one-step, three-step, and five-step-ahead forecasts—to assess the models' performance in both short-term and long-term prediction scenarios. The results unequivocally demonstrate the superior accuracy and reliability of the VMD-MFRFNN model, with DCT-MFRFNN also exhibiting notable improvements over the base MFRFNN model.
Overall Performance
Across all datasets and prediction horizons, VMD-MFRFNN consistently outperformed the baseline models, including ARIMA, Feedforward Neural Networks (FFNN), Long Short-Term Memory (LSTM) networks, and hybrid models such as EMD-LSTM and MEMD-LSTM. The enhancements were most pronounced in terms of Root Mean Square Error (RMSE), where VMD-MFRFNN achieved significant reductions compared to the second-best models. Additionally, Mean Absolute Percentage Error (MAPE) metrics corroborated these findings, showcasing the models' ability to deliver precise and reliable forecasts. The statistical significance of these improvements was validated using Welch’s t-test, ensuring that the observed performance gains were not attributable to random chance.







