تحسين توقعات أسعار الأسهم باستخدام M-A-BiLSTM: نهج جديد Improving stock price forecasting with M-A-BiLSTM: a novel approach

شارك:
المجلة: Frontiers in Applied Mathematics and Statistics، المجلد: 11
DOI: https://doi.org/10.3389/fams.2025.1588202
تاريخ النشر: 2025-06-04
المؤلف: Zihan Liu
الموضوع الرئيسي: طرق التنبؤ بسوق الأسهم

نظرة عامة

تقدم البحث نموذج هجين جديد لتوقع أسعار الأسهم، يسمى M-A-BiLSTM، والذي يجمع بين آليات الانتباه، والشبكات العصبية متعددة الطبقات (MLP)، والشبكات العصبية ذات الذاكرة الطويلة القصيرة الاتجاه (Bi-LSTM). يهدف هذا النموذج إلى تحسين اختيار الميزات والتقاط الأنماط غير الخطية بفعالية في بيانات السلاسل الزمنية المالية. تم تقييمه على مجموعات بيانات الأسهم من آبل، وإكسون موبيل، وتسلا، وسناب شات، وأظهر نموذج M-A-BiLSTM أداءً متفوقًا مقارنة بأساليب التعلم العميق الحالية، محققًا تخفيضات كبيرة في متوسط الخطأ التربيعي (MSE) وزيادات في قيم R-squared (R²) عبر مجموعات البيانات.

في الختام، يؤكد الدراسة على فعالية نموذج M-A-BiLSTM من خلال تجارب صارمة، مع عرض مزاياه مقارنة بالنماذج الأساسية من حيث MSE، وجذر متوسط الخطأ التربيعي (RMSE)، ومقاييس R². تسلط النتائج من تجارب الإزالة الضوء على المساهمات الحاسمة لمكونات MLP والانتباه، التي تعزز استخراج الميزات المحلية والتقاط الاعتماد طويل الأمد. بالإضافة إلى ذلك، كشفت ضبط المعلمات أن حجم الطبقة المخفية الأمثل 1,024 يعظم الأداء عبر جميع مجموعات البيانات. تقترح الدراسة أن نموذج M-A-BiLSTM هو أداة واعدة للتنبؤ المالي، مع آفاق بحث مستقبلية تشمل تحسين المعلمات، واستكشاف هياكل الشبكات المتقدمة، وتطبيقها على مجموعة واسعة من السلاسل الزمنية المالية.

مقدمة

تسلط مقدمة هذه الورقة البحثية الضوء على الأهمية المتزايدة وتعقيد توقعات سوق الأسهم ضمن قطاع المالية. يعمل سوق الأسهم كمنصة حاسمة لتخصيص رأس المال والنمو الاقتصادي، مما يجعل التوقعات الدقيقة ضرورية لتعظيم عوائد الاستثمار. كانت الأساليب الإحصائية التقليدية غير كافية إلى حد كبير بسبب عدم قدرتها على دمج العوامل المؤثرة المختلفة، مما أدى إلى تحول نحو تقنيات متقدمة مثل التعلم العميق. من الجدير بالذكر أن نماذج مثل الذاكرة الطويلة القصيرة (LSTM) وBi-LSTM أظهرت وعدًا في التقاط الاعتماد الزمني وتحسين دقة التنبؤ، على الرغم من أنها تواجه قيودًا في التعامل مع بيانات السلاسل الزمنية الطويلة.

لمعالجة هذه التحديات، تقترح الورقة نموذجًا متكاملًا جديدًا يسمى M-A-BiLSTM، والذي يجمع بين Bi-LSTM، وآلية الانتباه، والشبكات العصبية متعددة الطبقات (MLP). يهدف هذا النموذج إلى تعزيز قدرات استخراج الميزات والتمثيل من خلال الاستفادة من نقاط القوة لكل مكون. يتم تقييم نموذج M-A-BiLSTM باستخدام بيانات سوق الأسهم من شركات مثل تسلا وآبل، مع مقاييس الأداء مثل متوسط الخطأ التربيعي (MSE) التي تشير إلى تفوقه على النماذج التقليدية. تشير النتائج إلى أن هذا النهج المتكامل لا يحسن فقط دقة التنبؤ ولكن أيضًا يقدم قوة في مهام التنبؤ في العالم الحقيقي، مما يساهم بشكل كبير في مجال توقع أسعار الأسهم.

طرق

في هذا القسم، يقدم المؤلفون منهجية جديدة لتوقع أسعار الأسهم، تدمج الذاكرة الطويلة القصيرة الاتجاه (Bi-LSTM)، والشبكات العصبية متعددة الطبقات (MLP)، وآليات الانتباه في إطار موحد يسمى M-A-BiLSTM (M-A-B). تستفيد هذه الطريقة من نقاط القوة لكل نموذج لتعزيز استخراج الميزات والتمثيل، مما يحسن في النهاية الأداء التنبؤي والموثوقية في توقعات السلاسل الزمنية المالية. تبدأ البنية بـ Bi-LSTM لالتقاط الاعتماد طويل الأمد في بيانات أسعار الأسهم، تليها آلية انتباه مضمنة تبرز خطوات الزمن التاريخية الهامة، وتختتم بـ MLP لتحسين الميزات المستخرجة وتوليد التنبؤات النهائية.

يقارن المؤلفون نموذج M-A-BiLSTM الخاص بهم ضد عدة طرق أساسية، بما في ذلك MLP، وLSTM، ووحدة التكرار المغلقة (GRU)، والشبكة العصبية التلافيفية (CNN)، وموديلات هجينة مختلفة مثل CNN-LSTM وAttention-BiLSTM. تشير النتائج إلى أن M-A-BiLSTM يتفوق على هذه النماذج الأساسية عبر مجموعات بيانات متعددة، كما يتضح من مقاييس مثل متوسط الخطأ التربيعي (MSE)، وجذر متوسط الخطأ التربيعي (RMSE)، وقيم R-squared ($R^2$). على سبيل المثال، في مجموعة بيانات آبل، حقق M-A-BiLSTM MSE قدره 4.2915 و$R^2$ قدره 0.9853، مما يوضح قدرته التنبؤية المتفوقة مقارنة بالنماذج الأخرى التي تم تقييمها.

نتائج

تظهر النتائج التجريبية أن نموذج M-A-BiLSTM (M-A-B) يتفوق باستمرار على عدة نماذج منافسة عبر مجموعات بيانات متنوعة، بما في ذلك سناب شات، وإكسوم، وتسلا، وآبل. يحقق نموذج M-A-B تحسينات كبيرة في متوسط الخطأ التربيعي (MSE) وجذر متوسط الخطأ التربيعي (RMSE)، إلى جانب ارتفاع معاملات التحديد ($R^2$). على سبيل المثال، في مجموعة بيانات آبل، يقلل نموذج M-A-B من MSE بنسبة تصل إلى 6.69% مقارنة بالنماذج الأخرى، مع تخفيضات أكبر تصل إلى 8.28% و11.56% بالنسبة لنماذج Attention-Bi-LSTM وBiLSTM، على التوالي. وبالمثل، في مجموعة بيانات إكسوم، يحسن نموذج M-A-B مقياس $R^2$ بنسبة لا تقل عن 0.77% مقارنة بالنماذج الأخرى.

بالإضافة إلى ذلك، تكشف تجارب ضبط المعلمات أن حجم الطبقة المخفية يؤثر بشكل كبير على أداء النموذج. أظهرت اختبارات أحجام مختلفة (1,024، 512، 256، 128) أن أحجام الطبقات المخفية الأكبر ترتبط بانخفاض قيم MSE وRMSE، بينما تزيد قيم $R^2$. وبالتالي، تم اختيار حجم الطبقة المخفية الأمثل 1,024 لوحدة Bi-LSTM في نموذج M-A-BiLSTM لجميع التجارب اللاحقة، مما يعزز دقته التنبؤية.

مناقشة

تسلط قسم المناقشة في الورقة البحثية الضوء على التقدم والتحديات في توقع اتجاهات سوق الأسهم، مع التأكيد على قيود الأساليب التقليدية وفعالية أساليب التعلم العميق الحديثة. تكافح النماذج التقليدية، مثل المتوسطات المتحركة والتنعيم الأسي، لدمج العوامل الخارجية مثل مشاعر السوق والأخبار، مما يؤدي إلى تقليل دقة التنبؤ. في المقابل، أظهرت التطورات الأخيرة في التعلم العميق، وخاصة الشبكات العصبية ذات الذاكرة الطويلة القصيرة (LSTM) ونسخها، وعدًا في التقاط الديناميات المعقدة للسوق. تناقش الورقة تفوق شبكات Bi-LSTM على LSTMs القياسية بسبب قدرتها على معالجة البيانات في كلا الاتجاهين، مما يعزز القدرات التنبؤية. بالإضافة إلى ذلك، أظهر دمج آليات الانتباه في أطر LSTM تحسينًا في اختيار الميزات وأداء النموذج من خلال التركيز الديناميكي على المعلومات الحاسمة.

يستفيد نموذج M-A-BiLSTM المقترح، الذي يجمع بين الشبكة العصبية متعددة الطبقات (MLP)، والانتباه، وBi-LSTM، من نقاط القوة لكل مكون لتعزيز دقة التنبؤ والموثوقية في التنبؤ المالي. تظهر النتائج التجريبية أن M-A-BiLSTM يتفوق على نماذج متطورة متعددة عبر مجموعات بيانات مختلفة، محققًا متوسط خطأ تربيعي (MSE) أقل ومعاملات تحديد أعلى (R²). على الرغم من أدائه القوي، فإن فعالية النموذج تختلف عبر مجموعات البيانات، مما يظهر مجالًا للتحسين في التعامل مع الشذوذات المحلية في مجموعات بيانات آبل وسناب شات. ستركز الأعمال المستقبلية على تحسين هيكل النموذج وتعزيز قدراته التنبؤية، خاصة بالنسبة لمجموعات البيانات التي تظهر تقلبًا وتعقيدًا عاليًا.

Journal: Frontiers in Applied Mathematics and Statistics, Volume: 11
DOI: https://doi.org/10.3389/fams.2025.1588202
Publication Date: 2025-06-04
Author(s): Zihan Liu
Primary Topic: Stock Market Forecasting Methods

Overview

The research presents a novel hybrid model for stock price prediction, named M-A-BiLSTM, which combines Attention mechanisms, Multi-Layer Perceptron (MLP), and Bidirectional Long Short-Term Memory (Bi-LSTM) networks. This model aims to improve feature selection and effectively capture nonlinear patterns in financial time series data. Evaluated on stock datasets from Apple, ExxonMobil, Tesla, and Snapchat, the M-A-BiLSTM model demonstrated superior performance compared to existing deep learning methods, achieving significant reductions in Mean Squared Error (MSE) and increases in R-squared (R²) values across the datasets.

In the conclusion, the study emphasizes the M-A-BiLSTM model’s effectiveness through rigorous experiments, showcasing its advantages over baseline models in terms of MSE, Root Mean Squared Error (RMSE), and R² metrics. The findings from ablation experiments highlight the critical contributions of the MLP and Attention components, which enhance local feature extraction and long-term dependency capture. Additionally, hyperparameter tuning revealed that an optimal hidden layer size of 1,024 maximizes performance across all datasets. The study suggests that the M-A-BiLSTM model is a promising tool for financial forecasting, with future research avenues including hyperparameter optimization, exploration of advanced network architectures, and application to a wider array of financial time series.

Introduction

The introduction of this research paper highlights the increasing significance and complexity of stock market prediction within the finance sector. The stock market serves as a crucial platform for capital allocation and economic growth, making accurate predictions essential for maximizing investment returns. Traditional statistical methods have been largely inadequate due to their inability to incorporate various influencing factors, leading to a shift towards advanced techniques such as deep learning. Notably, models like Long Short-Term Memory (LSTM) and Bidirectional LSTM (Bi-LSTM) have shown promise in capturing temporal dependencies and improving predictive accuracy, although they face limitations in handling long time series data.

To address these challenges, the paper proposes a novel integrated model called M-A-BiLSTM, which combines Bi-LSTM, an Attention mechanism, and Multilayer Perceptrons (MLP). This model aims to enhance feature extraction and representation capabilities by leveraging the strengths of each component. The M-A-BiLSTM model is evaluated using stock market data from companies like Tesla and Apple, with performance metrics such as Mean Squared Error (MSE) indicating its superiority over traditional models. The findings suggest that this integrated approach not only improves predictive accuracy but also offers robustness in real-world forecasting tasks, thereby contributing significantly to the field of stock price prediction.

Methods

In this section, the authors present a novel methodology for stock price prediction, integrating Bidirectional Long Short-Term Memory (Bi-LSTM), Multi-Layer Perceptron (MLP), and Attention mechanisms into a unified framework named M-A-BiLSTM (M-A-B). This approach capitalizes on the strengths of each model to enhance feature extraction and representation, ultimately improving predictive performance and robustness in financial time series forecasting. The architecture begins with Bi-LSTM to capture long-term dependencies in stock price data, followed by an embedded Attention mechanism that highlights significant historical time steps, and concludes with MLP to refine the extracted features and generate final predictions.

The authors compare their M-A-BiLSTM model against several baseline methods, including MLP, LSTM, Gated Recurrent Unit (GRU), Convolutional Neural Network (CNN), and various hybrid models such as CNN-LSTM and Attention-BiLSTM. The results indicate that M-A-BiLSTM outperforms these baseline models across multiple datasets, as evidenced by metrics such as Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and R-squared ($R^2$) values. For instance, in the Apple dataset, M-A-BiLSTM achieved an MSE of 4.2915 and an $R^2$ of 0.9853, demonstrating its superior predictive capability compared to the other models evaluated.

Results

The experimental results demonstrate that the M-A-BiLSTM (M-A-B) model consistently outperforms several competing models across various datasets, including Snapchat, Xom, Tesla, and Apple. The M-A-B model achieves significant improvements in mean squared error (MSE) and root mean squared error (RMSE), alongside higher coefficients of determination ($R^2$). For instance, on the Apple dataset, the M-A-B model reduces MSE by up to 6.69% compared to other models, with even greater reductions of 8.28% and 11.56% relative to the Attention-Bi-LSTM and BiLSTM models, respectively. Similarly, on the Xom dataset, the M-A-B model improves the $R^2$ measure by at least 0.77% over other models.

Additionally, the hyperparameter tuning experiments reveal that the hidden layer size significantly affects model performance. Testing various sizes (1,024, 512, 256, 128) indicated that larger hidden layer sizes correlate with decreased MSE and RMSE values, while $R^2$ values increase. Consequently, the optimal hidden layer size of 1,024 was selected for the Bi-LSTM module in the M-A-BiLSTM model for all subsequent experiments, further enhancing its predictive accuracy.

Discussion

The discussion section of the research paper highlights the advancements and challenges in stock market trend prediction, emphasizing the limitations of traditional methods and the efficacy of modern deep learning approaches. Traditional models, such as moving averages and exponential smoothing, struggle to incorporate external factors like market sentiment and news, leading to reduced prediction accuracy. In contrast, recent developments in deep learning, particularly Long Short-Term Memory (LSTM) networks and their variants, have shown promise in capturing complex market dynamics. The paper discusses the superiority of Bi-LSTM networks over standard LSTMs due to their ability to process data in both forward and backward directions, enhancing predictive capabilities. Additionally, the integration of Attention mechanisms into LSTM frameworks has been shown to improve feature selection and model performance by dynamically focusing on critical information.

The proposed M-A-BiLSTM model, which combines Multilayer Perceptron (MLP), Attention, and Bi-LSTM, leverages the strengths of each component to enhance prediction accuracy and robustness in financial forecasting. Experimental results demonstrate that the M-A-BiLSTM outperforms various state-of-the-art models across multiple datasets, achieving lower Mean Squared Error (MSE) and higher coefficients of determination (R²). Despite its strong performance, the model’s effectiveness varies across datasets, particularly showing room for improvement in handling local anomalies in the Apple and Snapchat datasets. Future work will focus on refining the model’s structure and enhancing its predictive capabilities, particularly for datasets exhibiting high volatility and complexity.