Skip to main content

A Hybrid Model for Forecasting Stock Prices Using Bayesian and LSTM

  • Conference paper
  • First Online:
Intelligent Data Engineering and Analytics (FICTA 2023)

Abstract

Forecasting stock price and intraday direction is the main problem in the area of Quantitative Finance. This paper explores the efficacy of Bayesian Long Short-Term Memory Neural Network Model (to be precise LSTM + BNN) in price forecasting. Performance was tested against ML models like Random Forest, XGBoost, and Vanilla LSTM. Public data on Indian stocks of five companies Reliance, Dr Reddy, Dmart, TCS and Hindunilvr is collected from YahooFinance. Performance of the proposed model is measured using root mean square error and mean absolute error. The model is deployed through a webapp, which displays the predictions for stocks along with statistical metrics such as level of confidence and uncertainty with respect to the predictions. Objective of the proposed research is to create a hybrid model B-LSTM and compare the result with existing models which outperforms with low error rate.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 229.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 299.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Hochreiter, S., Schmidhuber, J.: Long short_term memory (1997)

    Google Scholar 

  2. Blundell, C., Comebise, J., Kavukcuoglu, K., Wierstra, D.: Weight Uncertainty in Neural Networks (2015)

    Google Scholar 

  3. Chandra, R., He, Y.: Bayesian neural networks for stock price forecasting before and during COVID-19 pandemic (2021)

    Google Scholar 

  4. Mehtab, S., Sen, J., Dutta, A.: Stock Price Prediction Using Machine Learning and LSTM-Based Deep Learning Models (2020). arXiv

    Google Scholar 

  5. Singh, G.: Machine Learning Models in Stock Market Prediction (2022)

    Google Scholar 

  6. Chen, T., Guestrin, C.: XGBoost: A Scalable Tree Boosting System (2016). arXiv

    Google Scholar 

  7. Breiman, L.: Random forests. Mach. Learn. (2001)

    Google Scholar 

  8. Vijh, M., Chandola, D., Tikkiwal, V.A., Kumar, A.: Stock closing price prediction using machine learning techniques (2020)

    Google Scholar 

  9. Ghoush, P., Neufeld, A., Sahoo, J.K.: Forecasting directional movements of stock prices for intraday trading using LSTM and random forests (2021)

    Google Scholar 

  10. Orsel, O.E., Yamada, S.S.: Comparative study of machine learning models for stock price prediction (2022)

    Google Scholar 

  11. Wei, D.: Prediction of stock price based on LSTM neural network (2019)

    Google Scholar 

  12. Gumelar, A.B., Setyorini, D. P. Adi, S. Nilowardno, L. A. Widodo, A. T. Wibowo, M. T. Sulistyono and E. Christine, Boosting the Accuracy of Stock Market Prediction using XGBoost and Long Short-Term Memory, 2020.

    Google Scholar 

  13. J. R. Quinlan, Introduction of decision trees, Machine Learning, 1986.

    Google Scholar 

  14. L. v. Jospin, H. Laga, F. Boussaid, W. Buntine and M. Bennamoun, Hands-on Bayesian Neural Networks - A Tutorial for Deep Learning Users, arXiv, 2022.

    Google Scholar 

  15. D. P. Kingma and J. Ba, Adam: A Method for Stochastic Optimization, arXiv, 2014.

    Google Scholar 

  16. H. Waghmare, “Review on Frameworks Used for Deployment of Machine Learning Model,” Ijraset Journal For Research in Applied Science and Engineering Technology, 2022

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rohini Pinapatruni .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Pinapatruni, R., Mohammed, F., Mohiuddin, S.A., Patel, D. (2023). A Hybrid Model for Forecasting Stock Prices Using Bayesian and LSTM. In: Bhateja, V., Carroll, F., Tavares, J.M.R.S., Sengar, S.S., Peer, P. (eds) Intelligent Data Engineering and Analytics. FICTA 2023. Smart Innovation, Systems and Technologies, vol 371. Springer, Singapore. https://doi.org/10.1007/978-981-99-6706-3_55

Download citation

Publish with us

Policies and ethics