高级检索

  • ISSN 1006-3080
  • CN 31-1691/TQ

基于改进粒子群算法的LSTM股票预测模型

黄建华 钟敏 胡庆春

黄建华, 钟敏, 胡庆春. 基于改进粒子群算法的LSTM股票预测模型[J]. 华东理工大学学报(自然科学版). doi: 10.14135/j.cnki.1006-3080.20210616001
引用本文: 黄建华, 钟敏, 胡庆春. 基于改进粒子群算法的LSTM股票预测模型[J]. 华东理工大学学报(自然科学版). doi: 10.14135/j.cnki.1006-3080.20210616001
HUANG Jianhua, ZHONG Min, HU Qingchun. LSTM Stock Prediction Model Based on Improved Particle Swarm Optimization[J]. Journal of East China University of Science and Technology. doi: 10.14135/j.cnki.1006-3080.20210616001
Citation: HUANG Jianhua, ZHONG Min, HU Qingchun. LSTM Stock Prediction Model Based on Improved Particle Swarm Optimization[J]. Journal of East China University of Science and Technology. doi: 10.14135/j.cnki.1006-3080.20210616001

基于改进粒子群算法的LSTM股票预测模型

doi: 10.14135/j.cnki.1006-3080.20210616001
基金项目: 国家高技术研究发展计划(SS2015AA020107)
详细信息
    作者简介:

    黄建华(1963 − ),男,上海人,博士,副教授,主要研究方向为计算机网络、信息安全、区块链技术。E-mail:jhhuang@ecust.edu.cn

    通讯作者:

    钟 敏, E-mail:1452958315@qq.com

  • 中图分类号: TP391

LSTM Stock Prediction Model Based on Improved Particle Swarm Optimization

  • 摘要: 针对LSTM网络中存在的重要参数通常由经验决定、主观性强、或受计算成本影响无法确定最优值,导致模型的拟合能力降低等问题,提出使用改进的粒子群算法优化LSTM网络中的关键参数,减少人为因素影响,优化预测过程,从而构建预测精度更高的股票价格预测模型。该模型通过构建动态多群粒子群优化器来提高PSO算法的寻优性能,避免出现局部最优。同时,针对股票市场数据维度高、噪声大及数据冗余导致模型训练成本增大、预测性能降低的问题,基于多种特征选择算法构建特征选择模型完成指标特征的过滤筛选,构建完善的预测指标体系。实验结果证明,所提出的股票价格预测模型的准确率得到了明显的提高,且具有普遍适用性。

     

  • 图  1  LSTM网络单元结构

    Figure  1.  LSTM network structure

    图  2  特征选择模型工作流程

    Figure  2.  Workflow of feature selection model

    图  3  动态子群构建过程

    Figure  3.  Construction process of dynamic subgroups

    图  4  改进的LSTM预测模型

    Figure  4.  Improved LSTM prediction model

    图  5  DMPSO寻优迭代过程

    Figure  5.  Optimization iterative process of DMPSO

    图  6  各模型对上证指数的预测结果

    Figure  6.  Forecast results of each models to Shanghai component index

    图  7  各模型对深证成指的预测结果

    Figure  7.  Forecast results of each models to o Shenzhen component index

    表  1  股票价格预测指标

    Table  1.   Stock price prediction index

    CategoryPredictor
    Trading indicatorspreclosePrice, openPrice, highestPrice, lowestPrice, closePrice, Rf, Applies, turnoverVol, chgPct, Amplitude
    Market
    indicator
    CSI 300
    Technical indicatorVolume type: AD, OBV
    Overbought and oversold: ATR, ROC, RSI
    Trending: MA, MACD, TRIX, ADX, Aroon
    下载: 导出CSV

    表  2  指标重要度(上证指数000001.SH)

    Table  2.   The importance of indexs(Shanghai component index)

    IndicatorCorrImportanceLassoImportanceMICImportanceRFImportanceRFEImportance
    preclosePrice0.55M0W0.95S0.78S0.68S
    openPrice0.39M0W0.98S0.82S0.75S
    highestPrice0.68S0.46M0.97S0.54M0.71S
    lowestPrice0.72S0.37M1S0.84S0.90S
    closePrice1.00S1S1S0.97S0.95S
    Rf0.02W0W0.35M0.33M0.17W
    Applies0W0W0.05W0.39M0.32W
    turnoverVol0.05W0W0.36M0.82S0.54M
    chgPct0W0W0.44M0.93S1S
    Amplitude0.34M0.04W0.55M0.39M0.32W
    AD60W0W0.94S0.35M0.37M
    AD200.12W0W0.96S1S0.44M
    OBV60W0W0.82S0.25W0.12W
    ATR60.05W0W0.86S0.38M0.90S
    ATR140.03W0W0.46M0.36M0.92S
    ROC60W0W0.43M0.35M0.37M
    ROC200.15W0.01W0.36M0.73S0.47M
    RSI0W0W0.14W0.55M0.37M
    MA1200.08W0W0.76S0.69S0.67S
    MACD0W0W0.35M0.70S0.72S
    TRIX50.19W0.02W0.58M0.66M0.85S
    ADX0.14W0W0.75S0.09W0.50M
    Aroon0.10W0W0.41M0.19W0.38M
    下载: 导出CSV

    表  3  指标重要度(深证成指399001.SZ)

    Table  3.   The importance of indexs (Shenzhen component index)

    IndicatorCorrImportanceLassoImportanceMICImportanceRFImportanceRFEImportance
    preclosePrice0.62M0.18W0.90S0.77S0.65M
    openPrice0.22W0.01W0.93S0.69S0.72S
    highestPrice0.63M0.47S0.99S0.51M0.79S
    lowestPrice0.88S0.39S0.99S0.81S0.82S
    closePrice1.00S1S1S0.99S0.91S
    Rf0.01W0W0.37M0.44M0.39M
    Applies0.02W0W0.05W0.39M0.34M
    turnoverVol0.02W0W0.33M0.75S0.66M
    chgPct0W0W0.40M0.89S0.94S
    Amplitude0.31W0W0.49M0.51M0.33M
    AD60W0W0.93S0.45M0.42M
    AD200.07W0W0.90S0.99S0.34M
    OBV60W0W0.73S0.33M0.23W
    ATR60W0W0.66M0.57M0.94S
    ATR140.05W0.01W0.55S0.46M0.87S
    ROC60W0W0.38S0.45M0.27W
    ROC200.09W0W0.53S0.60M0.49M
    RSI0.01W0.02W0.17W0.45M0.32W
    MA1200.02W0W0.56M0.62M0.57M
    MACD0W0W0.35M0.68S0.80S
    TRIX50.21W0.13W0.47M0.58M0.87S
    ADX0.19W0W0.70S0.39M0.44M
    Aroon0W0W0.59M0.22W0.31W
    下载: 导出CSV

    表  4  PSO与DMPSO寻优结果

    Table  4.   Optimization results of PSO and DMPSO

    FunctionAlgorithmBest fitnessMiniAverageVariance
    f1PSO0.01288.14×10−90.002757.72x10−5
    DMPSO0.00211.61×10−61.62×10−0.26.65×10−7
    f2PSO3.260.00160.091290.00863
    DMPSO2.588.14×10−30.003124.69x10−8
    f3PSO−0.800370.0130.028420.01927
    DMPSO−0.980527.64x10−0.20.006273.32x10−6
    下载: 导出CSV

    表  5  各模型的评估结果(上证指数)

    Table  5.   Evaluation results of models(Shanghai component index)

    ModelRMSEMAPEMAER2
    SVM45.32430.012535.19270.8609
    RF43.39690.012032.11780.8860
    RNN43.47050.010834.19010.8986
    LSTM40.01700.009929.00870.9165
    PSO-LSTM38.50190.009427.90210.9183
    DMPSO-LSTM35.92140.006725.33740.9315
    下载: 导出CSV

    表  6  各模型评估结果(深证成指)

    Table  6.   Evaluation results of models(Shenzhen component index)

    ModelRMSEMAPEMAER2
    SVM399.45160.0462239.70210.9179
    RF221.71860.0159177.04260.9368
    RNN200.43260.0146150.89100.9519
    LSTM213.91640.0140145.42610.9586
    PSO-LSTM179.55630.0107130.57390.9619
    DMPSO-LSTM160.37160.0081118.79570.9705
    下载: 导出CSV
  • [1] GRANGER C W J. The random character of stock market prices[J]. Journal of the American Statistical Association, 1965, 128(3): 447-449.
    [2] BAEK Y, KIM H Y. ModAugNet: A new forecasting framework for stock market index value with an overfitting prevention LSTM module and a prediction LSTM module[J]. Expert Systems with Applications, 2018, 113: 457-480.
    [3] CHATZIS S P, SIAKOULIS V, PETROPOULOS A, et al. Forecasting stock market crisis events using deep and statistical machine learning techniques[J]. Expert Systems with Applications, 2018, 112: 353-371. doi: 10.1016/j.eswa.2018.06.032
    [4] CHEN Y, HAO Y. A feature weighted support vector machine and K-nearest neighbor algorithm for stock market indices prediction[J]. Expert Systems with Applications, 2017, 80: 340-355. doi: 10.1016/j.eswa.2017.02.044
    [5] WENG B, LIN L, XING W, et al. Predicting short-term stock prices using ensemble methods and online data sources[J]. Expert Systems with Applications, 2018, 112: 258-273.
    [6] KIM H Y, WON C H. Forecasting the volatility of stock price index: A hybrid model integrating LSTM with multiple GARCH-Type models[J]. Expert Systems with Applications, 2018, 103: 25-37.
    [7] HOCHREITER S, SCHMIDHUBER J. Long short-term memory[J]. Neural Computation, 1997, 9(8): 1735-1780. doi: 10.1162/neco.1997.9.8.1735
    [8] CHEN K , ZHOU Y , DAI F . A LSTM-based method for stock returns prediction: A case study of China stock market[C]// IEEE International Conference on Big Data. USA: IEEE, 2015: 2823-2824.
    [9] FISCHER T, KRAUSS C. Deep learning with long short-term memory networks for financial market predictions[J]. European Journal of Operational Research, 2017, 270(2): 654-669.
    [10] XIONG YC, ZHAO H. Chaotic time series prediction based on long short-term memory neural networks[J]. Scientia Sinica(Physica, Mechanica & Astronomica), 2019, 49(12): 120501.
    [11] MUnlin M , ANANTATHANAVIT M . New social-based radius particle swarm optimization[C]// 2017 12th IEEE Conference on Industrial Electronics and Applications (ICIEA). USA: IEEE, 2017: 838-843.
    [12] SHAO B, LI M, ZHAO Y, et al. Nickel price forecast based on the LSTM neural network optimized by the improved PSO algorithm[J]. Mathematical Problems in Engineering, 2019(2): 1-15.
    [13] YUAN X, CHEN C, JIANG M, et al. Prediction interval of wind power using parameter optimized Beta distribution based LSTM model[J]. Applied Soft Computing, 2019, 82: 105550. doi: 10.1016/j.asoc.2019.105550
    [14] CHUN H, SHIN K S. Genetic algorithm-optimized long short-term memory network for stock market prediction[J]. Sustainability, 2018, 10: 1-18. doi: 10.3390/su10020001
    [15] CHANG Z, ZHANG Y, CHEN W. Electricity price prediction based on hybrid model of adam optimized LSTM neural network and wavelet transform[J]. Energy, 2019, 187: 115804. doi: 10.1016/j.energy.2019.07.134
    [16] FREUND Y, SEUNG H S, SHAMIR E, et al. Selective sampling using the query by committee algorithm[J]. Machine Learning, 1997, 28(2/3): 133-168. doi: 10.1023/A:1007330508534
    [17] RAJESH K S, DASH S S. Load frequency control of autonomous power system using adaptive fuzzy based PID controller optimized on improved sine cosine algorithm[J]. Journal of Ambient Intelligence and Humanized Computing, 2019, 10(6): 2361-2373. doi: 10.1007/s12652-018-0834-z
    [18] JIANG J G, TIAN M, WANG X Q, et al. Adaptive particle swarm optimization via disturbing acceleration coefficents[J]. Journal of Xidian University, 2012, 39(4): 74-80.
    [19] PANT M , THANGARAJ R , ABRAHAM A . Particle swarm optimization using adaptive mutation[C]// 2008 19th International Workshop on Database and Expert Systems Applications. Italy : IEEE, 2008: 519-523.
    [20] 龙文, 梁昔明, 董淑华, 等. 动态调整惯性权重的粒子群优化算法[J]. 计算机应用, 2009, 29(8): 2240-2242.
    [21] SHI Y , EBERHART R . A modified particle swarm optimizer[C]// 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence. USA: IEEE, 1998: 69-73.
    [22] 任君, 王建华, 王传美, 等. 基于正则化LSTM模型的股票指数预测[J]. 计算机应用与软件, 2018, 35(4): 44-48,108. doi: 10.3969/j.issn.1000-386x.2018.04.008
    [23] HUANG X, ZHANG J, ZHAN Z H. Faster particle swarm optimization with random inertia weight[J]. Computer Engineering and Design, 2009, 30(3): 647-650.
    [24] LIANG J J , SUGANTHAN P N . Dynamic multi-swarm particle swarm optimizer[C]//Proceedings 2005 IEEE Swarm Intelligence Symposium. USA: IEEE, 2005: 124-129.
  • 加载中
图(7) / 表(6)
计量
  • 文章访问数:  5
  • HTML全文浏览量:  1
  • PDF下载量:  1
  • 被引次数: 0
出版历程
  • 收稿日期:  2021-06-16
  • 网络出版日期:  2021-10-12

目录

    /

    返回文章
    返回