|
Pure Mathematics 2023
基于GRU-RNN的股票趋势预测模型
|
Abstract:
随着深度学习技术和金融市场的快速发展,股票投资已经成为人们获取收益的重要方式。股票趋势预测是指将每日收盘价随时间变化的数据视作一个时间序列,根据历史时交易数据的变化规律来预测未来的趋势,是投资者获取收益、企业管理经营和国家调整宏观策略控制通货膨胀的关键,但股价的波动具有很强的变化随机性和不稳定性。研究表明传统的统计学和机器学习方法难以挖掘股价波动背后的深层次规律,存在一定局限性使得预测效果不佳,因此训练深度神经网络进行预测是很有必要的。在本文中首先对国内股票市场的趋势分析方法进行对比分析,借助财经数据包Tushare获取了数十支沪深300指数成分股数据并进行预处理,调用Python股票量化指标库Stockstats和技术分析库TA-Lib计算各类技术指标,形成一套完整的多指标特征体系。在初始特征空间上基于加入门控循环单元的循环神经网络、前馈神经网络和卷积神经网络来预测股价的上涨、下跌和震荡的三种情况,使用准确率和科恩kappa系数来评估模型,实验结果表明在选取的十支股票上加入门控循环单元的循环神经网络GRU-RNN效果最佳,预测的平均准确率为82.7%,科恩kappa系数为0.663,体现出该模型在构建的多指标特征体系下能够有效提取时间序列型股票数据内在信息。为进一步优化最佳模型的预测结果我们使用卡方特征选择方法来简化特征空间,结果表明筛选后的特征预测效果进一步提升,是对于预测股价波动情况最关键的特征集合。
With the rapid development of deep learning technology and financial markets, stock investment has become an important way for people to obtain income. Stock trend forecasting refers to treating the data of daily closing prices over time as a time series, and predicting future trends based on the changing rules of historical transaction data. Inflation is the key, but the volatility of stock prices has strong randomness and instability. Studies have shown that traditional statistical and machine learning methods are difficult to dig out the deep-seated laws behind stock price fluctuations, and there are certain limitations that make the prediction effect poor. Therefore, it is necessary to train deep neural networks for prediction. In this article, we firstly compare and analyze the trend analysis methods of the domestic stock market. With the help of the financial data package Tushare, the data of dozens of Shanghai and Shenzhen 300 index constituent stocks are obtained and preprocessed, and the Python stock quantitative index library Stockstats and the technical analysis library TA are called to calculate various technical indicators to form a complete multi-indicator feature system. In the initial feature space, based on the cyclic neural network, feedforward neural network and convolutional neural network with gated recurrent units to predict the rise, fall and shock of the stock price, the accuracy and Cohen kappa coefficient are used to evaluate the model. The experimental results show that the recurrent neural network GRU-RNN with gated recurrent units added to the selected ten stocks has the best effect, the average prediction accuracy rate is 82.7%, and the Cohen kappa coefficient is 0.663, which reflects the multi-index construction of the model. Under the feature system, the intrinsic information of time series stock data can be effectively extracted. In order to further optimize the prediction results of the best model, we use the
[1] | Wold, H. (1938) A Study in the Analysis of Stationary Time Series. 2nd Edition, Almqristand Witsett, Stockhol. |
[2] | Adebiyi, A.A., Adewumi, A.O. and Ayo, C.K. (2014) Stock Price Prediction Using the ARIMA Model. 2014 UKSim-AMSS 16th International Conference on Computer Modelling and Simulation, Cambridge, 26-28 March 2014, 106-112. |
[3] | Bollerslev, T. (1986) Generalized Autoregressive Conditional Heteroskedasticity. Journal of Econometrics, 31, 307-327. https://doi.org/10.1016/0304-4076(86)90063-1 |
[4] | Kim, H.Y. and Won, C.H. (2018) Forecasting the Volatility of Stock Price Index: A Hybrid Model Integrating LSTM with Multiple GARCH-Type Models. Expert Systems with Applications, 103, 25-37.
https://doi.org/10.1016/j.eswa.2018.03.002 |
[5] | Lin, Y., Guo, H. and Hu, J. (2014) An SVM-Based Approach for Stock Market Trend Prediction. The 2013 International Joint Conference on Neural Networks (IJCNN), Dallas, 4-9 August 2013, 1-7. |
[6] | 孙若愚. 基于支持向量机的股票价格预测[D]: [硕士学位论文]. 大连: 大连理工大学, 2019. |
[7] | Mizuno, H., Kosaka, M., Yajima, H. and Komoda, N. (1998) Application of Neural Network to Technical Analysis of Stock Market Prediction. Studies in Informatic and Control, 7, 111-120. |
[8] | Kara, Y., Boyacioglu, M.A. and Baykan, ?.K. (2011) Predicting Direction of Stock Price Index Movement Using Artificial Neural Networks and Support Vector Machines: The Sample of the Istanbul Stock Exchange. Expert Systems with Applications, 38, 5311-5319. https://doi.org/10.1016/j.eswa.2010.10.027 |
[9] | Kumar, M. and Thenmozhi, M. (2006) Forecasting Stock Index Movement: A Comparison of Support Vector Machines and Random Forest. Social Science Electronic Publishing, New York. https://doi.org/10.2139/ssrn.876544 |
[10] | 伯毅. 基于XGBoost模型的短期股票预测[D]: [硕士学位论文]. 哈尔滨: 哈尔滨工业大学, 2018. |
[11] | Nelson, D., Pereira, A. and de Oliveira, R.A. (2017) Stock Market’s Price Movement Prediction with LSTM Neural Networks. 2017 International Joint Conference on Neural Networks (IJCNN), Anchorage, 14-19 May 2017, 1419-1426. https://doi.org/10.1109/IJCNN.2017.7966019 |
[12] | Wei, L. and Jian, L. (2018) A Comparative Study on Trend Forecasting Approach for Stock Price Time Series. 2017 11th IEEE International Conference on Anti-Counterfeiting, Security, and Identification (ASID), Xiamen, 27-29 October 2017, 74-78. |
[13] | Chen, W., Chai, K.Y., Lau, C.T. and Lee, B.S. (2018) Leveraging Social Media News to Predict Stock Index Movement Using RNN-Boost. Data & Knowledge Engineering, 118, 14-24. https://doi.org/10.1016/j.datak.2018.08.003 |
[14] | 黄丽明, 陈维政, 闫宏飞, 等. 基于循环神经网络和深度学习的股票预测方法[J]. 广西师范大学学报(自然科学版), 2019, 37(1): 13-22. |
[15] | 李勇. 基于深度神经网络的股票智能预测系统的设计与实现[D]: [硕士学位论文]. 西安: 西北大学, 2019. |
[16] | Nikou, M., Mansourfar, G. and Bagherzadeh, J. (2019) Stock Price Prediction Using Deep Learning Algorithm and Its Comparison with Machine Learning Algorithms. Intelligent Systems in Accounting, Finance and Management, 26, 164-174. https://doi.org/10.1002/isaf.1459 |
[17] | Hossain, M.A., Karim, R., Thulasiram, R., Bruce, N.D.B. and Wang, Y. (2019) Hybrid Deep Learning Model for Stock Price Prediction. 2018 IEEE Symposium Series on Computational Intelligence (SSCI), Bangalore, 18-21 November 2018, 1837-1844. https://doi.org/10.1109/SSCI.2018.8628641 |
[18] | Maqsood, H., Mehmood, I., Maqsood, M., et al. (2020) A Local and Global Event Sentiment Based Efficient Stock Exchange Forecasting Using Deep Learning. International Journal of Information Management, 50, 432-451.
https://doi.org/10.1016/j.ijinfomgt.2019.07.011 |
[19] | Hoseinzade, E. and Haratizadeh, S. (2019) CNNpred: CNN-Based Stock Market Prediction Using a Diverse Set of Variables. Expert Systems with Applications, 129, 273-285. https://doi.org/10.1016/j.eswa.2019.03.029 |
[20] | Selvin, S., Vinayakumar, R., Gopalakrishnan, E.A., et al. (2017) Stock Price Prediction Using LSTM, RNN and CNN-Sliding Window Model. 2017 International Conference on Advances in Computing, Communications and Informatics (ICACCI), Udupi, 13-16 September 2017, 1643-1647. |