Next Article in Journal
Three-Dimensional UAV Omnidirectional Path Planning Algorithm Based on Urban Obstacle Environment
Previous Article in Journal
Long Short-Term Memory Networks Since Their Inception: Mapping 25 Years of Scientific Development via Bibliometric Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Bayesian Deep Learning and Probabilistic Forecasting of Stock Prices

by
Ndivhuwo Nelufhangani
1 and
Daniel Maposa
2,*
1
School of Mathematical and Computer Sciences, University of Limpopo, Sovenga 0727, South Africa
2
Department of Statistics and Operations Research, University of Limpopo, Sovenga 0727, South Africa
*
Author to whom correspondence should be addressed.
Algorithms 2026, 19(5), 391; https://doi.org/10.3390/a19050391
Submission received: 13 March 2026 / Revised: 6 May 2026 / Accepted: 8 May 2026 / Published: 14 May 2026

Abstract

This study investigates the effectiveness of Bayesian probabilistic methods for stock price forecasting on the Johannesburg Stock Exchange by implementing and comparing Gaussian process regression (GPR), Bayesian long short-term memory (Bayesian LSTM), and Bayesian neural networks (BNNs). Using daily open, high, low, close, and volume (OHLCV) data and engineered technical indicators for FirstRand and Discovery from January 2005 to June 2025 (5187 observations), models were trained and evaluated with the mean absolute error (MAE), root mean squared error (RMSE), and mean squared error (MSE). The GPR produced reliable, well-calibrated intervals in relatively stable regimes, but its performance degraded on the more volatile Discovery series. Bayesian LSTM delivered conservative uncertainty estimates with wide predictive intervals but showed the largest point forecast errors. The BNNs achieved the best balance between accuracy and uncertainty quantification, producing the lowest errors for FirstRand and competitive performance for Discovery. Comparative analysis indicates that BNNs are most suitable when point accuracy and calibrated uncertainty are both priorities, GPR is valuable for smaller or more stable data regimes, and Bayesian LSTM is preferable where conservative, risk-conscious intervals are required. This study highlights the practical value of embedding uncertainty into financial forecasts and recommends matching Bayesian model choice to market volatility, data availability, and decision maker risk appetite.
Keywords: Bayesian LSTM; Bayesian neural networks; deep learning; financial forecasting; Gaussian process regression; Johannesburg Stock Exchange; predictive modeling; time series analysis; uncertainty quantification Bayesian LSTM; Bayesian neural networks; deep learning; financial forecasting; Gaussian process regression; Johannesburg Stock Exchange; predictive modeling; time series analysis; uncertainty quantification

Share and Cite

MDPI and ACS Style

Nelufhangani, N.; Maposa, D. Bayesian Deep Learning and Probabilistic Forecasting of Stock Prices. Algorithms 2026, 19, 391. https://doi.org/10.3390/a19050391

AMA Style

Nelufhangani N, Maposa D. Bayesian Deep Learning and Probabilistic Forecasting of Stock Prices. Algorithms. 2026; 19(5):391. https://doi.org/10.3390/a19050391

Chicago/Turabian Style

Nelufhangani, Ndivhuwo, and Daniel Maposa. 2026. "Bayesian Deep Learning and Probabilistic Forecasting of Stock Prices" Algorithms 19, no. 5: 391. https://doi.org/10.3390/a19050391

APA Style

Nelufhangani, N., & Maposa, D. (2026). Bayesian Deep Learning and Probabilistic Forecasting of Stock Prices. Algorithms, 19(5), 391. https://doi.org/10.3390/a19050391

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop