IDEAS home Printed from https://ideas.repec.org/a/eee/riibaf/v70y2024ipas0275531924001296.html
   My bibliography  Save this article

S&P 500 stock selection using machine learning classifiers: A look into the changing role of factors

Author

Listed:
  • Caparrini, Antonio
  • Arroyo, Javier
  • Escayola Mansilla, Jordi

Abstract

This study examines the profitability of using machine learning algorithms to select a subset of stocks over the S&P 500 using factors as features. We use tree-based algorithms: Decision Tree, Random Forest, and XGBoost for their white model capabilities, allowing feature importances extraction. We defined a backtest to train the models with recent data and rebalance the portfolio. Despite incurring more risks, the selected assets of the portfolio outperform the index by using machine learning. Furthermore, we show that the feature importance that determines the best-performing assets changes at different times. Such models providing the evolution of the importance of factors can provide profitability insights while keeping explainability.

Suggested Citation

  • Caparrini, Antonio & Arroyo, Javier & Escayola Mansilla, Jordi, 2024. "S&P 500 stock selection using machine learning classifiers: A look into the changing role of factors," Research in International Business and Finance, Elsevier, vol. 70(PA).
  • Handle: RePEc:eee:riibaf:v:70:y:2024:i:pa:s0275531924001296
    DOI: 10.1016/j.ribaf.2024.102336
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0275531924001296
    Download Restriction: Full text for ScienceDirect subscribers only

    File URL: https://libkey.io/10.1016/j.ribaf.2024.102336?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. Fama, Eugene F & French, Kenneth R, 1992. "The Cross-Section of Expected Stock Returns," Journal of Finance, American Finance Association, vol. 47(2), pages 427-465, June.
    2. Leippold, Markus & Wang, Qian & Zhou, Wenyu, 2022. "Machine learning in the Chinese stock market," Journal of Financial Economics, Elsevier, vol. 145(2), pages 64-82.
    3. Masaya Abe & Kei Nakagawa, 2020. "Cross-sectional Stock Price Prediction using Deep Learning for Actual Investment Management," Papers 2002.06975, arXiv.org.
    4. Victor DeMiguel & Lorenzo Garlappi & Raman Uppal, 2009. "Optimal Versus Naive Diversification: How Inefficient is the 1-N Portfolio Strategy?," The Review of Financial Studies, Society for Financial Studies, vol. 22(5), pages 1915-1953, May.
    5. Hedayati , Amin & Hedayati , Moein & Esfandyari, Morteza, 2016. "Stock market index prediction using artificial neural network," Journal of Economics, Finance and Administrative Science, Universidad ESAN, vol. 21(41), pages 89-93.
    6. Liu, Yujun & Li, Zhongfei & Nekhili, Ramzi & Sultan, Jahangir, 2023. "Forecasting cryptocurrency returns with machine learning," Research in International Business and Finance, Elsevier, vol. 64(C).
    7. John H. Cochrane, 2011. "Presidential Address: Discount Rates," Journal of Finance, American Finance Association, vol. 66(4), pages 1047-1108, August.
    8. Liu, Keyan & Zhou, Jianan & Dong, Dayong, 2021. "Improving stock price prediction using the long short-term memory model combined with online social networks," Journal of Behavioral and Experimental Finance, Elsevier, vol. 30(C).
    9. Keywan Christian Rasekhschaffe & Robert C. Jones, 2019. "Machine Learning for Stock Selection," Financial Analysts Journal, Taylor & Francis Journals, vol. 75(3), pages 70-88, July.
    10. Ghosh, Pushpendu & Neufeld, Ariel & Sahoo, Jajati Keshari, 2022. "Forecasting directional movements of stock prices for intraday trading using LSTM and random forests," Finance Research Letters, Elsevier, vol. 46(PA).
    11. Fama, Eugene F. & French, Kenneth R., 2015. "A five-factor asset pricing model," Journal of Financial Economics, Elsevier, vol. 116(1), pages 1-22.
    12. Yi Fu & Shuai Cao & Tao Pang, 2020. "A Sustainable Quantitative Stock Selection Strategy Based on Dynamic Factor Adjustment," Sustainability, MDPI, vol. 12(10), pages 1-12, May.
    13. German Creamer & Yoav Freund, 2010. "Automated trading with boosting and expert weighting," Quantitative Finance, Taylor & Francis Journals, vol. 10(4), pages 401-420.
    14. William F. Sharpe, 1964. "Capital Asset Prices: A Theory Of Market Equilibrium Under Conditions Of Risk," Journal of Finance, American Finance Association, vol. 19(3), pages 425-442, September.
    15. Hanauer, Matthias X. & Kononova, Marina & Rapp, Marc Steffen, 2022. "Boosting agnostic fundamental analysis: Using machine learning to identify mispricing in European stock markets," Finance Research Letters, Elsevier, vol. 48(C).
    16. Chen, Rui & Ren, Jinjuan, 2022. "Do AI-powered mutual funds perform better?," Finance Research Letters, Elsevier, vol. 47(PA).
    17. Marija Gorenc Novak & Dejan Velušček, 2016. "Prediction of stock price movement based on daily high prices," Quantitative Finance, Taylor & Francis Journals, vol. 16(5), pages 793-826, May.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Juhani T. Linnainmaa & Michael R. Roberts, 2016. "The History of the Cross Section of Stock Returns," NBER Working Papers 22894, National Bureau of Economic Research, Inc.
    2. de Oliveira Souza, Thiago, 2016. "The size premium and intertemporal risk," Discussion Papers on Economics 3/2016, University of Southern Denmark, Department of Economics.
    3. Gregory Nazaire & Maria Pacurar & Oumar Sy, 2020. "Betas versus characteristics: A practical perspective," European Financial Management, European Financial Management Association, vol. 26(5), pages 1385-1413, November.
    4. Cai, T. Tony & Hu, Jianchang & Li, Yingying & Zheng, Xinghua, 2020. "High-dimensional minimum variance portfolio estimation based on high-frequency data," Journal of Econometrics, Elsevier, vol. 214(2), pages 482-494.
    5. Uddin, Ajim & Yu, Dantong, 2020. "Latent factor model for asset pricing," Journal of Behavioral and Experimental Finance, Elsevier, vol. 27(C).
    6. Wei Liu & James W. Kolari, 2022. "Multifactor Market Indexes," JRFM, MDPI, vol. 15(4), pages 1-26, March.
    7. Adil Rengim Cetingoz & Olivier Gu'eant, 2023. "Asset and Factor Risk Budgeting: A Balanced Approach," Papers 2312.11132, arXiv.org, revised May 2024.
    8. Fu, Yufen & Blazenko, George W., 2017. "Normative portfolio theory," International Review of Financial Analysis, Elsevier, vol. 52(C), pages 240-251.
    9. Joachim Freyberger & Andreas Neuhierl & Michael Weber, 2020. "Dissecting Characteristics Nonparametrically," The Review of Financial Studies, Society for Financial Studies, vol. 33(5), pages 2326-2377.
    10. De Nard, Gianluca & Zhao, Zhao, 2023. "Using, taming or avoiding the factor zoo? A double-shrinkage estimator for covariance matrices," Journal of Empirical Finance, Elsevier, vol. 72(C), pages 23-35.
    11. Vitor Azevedo & Georg Sebastian Kaiser & Sebastian Mueller, 2023. "Stock market anomalies and machine learning across the globe," Journal of Asset Management, Palgrave Macmillan, vol. 24(5), pages 419-441, September.
    12. Racicot, François-Éric & Rentz, William F., 2018. "Does Illiquidity Matter? An Errors-in-Variables Perspective/¿Es importante la iliquidez? Un análisis desde el enfoque de errores en variables," Estudios de Economia Aplicada, Estudios de Economia Aplicada, vol. 36, pages 251-262, Enero.
    13. Arvanitis, Stelios & Scaillet, Olivier & Topaloglou, Nikolas, 2020. "Spanning analysis of stock market anomalies under prospect stochastic dominance," Working Papers unige:134101, University of Geneva, Geneva School of Economics and Management.
    14. Massimo Guidolin & Manuela Pedio & Dimos Andronoudis, 2019. "How Smart is the Real Estate Smart Beta? Evidence from Optimal Style Factor Strategies for REITs," BAFFI CAREFIN Working Papers 19117, BAFFI CAREFIN, Centre for Applied Research on International Markets Banking Finance and Regulation, Universita' Bocconi, Milano, Italy.
    15. Alles Rodrigues, Alexandre & Casalin, Fabrizio, 2022. "Factor investing in Brazil: Diversifying across factor tilts and allocation strategies," Emerging Markets Review, Elsevier, vol. 52(C).
    16. Kwon, Ji Ho, 2024. "Bank credit, consumption risk, and the cross-section of expected returns," International Review of Financial Analysis, Elsevier, vol. 92(C).
    17. Bai, Jennie & Bali, Turan G. & Wen, Quan, 2021. "Is there a risk-return tradeoff in the corporate bond market? Time-series and cross-sectional evidence," Journal of Financial Economics, Elsevier, vol. 142(3), pages 1017-1037.
    18. DeMiguel, Victor & Martin-Utrera, Alberto & Nogales, Francisco J. & Uppal, Raman, 2017. "A Portfolio Perspective on the Multitude of Firm Characteristics," CEPR Discussion Papers 12417, C.E.P.R. Discussion Papers.
    19. Vitor Azevedo & Christopher Hoegner, 2023. "Enhancing stock market anomalies with machine learning," Review of Quantitative Finance and Accounting, Springer, vol. 60(1), pages 195-230, January.
    20. James W. Kolari & Jianhua Z. Huang & Wei Liu & Huiling Liao, 2022. "Further Tests of the ZCAPM Asset Pricing Model," JRFM, MDPI, vol. 15(3), pages 1-23, March.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:eee:riibaf:v:70:y:2024:i:pa:s0275531924001296. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Catherine Liu (email available below). General contact details of provider: http://www.elsevier.com/locate/ribaf .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.