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

Stock market forecasting based on machine learning: The role of investor sentiment

Author

Listed:
  • Ren, Tingting
  • Li, Shaofang

Abstract

Stock market prediction remains a classical yet challenging problem, with the focus on the investor sentiment growing increasing significant in big data era. This analysis delves into the question whether and how predicable is the stock market when considering investor sentiment. By leveraging the initial and customized LM financial lexicon and Vader technology, Word2vec and Doc2vec and BERT embedding vector method (along with two fine-tuned models: FinBERT and SentiBERT), we first construct nine investor sentiment indexes based on the textual data from Twitter between November 2019 and December 2021. And then we employ three machine learning algorithms (SVR, AdaBoost, and RF) to predict the daily return of the S&P 500 index. The experiment results confirm that the investor sentiment index can enhance prediction accuracy beyond the market indicator, aligning with prior research. Embedding vector methods exhibit superior performance compared to the fine-tuned models, and the customized dictionaries outperform their traditional counterparts. Furthermore, the composite sentiment index, integrating all the single indexes, achieves the best overall performance. To further validate our findings, we conduct robustness checks on the DJIA index and across different economic cycles, observe that the single sentiment index performs worse with shorter datasets, whereas the composite index demonstrates consistent improvement in both volatile and steady periods. These findings offer valuable insights for future research and provide practical applications in stock market prediction.

Suggested Citation

  • Ren, Tingting & Li, Shaofang, 2025. "Stock market forecasting based on machine learning: The role of investor sentiment," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 666(C).
  • Handle: RePEc:eee:phsmap:v:666:y:2025:i:c:s0378437125001852
    DOI: 10.1016/j.physa.2025.130533
    as

    Download full text from publisher

    File URL: http://www.sciencedirect.com/science/article/pii/S0378437125001852
    Download Restriction: Full text for ScienceDirect subscribers only. Journal offers the option of making the article available online on Science direct for a fee of $3,000

    File URL: https://libkey.io/10.1016/j.physa.2025.130533?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.

    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:phsmap:v:666:y:2025:i:c:s0378437125001852. 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.

    We have no bibliographic references for this item. You can help adding them by using 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.journals.elsevier.com/physica-a-statistical-mechpplications/ .

    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.