Can Natural Language Processing (NLP) Sentiment Analysis Predict Stock Market Returns?steemCreated with Sketch.

in hive-175254 •  last year 

For a while now, with the success of Natural Language Processing (NLP) Large Language Models (LLMs) such as chat-GPT, I've been mulling the possibility of using NLP sentiment analysis alone to predict stock returns. Basically, trying to answer the question can artificial intelligence today solve one of humanities thorniest issues - predict chaotic human behaviour, for which the stock market is a perfect example.

To perform this study, I chose a stock which was in the news a lot for the past 2 years - Peloton Interactive (PTON), so as as to have enough dataset perform NLP sentiment analysis on. Next, I used Peloton's adjusted closing daily price data from yahoo finance for the period of February 2021 to June 2023. I then computed Peloton's stock for the period and plotted the stock return against Peloton's NLP sentiment data. The results are quite fascinating and seen in the figure below.

Peleton_NLP.png

So what can we glean from the data? First, NLP sentiment analysis alone is a poor predictor of stock returns with an R2 value of a miserly 0.0038. This means that NLP sentiment analysis should be used with other data such as price action for a successful stock return prediction. This is not surprising as if it was that easy, the stock market wouldn't be the mystery that it is.

However, something quite interesting came out of this analysis that I want to point out. Looking at the figure, NLP sentiment analysis perfectly partitions Peloton's stock return data into 3 clusters, the -ve sentiment cluster, the zero sentiment cluster and the +ve sentiment cluster. This is remarkable because any machine learning algorithm like support vector machines can adequately learn these cluster and hone in on them during training, especially when combined with other data like price action. While its hard to see with the plot but if squint and look deeper, you will notice that for the -ve sentiment cluster, you had more negative returns than positive, while for the +ve sentiment cluster (and even the zero sentiment cluster), you had more positive returns than negative. This is a fascinating result because it shows that NLP sentiment can add value in predicting Peloton's stock returns (for the period studied).

I plan to continue to look into this phenomena - how can we use NLP sentiment analysis to predict stock market returns and will sure come back with my finds.

Thanks for reading and let me know your thoughts in the comments section.

Yours in learning,

AI+Finance

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

image.png