Prediction of Stock Prices Using Ensemble Models

Authors

  • Cláudio Estevam Leite da Silva Universidade Federal de Alfenas
  • Ricardo Menezes Salgado universidade Federal de Alfenas

DOI:

https://doi.org/10.22456/2175-2745.136072

Keywords:

Machine Learning, Financial Market, Price Prediction, Ensemble Modeling

Abstract

The financial market encompasses a set of institutions, products, and services aimed at meeting the financial needs of individuals, companies, and governments. Its primary objective is to direct financial resources from investors to projects requiring funding. This is achieved through the issuance and trading of securities such as stocks, debt securities, among others. In this paper, the goal was to develop a machine learning application specifically for the Brazilian financial market, focusing on predicting the market value of eight companies that are representative of the financial sector on the stock exchange. The prediction is based on the closing price history and uses data from the last three years, with the inputs corresponding to the last 60 days immediately preceding the forecast date. For this task, three machine learning models were selected: Long Short-Term Memory (LSTM), Multilayer Perceptron (MLP), and Convolutional Neural Network (CNN). Each of these was fine-tuned using five different optimizers, resulting in a total of 15 models. Subsequently, all 15 models were combined into an Ensemble. After applying data transformations, the models achieved a satisfactory level of error for the analysis. Among the transformations used, the logarithmic transformation stood out as the one that resulted in the most well-adjusted models compared to the others. In second place, the Yeo-Johnson transformation showed slightly higher error but performed better on series with high variation. Additionally, the convolutional models and Ensemble were the most effective.

Downloads

Download data is not yet available.

References

BRADSHAW, L. Big Data and What it Means. Disponível em: ⟨https://www.uschamberfoundation.org/sites/default/files/article/foundation/BigData.pdf⟩.

CUKIER, K. Big data: A revolution that will transform how we live, work, and think. [S.l.]: Houghton Mifflin Harcourt, 2013.

GALVÃO, A. Mercado financeiro: Uma Abordagem Prática dos Principais Produtos e Serviços. [S.l.]: Elsevier, 2006.

FERREIRA, F. G.; GANDOMI, A. H.; CARDOSO, R. T. Artificial intelligence applied to stock market trading: a review. IEEE Access, IEEE, v. 9, p. 30898–30917, 2021.

VIJH, M. et al. Stock closing price prediction using machine learning techniques. Procedia computer science, Elsevier, v. 167, p. 599–606, 2020.

YU, P.; YAN, X. Stock price prediction based on deep neural networks. Neural Computing and Applications, Springer, v. 32, p. 1609–1628, 2020.

CHANDAR, S. K. Convolutional neural network for stock trading using technical indicators. Automated Software Engineering, Springer, v. 29, p. 1–14, 2022.

B3. Institucional. 2023. https://www.b3.com.br/pt_br/b3/institucional/.

MISHKIN, F. S.; EAKINS, S. G. Financial markets. [S.l.]: Pearson Italia, 2019.

FAMA, E. F. Efficient capital markets: A review of theory and empirical work. The journal of Finance, JSTOR, v. 25, n. 2, p. 383–417, 1970.

FAMA, E. F. Efficient capital markets: Ii. The journal of finance, Wiley Online Library, v. 46, n. 5, p. 1575–1617, 1991.

CHEN, Y.-S.; CHENG, C.-H.; TSAI, W.-L. Modeling fitting-function-based fuzzy time series patterns for evolving stock index forecasting. Applied intelligence, Springer, v. 41, n. 2, p. 327–347, 2014.

CAVALCANTE, R. C. et al. Computational intelligence and financial markets: A survey and future directions. Expert Systems with Applications, Elsevier, v. 55, p. 194–211, 2016.

BASTOS, E.; BORTOLON, P.; MAIA, V. Fundamentalist signals in volatility scenarios: Evidence in the Brazilian stock market. BBR. Brazilian Business Review, SciELO Brasil, v. 17, p. 621–639, 2021.

JANIESCH, C.; ZSCHECH, P.; HEINRICH, K. Machine learning and deep learning. Electronic Markets, Springer, v. 31, n. 3, p. 685–695, 2021.

GOODFELLOW, I.; BENGIO, Y.; COURVILLE, A. Deep Learning Book, 2018. 2020.

SEZER, O. B.; GUDELEK, M. U.; OZBAYOGLU, A. M. Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied soft computing, Elsevier, v. 90, p. 106181, 2020.

TIWARI, S.; RAMAMPIARO, H.; LANGSETH, H. Machine learning in financial market surveillance: A survey. IEEE Access, IEEE, 2021.

POONGODI, M. et al. Prediction of the price of ethereum blockchain cryptocurrency in an industrial finance system. Computers & Electrical Engineering, Elsevier, v. 81, p. 106527, 2020.

RYLL, L.; SEIDENS, S. Evaluating the performance of machine learning algorithms in financial market forecasting: A comprehensive survey. arXiv preprint arXiv:1906.07786, 2019.

ARRATIA, A. et al. Sentiment analysis of financial news: Mechanics and statistics. In: Data Science for Economics and Finance. [S.l.]: Springer, Cham, 2021. p. 195–216.

LI, X.; WU, P.; WANG, W. Incorporating stock prices and news sentiments for stock market prediction: A case of Hong Kong. Information Processing & Management, Elsevier, v. 57, n. 5, p. 102212, 2020.

GERON, A. Hands-on machine learning with Scikit-Learn, Keras, and TensorFlow. [S.l.: s.n.], 2021. v. 2ª Edição.

HAYKIN, S. Redes neurais: princípios e prática. [S.l.]: Bookman Editora, 2001.

RUDER, S. An overview of gradient descent optimization algorithms. arXiv preprint arXiv:1609.04747, 2016.

SILVA, I. da; FLAUZINO, R.; SPATTI, D. Redes neurais artificiais para engenharia. Artliber.–São Paulo, 2011.

HOUDT, G. V.; MOSQUERA, C.; NAPOLES, G. A review on the long short-term memory model. Artificial Intelligence Review, Springer, v. 53, n. 8, p. 5929–5955, 2020.

WEICHERT, D. et al. A review of machine learning for the optimization of production processes. The International Journal of Advanced Manufacturing Technology, Springer, v. 104, n. 5, p. 1889–1902, 2019.

LILLICRAP, T. P.; SANTORO, A. Backpropagation through time and the brain. Current opinion in neurobiology, Elsevier, v. 55, p. 82–89, 2019.

LI, Z. et al. Overfitting or underfitting? understand robustness drop in adversarial training. arXiv preprint arXiv:2010.08034, 2020.

MITCHELL, T. M. Machine learning. [S.l.]: McGraw-Hill New York, 1997. v. 1.

MURPHY, K. P. Machine learning: a probabilistic perspective. [S.l.]: MIT press, 2012.

CHEN, Z.; LI, C.; SUN, W. Bitcoin price prediction using machine learning: An approach to sample dimension engineering. Journal of Computational and Applied Mathematics, Elsevier, v. 365, p. 112395, 2020.

RAMCHOUN, H. et al. Multilayer perceptron: Architecture optimization and training. International Journal of Interactive Multimedia and Artificial Intelligence, 2016.

SHERSTINSKY, A. Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Physica D: Nonlinear Phenomena, Elsevier, v. 404, p. 132306, 2020.

KIRANYAZ, S. et al. 1d convolutional neural networks and applications: A survey. Mechanical systems and signal processing, Elsevier, v. 151, p. 107398, 2021.

RUDER, S. An overview of gradient descent optimization algorithms. arXiv preprint arXiv:1609.04747, 2016.

KINGMA, D. P.; BA, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.

TIELEMAN, T.; HINTON, G. Divide the gradient by a running average of its recent magnitude. coursera: Neural networks for machine learning. Technical report, 2017.

DUCHI, J.; HAZAN, E.; SINGER, Y. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, v. 12, n. 7, 2011.

B3. Índice Bovespa (Ibovespa B3). 2023. https://www.b3.com.br/pt_br/market-data-eindices/indices/indices-amplos/indice-ibovespaibovespa-composicao-da-carteira.htm.

MORETTIN, P. A.; BUSSAB, W. O. Estatística básica. [S.l.]: Saraiva Educação SA, 2017.

EVERITT, B. S.; HOWELL, D. C. Encyclopedia of Statistics in Behavioral Science. [S.l.]: John Wiley & Sons, Ltd, 2021. v. 1.

CORNELL, B. ESG preferences, risk and return. European Financial Management, Wiley Online Library, v. 27, n. 1, p. 12–19, 2021.

BOYD, J. H.; GRAHAM, S. L. et al. Risk, regulation, and bank holding company expansion into nonbanking. Quarterly Review, Federal Reserve Bank of Minneapolis, v. 10, n. Spr, p. 2–17, 1986.

HYNDMAN, R. J.; ATHANASOPOULOS, G. Forecasting: principles and practice. [S.l.]: OTexts, 2018.

Downloads

Published

2024-09-04

How to Cite

Estevam Leite da Silva, C., & Menezes Salgado, R. (2024). Prediction of Stock Prices Using Ensemble Models. Revista De Informática Teórica E Aplicada, 31(2), 147–160. https://doi.org/10.22456/2175-2745.136072

Issue

Section

Regular Papers
Received 2023-10-09
Accepted 2024-07-20
Published 2024-09-04

Similar Articles

1 2 3 4 5 > >> 

You may also start an advanced similarity search for this article.