Algoritmo Random Forest para Previsão de Comportamento de Preços de Ativos / Random Forest Algorithm for Predicting Asset Price Behavior

Ewerton Alex Avelar, Victor Antunes Leocádio, Octávio Valente Campos, Priscila Oliveira Ferreira, Jacqueline Braga Paiva Orefici

Resumen


A pesquisa apresentada neste artigo analisou o desempenho do algoritmo random forest na previsão do retorno futuro dos principais índices das maiores bolsas de valores do mundo, por meio de preços históricos de negociação. Utilizou-se uma amostra composta pelas cotações diárias de 35 índices das maiores bolsas de valores do mundo, no período de 2001 a 2019. Além do algoritmo random forest, foram estimados modelos com base no algoritmo árvore de decisão e empregando a técnica de regressão logística. Os modelos foram estimados considerando-se os preços máximos e de fechamento, assim como o período completo e a sua divisão em subperíodos. Os resultados indicaram que os desempenhos dos modelos estimados foram superiores à média de mercado, sendo que o random forest apresentou os melhores resultados. Todos os modelos treinados com base nos preços máximos dos índices tiveram desempenho superior aos treinados com preços de fechamento. Além disso, os modelos de subperíodos apresentaram melhores desempenhos para o random forest. A eficiência dos mercados na forma fraca foi questionada em contexto contemporâneo da ascensão do uso de algoritmos de inteligência artificial (IA) para previsão em finanças. O estudo é relevante, pois contribui para a literatura de uso de algoritmos de IA na previsão de preços de ativos no mercado financeiro. Os principais índices das maiores bolsas de valores do mundo foram analisados, gerando subsídios gerais que podem auxiliar na orientação de pesquisas futuras na área.

 

Palavras-chave: Random Forest. Inteligência Artificial (IA). Previsão de Preços. Hipótese de Mercados Eficientes (HME). Bolsa de Valores.

 

ABSTRACT

The research presented in this article analyzed the performance of the random forest algorithm in predicting the future return of the main indices of the largest stock exchanges in the world, through historical trading prices. A sample composed of the daily quotes of 35 indices of the largest stock exchanges in the world from 2001 to 2019 was used. In addition to the random forest algorithm, models were estimated, based on the decision tree algorithm and using the logistic regression technique. The models were estimated considering maximum and closing prices, as well as the complete period and its division into sub-periods. The results indicated that the performances of the estimated models were superior to the market average, and the random forest presented the best results. All models trained on the maximum prices of the indices performed better than those trained on closing prices. In addition, the subperiod models performed better for the random forest. The efficiency of markets in the weak form has been questioned in the contemporary context of the rise of the use of artificial intelligence (AI) algorithms for forecasting in finance. The study is relevant as it contributes to the literature on the use of AI algorithms in forecasting asset prices in the financial market. The main indices of the largest stock exchanges in the world were analyzed, generating general subsidies that can help guide future research in the area.

 

Keywords: Random Forest. Artificial Intelligence (AI). Price Forecast. Efficient Markets Hypothesis (HME). Stock Exchange.

 


Referencias


Javed Awan, M., Mohd Rahim, M. S., Nobanee, H., Munawar, A., Yasin, A., & Zain, A. M. (2021). Social media and stock market prediction: a big data approach. Computers, Materials & Continua, 67(2), 2569-2583. https://doi.org/10.32604/cmc.2021.014253

Avelar, E. A., Ferreira, P. O., Silva, B. N. E. R., & Ferreira, C. O. (2021). Efeitos da pandemia de Covid-19 sobre a sustentabilidade econômico-financeira de empresas brasileiras. Revista Gestão Organizacional, 14(1), 131-152. https://doi.org/10.22277/rgo.v14i1.5724

Cao, H., Lin, T., Li, Y., & Zhang, H. (2019). Stock Price Pattern Prediction Based on Complex Network and Machine Learning. Complexity, 2019, 19, Special Issue, 1-12. https://doi.org/10.1155/2019/4132485

Caliskan Cavdar, S., & Aydin, A. D. (2020). Hybrid Model Approach to the Complexity of Stock Trading Decisions in Turkey. The Journal of Asian Finance, Economics and Business, 7(10), 9-21. https://doi.org/10.13106/jafeb.2020.vol7.no10.009

Chen, Y., & Hao, Y. (2017). A feature weighted support vector machine and K-nearest neighbor algorithm for stock market indices prediction. Expert Systems with Applications, 80, 340–355. https://doi.org/10.1016/j.eswa.2017.02.044

Faceli, K., Lorena, A. C., Gama, J., Almeida, T. A., & Carvalho, A. C. P. L. F. D. (2021). Inteligência Artificial - Uma Abordagem de Aprendizado de Máquina (2nd ed.). LTC.

Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383. https://doi.org/10.2307/2325486

Fama, E. F. (1991). Efficient Capital Markets: II. The Journal of Finance, 46(5), 1575–1617. https://doi.org/10.1111/j.1540-6261.1991.tb04636.x

Ferreira, F. G. D. C., Gandomi, A. H., & Cardoso, R. T. N. (2021). Artificial Intelligence Applied to Stock Market Trading: A Review. IEEE Access, 9, 30898–30917. https://doi.org/10.1109/ACCESS.2021.3058133

Ghosh, I., Jana, R. K., & Sanyal, M. K. (2019). Analysis of temporal pattern, causal interaction and predictive modeling of financial markets using nonlinear dynamics, econometric models and machine learning algorithms. Applied Soft Computing, 82, 105553.

Hair Jr., J. F., Black, W. C., Babin, B. J., Anderson, R. E., & Tatham, R. L. (2009). Análise multivariada de dados. 6. ed. Porto Alegre: Bookman.

Huang, C., Yang, D., & Chuang, Y. (2008). Application of wrapper approach and composite classifier to the stock trend prediction. Expert Systems with Applications, 34(4), 2870-287. https://doi.org/10.1016/j.eswa.2007.05.035.

Investing (2022). Disponível em: https://br.investing.com/. Acesso em: abril de 2022. 2022.

Jaggi, M., Mandal, P., Narang, S., Naseem, U., & Khushi, M. (2021). Text Mining of Stocktwits Data for Predicting Stock Prices. Applied System Innovation, 4(1):13. https://doi.org/10.3390/asi4010013

Jang, H., & Lee, J. (2019). Machine learning versus econometric jump models in predictability and domain adaptability of index options. Physica A, 513, 74-86. https://doi.org/10.1016/j.physa.2018.08.091.

Kalra, S., Gupta, S., & Prasad, J. S. (2019). Performance evaluation of machine learning classifiers for stock market prediction in big data environment. Journal of Mechanics of Continua and Mathematical Sciences, 14(5).

Khaidem, L., Saha, S., & Dey, S. R. (2016). Predicting the direction of stock market prices using random forest. arXiv preprint arXiv:1605.00003.

Long, W., Lu, Z., & Cui, L. (2019). Deep learning-based feature engineering for stock price movement prediction. Knowledge-Based Systems, 164, 163-173. http://doi.org/10.1016/j.knosys.2018.10.034

Maimon, O. Z., & Rokach, L. (2014). Data mining with decision trees: theory and applications (Vol. 81). World scientific.

Kyoung-Sook, M. O. O. N., Sookyung, J. U. N., & Hongjoong, K. I. M. (2018). Speed up of the Majority Voting Ensemble Method for the Prediction of Stock Price Directions. Economic Computation and Economic Cybernetics Studies and Research, 52(1/2018), 215–228. https://doi.org/10.24818/18423264/52.1.18.13

Gorenc Novak, M., & Velušček, D. (2016). Prediction of stock price movement based on daily high prices. Quantitative Finance, 16(5), 793-826.

https://www.tandfonline.com/doi/abs/10.1080/14697688.2015.1070960

Parray, I. R., Khurana, S. S., Kumar, M., & Altalbe, A. A. (2020). Time series data analysis of stock price movement using machine learning techniques. Soft Computing, 24(21), 16509-16517. https://link.springer.com/article/10.1007/s00500-020-04957-x

Rajab, S., & Sharma, V. (2019). An interpretable neuro-fuzzy approach to stock price forecasting. Soft Computing, 23(3), 921-936. https://doi.org/10.1007/s00500-017-2800-7

Ribeiro, M. H. D. M., & Coelho, L. S. (2020). Ensemble approach based on bagging, boosting and stacking for short-term prediction in agribusiness time series. Applied Soft Computing, 86, 105837.

Ryan, J. A., Ulrich, J. M., Thielen, W., Teetor, P., Bronder, S., & Ulrich, M. J. M. (2020). quantmod: quantitative financial modelling framework. R package. https://cran.r-project.org/web/packages/quantmod/quantmod.pdf

Sadorsky, P. (2021). A Random Forests Approach to Predicting Clean Energy Stock Prices.

Journal of Risk and Financial Management, 14(2), 48. https://doi.org/10.3390/jrfm14020048

Shynkevich, Y., McGinnity, T. M., Coleman, S. A., Belatreche, A., & Li, Y. (2017). Forecasting price movements using technical indicators: Investigating the impact of varying input window length. Neurocomputing, 264, 71–88. https://doi.org/10.1016/j.neucom.2016.11.095

Wu, D., Wang, X., Su, J., Tang, B., & Wu, S. (2020). A labeling method for financial time series prediction based on trends. Entropy, 22(10), 1162.

Yahoo!Finance. Disponível em: https://finance.yahoo.com/. Acesso em: abril de 2022. 2022.

Zhou, F., Zhang, Q., Sornette, D., & Jiang, L. (2019). Cascading logistic regression onto gradient boosted decision trees for forecasting and trading stock indices. Applied Soft Computing, 84, 105747. https://doi.org/10.1016/j.asoc.2019.105747




DOI: http://dx.doi.org/10.12819/2022.19.10.3

Enlaces refback

  • No hay ningún enlace refback.


Licencia de Creative Commons
Este obra está bajo una licencia de Creative Commons Reconocimiento-NoComercial-SinObraDerivada 4.0 Internacional.

Ficheiro:Cc-by-nc-nd icon.svg

Atribuição (BY): Os licenciados têm o direito de copiar, distribuir, exibir e executar a obra e fazer trabalhos derivados dela, conquanto que deem créditos devidos ao autor ou licenciador, na maneira especificada por estes.
Não Comercial (NC): Os licenciados podem copiar, distribuir, exibir e executar a obra e fazer trabalhos derivados dela, desde que sejam para fins não-comerciais
Sem Derivações (ND): Os licenciados podem copiar, distribuir, exibir e executar apenas cópias exatas da obra, não podendo criar derivações da mesma.

 


ISSN 1806-6356 (Impresso) e 2317-2983 (Eletrônico)