运筹与管理 ›› 2023, Vol. 32 ›› Issue (8): 174-180.DOI: 10.12005/orms.2023.0267

• 应用研究 • 上一篇    下一篇

基于时空注意力机制的双向长短期记忆神经网络的股指预测研究

杨蓦, 王静   

  1. 西北农林科技大学 经济管理学院,陕西 杨陵 712100
  • 收稿日期:2021-05-08 出版日期:2023-08-25 发布日期:2023-09-22
  • 通讯作者: 王静(1966-),女,陕西杨凌人,教授,博士生导师,研究方向:农村金融与投资学。
  • 作者简介:杨蓦(1997-),女,满族,北京人,硕士研究生,研究方向:时间序列分析。
  • 基金资助:
    国家自然科学基金资助项目(71873101)

A Spatial-temporal Attention Based BiLSTM for Stock Index Prediction

YANG Mo, WANG Jing   

  1. College of Economics and Management, Northwest A&F University, Yangling 712100, China
  • Received:2021-05-08 Online:2023-08-25 Published:2023-09-22

摘要: 股票市场是一个高噪音的混沌系统,其外部属性之间的相关性问题以及在长期预测时外部影响对股价波动的加剧,导致对股票市场进行准确预测是一项富有挑战性的工作。为解决上述问题,本文利用基于注意力机制的双向长短期记忆神经网络(BiLSTM)对香港恒生指数收盘价进行有效性的实证检验。其中,空间注意力机制用于捕捉输入指标之间的相关性并为其赋予区别权重,时间注意力机制用于描述数据的时间相关性以解决长期预测中的时间依赖问题并为时间步赋予区别权重,BiLSTM神经网络用于拟合数据并构建预测模型。本文还比较了四种基于注意力机制的神经网络方法和六种基线方法,实验结果表明,与当下流行的股票指数预测方法相比,基于双维度注意力机制的BiLSTM可以在短、中、长期预测中均实现更准确的股票指数收盘价预测。

关键词: 注意力机制, 双向长短期记忆神经网络, 股票指数预测, 长期预测, 时空关系

Abstract: In the environment of increasing volatility in financial markets and international capital flows, the accuracy and robustness of forecasts are key factors in financial decision-making. Predicting stock price indices has been an active area of research. Among them, many studies use data mining techniques, including artificial neural networks. However, most studies have shown that artificial neural networks have certain limitations in terms of learning patterns, because stock market data has huge noise and complex dimensions, correlation problems between its external properties, and external influences in long-term forecasts can lead to increased stock price volatility. Artificial neural networks have excellent learning capabilities, but they are often faced with inconsistent and unpredictable noisy data. In addition, sometimes the amount of data is too large, and the learning of patterns may not work well. In addition, in long-term forecasting, the redundancy of features and the complexity of the model cause the forecasting model to be unable to accurately extract the price and time change relationship. The presence of continuous data and large amounts of data poses serious problems for extracting valid information from raw data. Reduction and transformation of uncorrelated or redundant features can reduce uptime and produce universal results.
To solve the above problems, this article uses a bidirectional long short-term memory neural network(BiLSTM) based on attention mechanism to empirically test the effectiveness of the closing price of the Hang Seng Index in Hong Kong. The data used in this article comes from the Ruisi Financial Database, and the data interval is selected from all trading data with daily trading volume data available until August 3, 2020, and predicts the closing price of the stock index for 1 day (next day), 7 days, 30 days, 60 days, and 120 days respectively. Among them, spatial attention mechanism is used to capture the correlation between input indicators and assign different weights to them, and temporal attention mechanism is used to describe the time correlation of data to solve the problem of time dependence in long-term prediction and assign different weights to time steps. The BiLSTM neural network is used to fit the data and build a prediction model. This article also hopes to judge the effectiveness of the proposed model by comparing the performance of other popular artificial neural network models using time series in predicting market value, so it compares four attention-based neural network methods and six baseline methods.
The experimental results show that the spatial attention mechanism proposed in this paper can achieve a higher accuracy than the traditional principal component analysis dimensionality reduction method, indicating that the spatial attention mechanism can capture the correlation between feature vectors, effectively simplify the model, and improve the generalization performance of the model. In addition, the temporal attention mechanism proposed in this paper can capture the relationship between stock price and time change in long-term forecasting, so it always performs better in medium- and long-term prediction than models that do not add time attention mechanism under the same conditions.
BiLSTM based on the dual-dimensional attention mechanism can achieve more accurate prediction of the closing price of HSI stock indexes in short, medium and long-term forecasts compared with the current popular stock index prediction methods. Based on these two attention mechanisms, BiLSTM is not only able to adaptively select the most relevant input features, but also to appropriately capture the long-term temporal correlation of time series.
The conclusion of this paper provides investors with a more effective investment strategy, and also provides practical insights and potentially useful directions for further research on how deep learning network can be effectively used in stock market analysis and prediction.

Key words: attention mechanism, BiLSTM, stock index prediction, long-term prediction, spatial-temporal relationship

中图分类号: