Research Article

Predicting the S&P 500 stock market with machine learning models

Boyu Shi1,*, Chuhua Tan2, Yue Yu3
1. FedUni Information Engineering Institute, Hebei University of Science and Technology
2. Shanghai Starriver Bilingual School
3. University of Liverpool

* Corresponding author: [email protected]

Abstract

Predicting stock prices through machine learning models is becoming increasingly important in today's world. This essay aims to present a basic analysis of predicting the S&P 500 stock market using machine learning models, that are linear regression and XGBoost. The research utilizes historical data from the S&P 500 stock market in the past few years, dividing it into training, testing, and verification sets with a distribution of 70%, 15% and 15%, respectively. The linear regression model uses MSE (3.051×10^17) and R^2(0.316) in testing group to analyze the accuracy of prediction, while the XGBoost model uses MSE (14816.886) and RMSE (121.725) in testing group to analyze the accuracy. The findings indicate that the accuracy of the XGBoost model surpasses that of the linear regression model. Drawing from the outcomes, one can infer that the XGBoost model is better suited for stock prediction compared to the linear regression model.

Keywords: SP500; Prediction; XGBoost
Published: March 19, 2024
DOI: 10.54254/2755-2721/48/20241621
Volume: ACE Vol.48
pp. 255-261
Download PDF

References

  1. Fard, Z. Q., Zomorodian, Z. S., & Korsavi, S. S. (2022). Application of machine learning in thermal comfort studies: A review of methods, performance and challenges. Energy and Buildings, 256, 111771.
  2. Lei, Y., Yang, B., Jiang, X., Jia, F., Li, N., & Nandi, A. K. (2020). Applications of machine learning to machine fault diagnosis: A review and roadmap. Mechanical Systems and Signal Processing, 138, 106587.
  3. Rawat, S., Rawat, A., Kumar, D., & Sabitha, A. S. (2021). Application of machine learning and data visualization techniques for decision support in the insurance sector. International Journal of Information Management Data Insights, 1(2), 100012.
  4. Vamathevan, J., Clark, D., Czodrowski, P., Dunham, I., et al. (2019). Applications of machine learning in drug discovery and development. Nature reviews Drug discovery, 18(6), 463-477.
  5. Schmidt, J., Marques, M. R., Botti, S., & Marques, M. A. (2019). Recent advances and applications of machine learning in solid-state materials science. npj Computational Materials, 5(1), 83.
  6. Goodell, J. W., Kumar, S., Lim, W. M., & Pattnaik, D. (2021). Artificial intelligence and machine learning in finance: Identifying foundations, themes, and research clusters from bibliometric analysis. Journal of Behavioral and Experimental Finance, 32, 100577.
  7. Henrique, B. M., Sobreiro, V. A., & Kimura, H. (2019). Literature review: Machine learning techniques applied to financial market prediction. Expert Systems with Applications, 124, 226-251.
  8. Paiva, F. D., Cardoso, R. T. N., Hanaoka, G. P., & Duarte, W. M. (2019). Decision-making for financial trading: A fusion approach of machine learning and portfolio selection. Expert Systems with Applications, 115, 635-655.
  9. Linardatos, P., Papastefanopoulos, V., & Kotsiantis, S. (2020). Explainable ai: A review of machine learning interpretability methods. Entropy, 23(1), 18.
  10. Chen, T., & Guestrin, C. (2016, August). Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining (pp. 785-794).