استغلال BiLSTM-GAT لتحسين توقعات سوق الأسهم: نهج ثنائي الرسم البياني لتحسين المحفظة
Leveraging BiLSTM-GAT for enhanced stock market prediction: a dual-graph approach to portfolio optimization

المجلة: Applied Intelligence، المجلد: 55، العدد: 7
DOI: https://doi.org/10.1007/s10489-025-06462-w
تاريخ النشر: 2025-03-31
المؤلف: Xiaojian Lu وآخرون
الموضوع الرئيسي: طرق التنبؤ بسوق الأسهم

نظرة عامة

تقدم ورقة البحث نهجًا جديدًا لتوقع أسعار الأسهم من خلال تطوير نموذج BiLSTM-GAT-AM، الذي يدمج الشبكات العصبية طويلة وقصيرة المدى ثنائية الاتجاه مع شبكات الانتباه البيانية وآلية الانتباه. يعالج هذا النموذج قيود الطرق الحالية التي تركز بشكل أساسي على مهام الانحدار والتصنيف، والتي غالبًا ما تعاني من التحديات التي تطرحها البيانات المالية. من خلال استخدام هيكل ثنائي الرسم البياني – أحدهما يلتقط التشابهات الفنية من خلال تشويه الزمن الديناميكي (DTW) والآخر يمثل العلاقات الأساسية في الصناعة – يعزز النموذج دقة التنبؤ من خلال الاستفادة من كل من الرؤى الفنية والأساسية.

تشير النتائج إلى أن الرسم البياني القائم على DTW يحسن بشكل كبير أداء توقع الأسهم من خلال تحديد الارتباطات قصيرة المدى بناءً على تحركات الأسعار التاريخية. على الرغم من أن رسم القطاع الصناعي لا يتفوق على رسم DTW بشكل فردي، إلا أنه يكمل النموذج الهجين من خلال ضمان ترابط جميع الشركات، مما يعزز الهيكل العام للشبكة. يسمح هذا التكامل للنموذج بتعيين أوزان انتباه مدركة للسياق، مما يسهل اتخاذ قرارات مستنيرة. تظهر النتائج التجريبية أن النموذج المقترح لا يحقق فقط أداءً تنبؤيًا متفوقًا، بل يمكّن أيضًا من بناء محفظة محسّنة تتفوق باستمرار على النماذج الأساسية ومؤشر S&P 500، مما يبرز فعالية دمج التحليلات الفنية والأساسية في توقع سوق الأسهم وتحسين المحفظة.

مقدمة

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

لمعالجة هذه القضايا، يقترح المؤلفون نموذجًا جديدًا يجمع بين الشبكات العصبية طويلة وقصيرة المدى ثنائية الاتجاه (BiLSTM)، وشبكات الانتباه البيانية (GATs)، وآليات الانتباه (AMs). يعامل هذا النموذج كل شركة كعقدة متميزة ويستخدم مصفوفتين مجاورتين منفصلتين – واحدة للتشابهات الفنية بناءً على تحركات الأسعار والأخرى للتشابهات الأساسية بناءً على القطاعات الصناعية. من خلال القيام بذلك، يلتقط النموذج العلاقات المعقدة بين الأسهم ويصنفها وفقًا لمعدلات العائد المتوقعة، مما يسهل بناء محفظة محسّنة لعوائد معدلة حسب المخاطر. تظهر تقييمات الأداء مقارنةً بمؤشرات مرجعية، مثل S&P 500، تفوق النموذج في تحقيق عوائد أعلى مع إدارة المخاطر بشكل فعال، مما يسد الفجوة بين التنبؤ المالي واستراتيجيات التداول القابلة للتنفيذ.

طرق

في هذا القسم، يتم توضيح المنهجية المستخدمة لتقييم الأداء التنبؤي للنموذج المقترح. يتضمن الإعداد التجريبي نهجًا مزدوجًا: أولاً، يتم تقييم قدرة النموذج على توقع سعر الإغلاق لليوم التالي باستخدام متوسط الخطأ التربيعي (MSE) كمقياس للتقييم. تتم مقارنة هذا الأداء مع نماذج أخرى، باستخدام رسم بياني واحد تم إنشاؤه بواسطة مسافة تشويه الزمن الديناميكي (DTW) أو بناءً على تصنيفات القطاع الصناعي.

بعد توقعات الأسعار، يتم حساب معدلات العائد اليومية، مما يسمح بترتيب الشركات. يتم بناء محفظة من الشركات ذات الأداء الأعلى، والتي يتم اختبارها لاحقًا باستخدام بيانات السوق الفعلية لتحديد جدواها العملية. تشمل عملية الاختبار هذه إعادة حساب يومية لمعدلات العائد المتوسطة للشركات المختارة وتعديلات على تكوين المحفظة. تتكرر هذه العملية التكرارية لكل يوم تداول لمحاكاة أداء المحفظة بمرور الوقت. تركز التحليلات النهائية على مقارنة التوازن المحقق ونسبة شارب للنموذج المقترح مع تلك الخاصة بالنماذج البديلة خلال فترة الاختبار.

نتائج

في قسم النتائج، يتم مقارنة نموذج BiLSTM-GAT-AM المقترح بدقة مع النماذج الأساسية، بما في ذلك BiLSTM-GAT وBiLSTM-GNN، باستخدام إعدادات تجريبية متطابقة. تشير النتائج، الملخصة في الجدول 2، إلى أن نموذج BiLSTM-GAT-AM، الذي يدمج رسمين بيانيين متميزين، يحقق أقل متوسط خطأ تربيعي (MSE) يبلغ 0.00440 ومتوسط خطأ مطلق (MAE) يبلغ 0.04680، متفوقًا على النماذج الأخرى. يعزز هذا النهج الثنائي للرسم البياني استخراج الميزات، مما يؤدي إلى تحسين الأداء التنبؤي.

يكشف التحليل الإضافي لعوائد المحفظة أن نموذج BiLSTM-GAT-AM لا يتفوق فقط على النماذج الأساسية، بل يتفوق أيضًا على مؤشر S&P 500، محققًا أعلى توازن نهائي للمحفظة ونسبة شارب، كما هو موضح في الجدول 3 ومبين في الشكل 7. يظهر النموذج عوائد معدلة حسب المخاطر متفوقة، مما يبرز فعاليته في تحقيق أرباح متسقة مع إدارة المخاطر. تؤكد الدراسة على أهمية تحويل دقة التنبؤ إلى قرارات تداول قابلة للتنفيذ، حيث يظهر نموذج BiLSTM-GAT-AM قدرته على سد هذه الفجوة من خلال هيكله الثنائي للرسم البياني وآلية الانتباه، مما يؤدي في النهاية إلى تحسين إدارة المحفظة والعوائد المالية.

مناقشة

تسلط قسم المناقشة في ورقة البحث الضوء على تطور منهجيات توقع أسعار الأسهم، الانتقال من النماذج الإحصائية التقليدية إلى تقنيات التعلم الآلي المتقدمة، وخاصة الشبكات العصبية طويلة وقصيرة المدى (LSTM) وشبكات الانتباه البيانية (GATs). اعتمدت النماذج التنبؤية المبكرة بشكل أساسي على بيانات الأسعار التاريخية، ولكن مع توسع القدرات الحاسوبية، بدأت أساليب التعلم الآلي في دمج مجموعة واسعة من عوامل السوق، بما في ذلك المؤشرات الفنية وتحليل المشاعر. بينما أثبتت المؤشرات الفنية مثل المتوسطات المتحركة (MA)، ومؤشر القوة النسبية (RSI)، وأشرطة بولينجر فائدتها في تحسين أداء النموذج، إلا أن فعاليتها محدودة عند استخدامها بشكل منفصل. تدعو الدراسات الحديثة إلى دمج هذه المؤشرات مع مصادر بيانات متنوعة وتقنيات نمذجة متطورة لالتقاط تعقيدات الأسواق المالية بشكل أفضل.

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

Journal: Applied Intelligence, Volume: 55, Issue: 7
DOI: https://doi.org/10.1007/s10489-025-06462-w
Publication Date: 2025-03-31
Author(s): Xiaojian Lu et al.
Primary Topic: Stock Market Forecasting Methods

Overview

The research paper presents a novel approach to stock price prediction through the development of a BiLSTM-GAT-AM model, which integrates bidirectional long short-term memory networks with graph attention networks and an attention mechanism. This model addresses the limitations of existing methods that primarily focus on regression and classification tasks, which often suffer from the challenges posed by financial data. By employing a dual-graph structure—one capturing technical similarities through Dynamic Time Warping (DTW) and the other representing fundamental industry relationships—the model enhances predictive accuracy by leveraging both technical and fundamental insights.

The findings indicate that the DTW-based graph significantly improves stock prediction performance by identifying short-term correlations based on historical price movements. Although the industry sector graph does not outperform the DTW graph individually, it complements the hybrid model by ensuring that all companies are interconnected, thus enhancing the overall network structure. This integration allows the model to assign contextually aware attention weights, facilitating informed decision-making. The empirical results demonstrate that the proposed model not only achieves superior predictive performance but also enables the construction of an optimized portfolio that consistently outperforms baseline models and the S&P 500 index, highlighting the effectiveness of combining technical and fundamental analyses in stock market prediction and portfolio optimization.

Introduction

The introduction of this research paper highlights the challenges and limitations of traditional stock market prediction methods, emphasizing the need for more sophisticated approaches that account for the complexities of financial markets. While deep learning models have improved predictive accuracy, they often treat companies as homogeneous entities, neglecting the unique characteristics and interrelationships that influence stock performance. Additionally, a narrow focus on price prediction fails to provide actionable insights for traders, underscoring the necessity for a framework that integrates predictive performance with practical decision-making.

To address these issues, the authors propose a novel model that combines Bi-directional Long Short-Term Memory (BiLSTM) networks, Graph Attention Networks (GATs), and Attention Mechanisms (AMs). This model treats each company as a distinct node and utilizes two separate adjacency matrices—one for technical similarities based on price movements and another for fundamental similarities based on industry sectors. By doing so, the model captures the intricate relationships between stocks and ranks them according to predicted return rates, facilitating the construction of a portfolio optimized for risk-adjusted returns. Performance evaluations against benchmark indices, such as the S&P 500, demonstrate the model’s superiority in generating higher returns while effectively managing risk, thereby bridging the gap between financial prediction and actionable trading strategies.

Methods

In this section, the methodology employed for evaluating the predictive performance of the proposed model is outlined. The experimental setup involves a two-fold approach: first, the model’s capability to forecast the next day’s closing price is assessed using the Mean Squared Error (MSE) as the evaluation metric. This performance is compared against other models, utilizing a single graph generated by Dynamic Time Warping (DTW) distance or based on industry sector classifications.

Following the price predictions, the daily return rates are computed, allowing for the ranking of companies. A portfolio is constructed from the top-performing companies, which is subsequently backtested using actual market data to determine its practical viability. This backtesting process includes daily recalculations of the average return rates for the selected companies and adjustments to the portfolio composition. The iterative procedure is repeated for each trading day to simulate the portfolio’s performance over time. The final analysis focuses on comparing the achieved balance and Sharpe ratio of the proposed model against those of alternative models during the testing period.

Results

In the results section, the proposed BiLSTM-GAT-AM model is rigorously compared against baseline models, including BiLSTM-GAT and BiLSTM-GNN, using identical experimental setups. The findings, summarized in Table 2, indicate that the BiLSTM-GAT-AM model, which integrates two distinct graphs, achieves the lowest Mean Squared Error (MSE) of 0.00440 and Mean Absolute Error (MAE) of 0.04680, outperforming the other models. This dual-graph approach enhances feature extraction, leading to improved predictive performance.

Further analysis of portfolio returns reveals that the BiLSTM-GAT-AM model not only surpasses baseline models but also outperforms the S&P 500 index, achieving the highest final portfolio balance and Sharpe ratio, as detailed in Table 3 and illustrated in Fig. 7. The model demonstrates superior risk-adjusted returns, highlighting its effectiveness in generating consistent profits while managing risk. The study emphasizes the importance of translating prediction accuracy into actionable trading decisions, with the BiLSTM-GAT-AM model showcasing its capability to bridge this gap through its dual-graph structure and attention mechanism, ultimately leading to enhanced portfolio management and financial returns.

Discussion

The discussion section of the research paper highlights the evolution of stock price prediction methodologies, transitioning from traditional statistical models to advanced machine learning techniques, particularly Long Short-Term Memory (LSTM) networks and Graph Attention Networks (GATs). Early predictive models primarily relied on historical price data, but as computational capabilities expanded, machine learning approaches began to incorporate a wider array of market factors, including technical indicators and sentiment analysis. While technical indicators such as Moving Averages (MA), Relative Strength Index (RSI), and Bollinger Bands have proven useful in enhancing model performance, their effectiveness is limited when used in isolation. Recent studies advocate for integrating these indicators with diverse data sources and sophisticated modeling techniques to better capture the complexities of financial markets.

LSTM networks, known for their ability to handle sequential data and model long-term dependencies, have shown superior performance in stock price forecasting compared to traditional methods. Their architecture, which includes memory cells and gating mechanisms, allows for effective management of temporal information, making them particularly adept at capturing the nonlinear dynamics of financial data. Furthermore, the integration of LSTM with other methodologies, such as Convolutional Neural Networks (CNNs) and attention mechanisms, has led to significant improvements in predictive accuracy. Similarly, GATs leverage graph structures to model interdependencies among stocks, utilizing attention mechanisms to dynamically weigh the importance of relationships between entities. This approach has been shown to enhance the accuracy of stock price predictions by effectively capturing the intricate interactions within financial markets. Overall, the findings underscore the necessity for comprehensive, multi-faceted approaches in stock price forecasting to improve model robustness and accuracy.