Bayesian Networks for predicting Stock Values: Applying K2 and PC Algorithms

Authors

  • Túlio 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

Keywords:

Aprendizado de máquina, redes Bayesianas, mercado de ações

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 `as 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). Introduc¸ ˜ao `a inferˆencia bayesiana. URL: http://www. leg. ufpr. br/%7Epaulojus/CE227/ce227. pdf.

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˜ao, 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˜ao 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˜ao na Tarefa de Classificac¸ ˜ao. PhD thesis, Universidade Federal do Rio de Janeiro.

Santos, G. C. (2020). Algoritmos de machine learning para previs˜ao da b3. Master’s thesis, Universidade Federal de Uberlˆandia.

Silveira J´unior, L. G. Q. (2003). Uma aplicac¸ ˜ao de redes bayesianas no aux´ılio `a tomada de decis˜oes m´edicas. Master’s thesis, UFCG.

Souza, A. L. A. (2010). Redes bayesianas: Uma introduc¸ ˜ao aplicada a credit scoring. S˜ao 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

de Sousa Castro, T., & Batista dos Santos, E. (2023). Bayesian Networks for predicting Stock Values: Applying K2 and PC Algorithms. Eletronic Journal of Undergraduate Research on Computing, 21(1). Retrieved from https://journals-sol.sbc.org.br/index.php/reic/article/view/2344

Issue

Section

Full Papers