The relationship between the stock market and media trend

Using AI to analyze and compare the stock market and media trend for the OBX companies

Magnus Midtbø Kristiansen
Strise
6 min readJan 30, 2019

--

Fluctuations in the stock market based on media response are nothing new. But is this the case for all companies? For some companies, their brand is an important and integrated part of their business, while for others this is not the case. Can we expect to see a stronger stock-media relationship for the first case than for the latter?

When trying to evaluate the stock market in context of the media you encounter some problems. Sooner or later you will need information about media coverage and how much different companies are trending in the media. Getting this data is by no means trivial (do you know how many different things are called “Aker”?). Fortunately for us by using the Mito.ai AI-powered backend extracting data like this is not only possible, but it is in fact fairly easy. Lets take a look at what the data suggests.

The stock-media relationship depends on media coverage

We start by extracting the total distribution of news coverage for the companies comprising the OBX index, shown in the following stacked chart:

As shown on the above graph, some companies are clearly mentioned more in the media than others. If we define a correlation coefficient between stock price progression and media trend (which you can read more about at the end of the post) we can compare media coverage with this stock-trend coefficient:

The closer the coefficient is to zero the stronger the relationship between stock price progression and media trend is for that company. The coefficient seems to get progressively smaller when media coverage gets larger. This is interesting! It means that for companies with more media coverage the stock price is more likely to be fluctuating if the company is trending. While companies with less media coverage can fluctuate on the market without it showing in the media trend.

A closer look

Since Equinor (EQNR) is the company with the most media coverage let’s compare the Equinor stock with its trend score.

It is clear that the correlation is not always the same strength. When our correlation is weak, there might be other explanations as to why the trend score suddenly jumps. Simply looking at what the media is writing about a company could explain why the trend score made this jump, while the stock price didn’t. Lets look at a key date from our Equinor-case; 2018–08–29. Around this date the trend score made a sudden jump, while the stock price remained more or less stable. Extracting the actual news stories about Equinor in the period around 2018–08–29 we see that the jump in trend score was maybe not so odd. For example, news arrived that Equinor had decided to invest a substantial amount of money in Brazil. This made headlines, but the market didn’t react in a substantial way.

What about companies with lower media coverage? Lets take a look at the fourth most mentioned company, Norwegian Air Shuttle (NAS):

In this graph a correlation is easier to spot! One interesting thing to note is that the trend score does not seem to be affected by the sudden fall from September to mid October. Why is this? If we take a look at the whole OBX index we can spot why:

The OBX index

The whole index actually fell rapidly from early October onwards (as did pretty much every major index in the world). The fact that Norwegian fell too is not something unique, therefore the trend score remaining stable might not be such a surprise.

Finally, we can take a look at a company with significantly less media coverage: Aker BP (AKERBP).

The AKERBP stock price does not show a clear correlation with its trend score. The correlation coefficient is in fact 2.4182, which when we compare it to EQNR and NAS is significantly worse.

The how’s and why’s

Because the OBX index consists of the 25 most liquid shares on the Oslo Stock Exchange we are using this index as the base for our analysis. When extracting media coverage data from the Mito.ai backend we get the following table:

The media coverage data extracted from the Mito.ai backend

Each cell represents the number of news stories about that company at a given time-interval. The reason for the seemingly low article counts is because our backend uses sophisticated clustering techniques to ensure wide-spread events are only counted as a single story. We also use a relevance filter to make sure only articles that are in fact relevant for each company is counted. It is also worth mentioning that although we do analyze content in multiple languages, we’ve only looked at Norwegian news stories for this particular blog post.

Simply counting the number of stories for each of the companies, however, is not enough to determine a media trend — as a trend by definition is a measure of how much something is talked about at some point, in relation to some other period. Figuring out the trend score can therefore be done by comparing how much a company is mentioned in one period with

  • how much the company is mentioned in an extended period, and
  • how much a set of other companies are mentioned.

This lets us create a foreground set which we can compare with a background set, to see unusual occurrences of a company in the media. In this case we are using a two week period as the foreground set and a six month period plus the companies on the OBX index as the background set. This is a technique similar to the one used in robust search engines, like Elasticsearch.

To better illustrate the relationship between a company’s stock price and trend score we need to define a correlation coefficient. Using a common approach like Pearson correlation coefficient to measure linear correlation is not really useful, as a linear correlation between stock prices and media trend isn’t something we expect. It would be more fair to expect the trend score to either decrease or increase if the stock price either increased or decreased, suddenly.

Therefore, we define the following trend score:

Which will yield a coefficient of 0 if the change in trend score is exactly equal to the change in stock price for every interval. If they are not equal the average will get logarithmically larger by how much ΔStockprice and ΔTrend differ. The reason we are using log is to respond to certain periods where the trend score is close to constant and the resulting ratio would skew a linear approach too much. It is also important to note that we are using the absolute value of Δ, because when the stock price experiences a sudden drop, a jump in trend score suggests a stronger correlation.

Interested in knowing more about how Mito.ai and how we’re having fun with data while solving tomorrow’s problems? Stop by for a coffee or shoot us a message :)

PS: We’re also currently hiring VP Sales, UX Lead and front-end developers! Send us a short email at jobs@mito.ai.

--

--