Research Article
Open access
Published on 24 April 2025
Download pdf
Cai,T. (2025). Stock Forecasting Based on Random Forest and ARIMA Models. Theoretical and Natural Science,101,117-127.
Export citation

Stock Forecasting Based on Random Forest and ARIMA Models

Tianrui Cai *,1,
  • 1 Department of Mathematics, Hangzhou Normal University, Hangzhou, China

* Author to whom correspondence should be addressed.

https://doi.org/10.54254/2753-8818/2025.CH22310

Abstract

In this paper, a Random Forest model and an ARIMA model are established to predict stock closing prices. The data from six Chinese stocks—Shandong Gold Mining, WanYi Technology, iFLYTEK, Space-Time Technology, TianYue Advanced Materials Technology, and Harmontronics Intelligent Technology—spanning from January 1, 2024, to December 30, 2024, are used. The results show that these two models are more accurate in short-term stock price prediction. By combining and comparing these two models, we conclude that the Random Forest model predicts the next day's closing price highly accurately and has obvious advantages in ultra-short-term trading. This offers insights for investors and related researchers in pursuit of short-term profits.

Keywords

closing price of stocks, time series, Random Forest model, ARIMA model

[1]. Fama, E. F. and French, K. R. (1988) Dividend yields and expected stock returns[J]. J Finance Econ, 22(1), 3-25.

[2]. Xu, H., Xu, B. and Xu, K. (2020) A Survey on the Application of Machine Learning in Stock Prediction[J]. Computer Engineering and Applications, 56(12), 19 - 24.

[3]. Zhao, T., Han, Y., Yang, M., Ren, D., Chen, Y., Wang, Y. and Liu, J. (2021) A Survey on Time Series Data Prediction Methods Based on Machine Learning[J]. Journal of Tianjin University of Science and Technology, 36(05), 1 - 9.

[4]. Liu, M., Lang, R. and Cao, Y. (2015) The Number of Trees in Random Forest[J]. Computer Engineering and Applications, 51(05), 126-131.

[5]. Mohammad, Z., Okke, B., Marzieh, F. and Reinhard, H. (2021) Ensemble machine learning paradigms in hydrology: A review [J]. Journal of Hydrology, 598, 126266.

[6]. Gao, X., Ruan, Z., Liu, J., Chen, Q. and Yuan, Y. (2022) Analysis of atmospheric pollutants and meteorological factors on concentration and temporal variations in Harbin[J]. Atmosphere, 13(9), 1426-1426.

[7]. Tao, Y. and Du, J. (2019) Temperature prediction using long short term memory network based on Random Forest[J]. Computer Engineering and Design, 40(03), 737-743.

[8]. Shen, P., Jin, Q., Zhou, Y., Xu, R. and Huang, H. (2022) Spatial-temporal pattern and driving factors of surface ozone concentrations in Zhejiang Province[J]. Research of Environmental Sciences, 35(09), 2136-2146.

[9]. Lin, N. and Qin, J. (2018) Forecast of A-share stock change based on Random Forest[J].Journal of Shanghai University of Science and Technology, 40(03), 267-273+301.

[10]. Zhang, X., Zhang, Z. and Zhan, H. (2005) Identification of multiple damaged locations in structures based on curvature mode and flexibility curvature[J]. Journal of Wuhan University of Technology, 08, 35-37+55.

[11]. Ahmed, S., Karimuzzaman, M. and Hossain, M. M. (2021) Modeling of Mean Sea Level of Bay of Bengal: A Comparison between ARIMA and Artificial Neural Network[J]. International Journal of Tomography & Simulation™, 34 (1), 31-40.

[12]. Li, Y. and Cheng, Z. (2011) Application of Time Series Models in Stock Price Forecasting [J]. Modernization of Commerce, 33, 61-63.

[13]. Huang, M. (2023) Empirical Study on Stock Price Forecasting Based on ARIMA Model[J]. Neijiang Science & Technology, 44 (03), 61-62

[14]. Wu, F., Cattani, C., Song, W. and Zio, E. (2020) Fractional ARIMA with an improved cuckoo search optimization for the efficient Short-term power load forecasting [J]. Alexandria Engineering Journal, 59, 3111-3118.

[15]. Li, H., Song, D., Kong, J., Song, Y. and Chang, H. (2024) Evaluation of hyperparameter optimization techniques for traditional machine learning models [J].Computers & Science, 51(08), 242-255.

Cite this article

Cai,T. (2025). Stock Forecasting Based on Random Forest and ARIMA Models. Theoretical and Natural Science,101,117-127.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

Disclaimer/Publisher's Note

The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

About volume

Volume title: Proceedings of CONF-MPCS 2025 Symposium: Mastering Optimization: Strategies for Maximum Efficiency

ISBN:978-1-80590-017-7(Print) / 978-1-80590-018-4(Online)
Conference date: 21 March 2025
Editor:Anil Fernando, Marwan Omar
Series: Theoretical and Natural Science
Volume number: Vol.101
ISSN:2753-8818(Print) / 2753-8826(Online)

© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license. Authors who publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See Open access policy for details).