IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v12y2024i7p945-d1362292.html
   My bibliography  Save this article

A Novel Variant of LSTM Stock Prediction Method Incorporating Attention Mechanism

Author

Listed:
  • Shuai Sang

    (School of Mathematics, Physics and Statistics, Shanghai University of Engineering Science, Shanghai 201620, China)

  • Lu Li

    (School of Mathematics, Physics and Statistics, Shanghai University of Engineering Science, Shanghai 201620, China)

Abstract

Long Short-Term Memory (LSTM) is an effective method for stock price prediction. However, due to the nonlinear and highly random nature of stock price fluctuations over time, LSTM exhibits poor stability and is prone to overfitting, resulting in low prediction accuracy. To address this issue, this paper proposes a novel variant of LSTM that couples the forget gate and input gate in the LSTM structure, and adds a “simple” forget gate to the long-term cell state. In order to enhance the generalization ability and robustness of the variant LSTM, the paper introduces an attention mechanism and combines it with the variant LSTM, presenting the Attention Mechanism Variant LSTM (AMV-LSTM) model along with the corresponding backpropagation algorithm. The parameters in AMV-LSTM are updated using the Adam gradient descent method. Experimental results demonstrate that the variant LSTM alleviates the instability and overfitting issues of LSTM, effectively improving prediction accuracy. AMV-LSTM further enhances accuracy compared to the variant LSTM, and compared to AM-LSTM, it exhibits superior generalization ability, accuracy, and convergence capability.

Suggested Citation

  • Shuai Sang & Lu Li, 2024. "A Novel Variant of LSTM Stock Prediction Method Incorporating Attention Mechanism," Mathematics, MDPI, vol. 12(7), pages 1-20, March.
  • Handle: RePEc:gam:jmathe:v:12:y:2024:i:7:p:945-:d:1362292
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/12/7/945/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/12/7/945/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Christian Janiesch & Patrick Zschech & Kai Heinrich, 2021. "Machine learning and deep learning," Electronic Markets, Springer;IIM University of St. Gallen, vol. 31(3), pages 685-695, September.
    2. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Zeeshan Ahmad & Shudi Bao & Meng Chen, 2024. "DeepONet-Inspired Architecture for Efficient Financial Time Series Prediction," Mathematics, MDPI, vol. 12(24), pages 1-27, December.

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Jen-Yu Lee & Tien-Thinh Nguyen & Hong-Giang Nguyen & Jen-Yao Lee, 2022. "Towards Predictive Crude Oil Purchase: A Case Study in the USA and Europe," Energies, MDPI, vol. 15(11), pages 1-15, May.
    2. Wei Dai & Yuan An & Wen Long, 2021. "Price change prediction of ultra high frequency financial data based on temporal convolutional network," Papers 2107.00261, arXiv.org.
    3. Kamaladdin Fataliyev & Aneesh Chivukula & Mukesh Prasad & Wei Liu, 2021. "Stock Market Analysis with Text Data: A Review," Papers 2106.12985, arXiv.org, revised Jul 2021.
    4. Mostafa Bigdeli & Mahsa Akbari, 2024. "Machine-learning-based Classification of Customers’ Behavioural Model in Instagram," Paradigm, , vol. 28(2), pages 223-240, December.
    5. Eduard Hartwich & Alexander Rieger & Johannes Sedlmeir & Dominik Jurek & Gilbert Fridgen, 2023. "Machine economies," Electronic Markets, Springer;IIM University of St. Gallen, vol. 33(1), pages 1-13, December.
    6. Sina Montazeri & Akram Mirzaeinia & Haseebullah Jumakhan & Amir Mirzaeinia, 2024. "CNN-DRL for Scalable Actions in Finance," Papers 2401.06179, arXiv.org.
    7. Najla Alharbi & Bashayer Alkalifah & Ghaida Alqarawi & Murad A. Rassam, 2024. "Countering Social Media Cybercrime Using Deep Learning: Instagram Fake Accounts Detection," Future Internet, MDPI, vol. 16(10), pages 1-22, October.
    8. Rad, Hossein & Low, Rand Kwong Yew & Miffre, Joëlle & Faff, Robert, 2023. "The commodity risk premium and neural networks," Journal of Empirical Finance, Elsevier, vol. 74(C).
    9. Rui Ma & Jia Wang & Wei Zhao & Hongjie Guo & Dongnan Dai & Yuliang Yun & Li Li & Fengqi Hao & Jinqiang Bai & Dexin Ma, 2022. "Identification of Maize Seed Varieties Using MobileNetV2 with Improved Attention Mechanism CBAM," Agriculture, MDPI, vol. 13(1), pages 1-16, December.
    10. Noura Metawa & Mohamemd I. Alghamdi & Ibrahim M. El-Hasnony & Mohamed Elhoseny, 2021. "Return Rate Prediction in Blockchain Financial Products Using Deep Learning," Sustainability, MDPI, vol. 13(21), pages 1-16, October.
    11. Kentaro Imajo & Kentaro Minami & Katsuya Ito & Kei Nakagawa, 2020. "Deep Portfolio Optimization via Distributional Prediction of Residual Factors," Papers 2012.07245, arXiv.org.
    12. James Wallbridge, 2020. "Transformers for Limit Order Books," Papers 2003.00130, arXiv.org.
    13. Burka, Dávid & Puppe, Clemens & Szepesváry, László & Tasnádi, Attila, 2022. "Voting: A machine learning approach," European Journal of Operational Research, Elsevier, vol. 299(3), pages 1003-1017.
    14. Chi Chen & Li Zhao & Wei Cao & Jiang Bian & Chunxiao Xing, 2020. "Trimming the Sail: A Second-order Learning Paradigm for Stock Prediction," Papers 2002.06878, arXiv.org.
    15. Dylan Norbert Gono & Herlina Napitupulu & Firdaniza, 2023. "Silver Price Forecasting Using Extreme Gradient Boosting (XGBoost) Method," Mathematics, MDPI, vol. 11(18), pages 1-15, September.
    16. Barua, Ronil & Sharma, Anil K., 2022. "Dynamic Black Litterman portfolios with views derived via CNN-BiLSTM predictions," Finance Research Letters, Elsevier, vol. 49(C).
    17. Cheng Yang & Fuhao Sun & Yujie Zou & Zhipeng Lv & Liang Xue & Chao Jiang & Shuangyu Liu & Bochao Zhao & Haoyang Cui, 2024. "A Survey of Photovoltaic Panel Overlay and Fault Detection Methods," Energies, MDPI, vol. 17(4), pages 1-37, February.
    18. Zhou, Hao & Kalev, Petko S., 2019. "Algorithmic and high frequency trading in Asia-Pacific, now and the future," Pacific-Basin Finance Journal, Elsevier, vol. 53(C), pages 186-207.
    19. Bartosz Bieganowski & Robert Ślepaczuk, 2024. "Supervised Autoencoder MLP for Financial Time Series Forecasting," Working Papers 2024-03, Faculty of Economic Sciences, University of Warsaw.
    20. Wang, Yijun & Andreeva, Galina & Martin-Barragan, Belen, 2023. "Machine learning approaches to forecasting cryptocurrency volatility: Considering internal and external determinants," International Review of Financial Analysis, Elsevier, vol. 90(C).

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:12:y:2024:i:7:p:945-:d:1362292. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.