Bayesian Networks for Stock Value Prediction: Applying the K2 and PC Algorithms

Authors

  • Tulio de Sousa Castro Universidade Federal de São João del-Rei
  • Edimilson Batista dos Santos Universidade Federal de São João del-Rei

DOI:

https://doi.org/10.5753/reic.2023.2344

Keywords:

Machine learning, Bayesian networks, Stock market

Abstract

Aiming to support the investors' decisions in stock market, in this paper, the application of Bayesian networks for stock market value prediction is proposed. The applied data were obtained through the Yahoo! Finance and they included daily quotations from Petrobras, Telefonica Brasil and Embraer between 02/01/2020 and 11/27/2020. The learning of the Bayesian networks was carried out by the PC and K2 algorithms. For the inference, the exact Lauritzen algorithm was used, which generated good results, with hits of up to 94%, obtaining an average hit rate of 73.66% for the network induced by the PC algorithm and 70.8% for the network induced by K2. Thus, the proposal is promising and manages to satisfactorily forecast the stock price.

Downloads

Download data is not yet available.

References

Cooper, G. and Herskovits, E. (1992). A bayesian method for the induction of probabilistic networks from data. Machine learning, (4):309–347.

Correia, J. I. N. (2019). Uma introdução às redes bayesianas. Master’s thesis, Universidade da Madeira.

Edwards, R., Bassetti, W., and Magee, J. (2012). Technical Analysis of Stock Trends, page 4. Technical Analysis of Stock Trends. Taylor & Francis.

Ehlers, R. S. (2003). Introdução à inferência bayesiana. URL: [link].

Lauritzen, S. L. and Spiegelhalter, D. J. (1988). Local computations with probabilities on graphical structures and their application to expert systems. Journal of the Royal Statistical Society. Series B (Methodological), 50(2):157–224.

Malagrino, L. S., Roman, N. T., and Monteiro, A. M. (2018). Forecasting stock market index daily direction: A bayesian network approach. Expert Systems with Applications, 105:11–22.

Marques, R. L. and Dutra, I. (2002). Redes bayesianas: o que são, para que servem, algoritmos e exemplos de aplicações. Coppe Sistemas–Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brasil.

Neapolitan, R. E. et al. (2004). Learning bayesian networks, volume 38. Pearson Prentice Hall Upper Saddle River, NJ.

Queiroz, C. D. N. (2008). Redes Bayesianas no gerenciamento e mensuração de riscos operacionais. PhD thesis, Universidade de São Paulo.

Saffi, P. A. C. (2003). Análise técnica: sorte ou realidade? Revista Brasileira de Economia, 57:953 – 974.

Santos, E. B. (2011). Aprendizado Indutivo de Redes Bayesianas: Além da Precisão na Tarefa de Classificação. PhD thesis, Universidade Federal do Rio de Janeiro.

Santos, G. C. (2020). Algoritmos de machine learning para previsão da b3. Master’s thesis, Universidade Federal de Uberlândia.

Silveira Júnior, L. G. Q. (2003). Uma aplicação de redes bayesianas no auxílio à tomada de decisões médicas. Master’s thesis, UFCG.

Souza, A. L. A. (2010). Redes bayesianas: Uma introdução aplicada a credit scoring. São Carlos, SP.

Spirtes, P., Glymour, C., and Scheines, R. (2000). Causation, Prediction, and Search. MIT press, 2nd edition.

Tabassum, P. and Halder, M. (2018). Stock price forecasting using bayesian network.

Published

2023-05-29

How to Cite

Castro, T. de S., & Batista dos Santos, E. (2023). Bayesian Networks for Stock Value Prediction: Applying the K2 and PC Algorithms. Electronic Journal of Undergraduate Research on Computing, 21(1), 36–43. https://doi.org/10.5753/reic.2023.2344

Issue

Section

Full Papers