Authors: Abdullah Enes Doruk and Ahmet Mete Dokgoz
Stock market prediction is a complex challenge due to the dynamic and multifaceted nature of financial data, influenced by factors such as market trends, economic indicators, and investor behavior. Traditional forecasting models often fail to capture these intricate relationships, leading to significant forecasting errors. To address these limitations, this paper presents a novel hybrid model that combines Mamba blocks with self-attention mechanisms derived from liquid neural networks. Our approach leverages the efficient feature extraction capabilities of Mamba blocks while utilizing self-attention to effectively model temporal dependencies and nonlinear interactions within the data. We rigorously evaluated our hybrid model on a comprehensive stock market dataset, encompassing extensive historical price movements and trading volumes, which allowed us to benchmark against various state-of-the-art forecasting methods. Experimental results demonstrate that our hybrid approach significantly outperforms existing techniques in prediction accuracy and robustness to market volatility, highlighting the potential of advanced neural network architectures to enhance financial forecasting.
This project tested under pytorch 2.4.1 and CUDA 12.4 versions. However, you can work with CUDA 11x and related Pytorch versions.
The code has been tested running under Python 3.8.19, with the following packages and their dependencies installed:
numpy==1.16.5
matplotlib==3.1.0
sklearn==0.21.3
pandas==0.25.1
pytorch==2.4.1
The stock data used in this repository was downloaded from TuShare. The stock data on TuShare are with public availability. Some code of the Mamba model is from https://github.com/alxndrTL/mamba.py
python train.py
- We thank the authors of MambaStock and their open-source codes.