A nonlinear impact: evidences of causal effects of social media on market prices
Online social networks offer a new way to investigate financial markets’ dynamics by enabling the large-scale analysis of investors’ collective behavior. We provide empirical evidence that suggests social media and stock markets have a nonlinear causal relationship. We take advantage of an extensive data set composed of social media messages related to DJIA index components. By using information-theoretic measures to cope for possible nonlinear causal coupling between social media and stock markets systems, we point out stunning differences in the results with respect to linear coupling. Two main conclusions are drawn: First, social media significant causality on stocks’ returns are purely nonlinear in most cases; Second, social media dominates the directional coupling with stock market, an effect not observable within linear modeling. Results also serve as empirical guidance on model adequacy in the investigation of sociotechnical and financial systems.
Keywords:financial markets, complex systems, social media, nonlinear causality, information theory
Investors’ decisions are modulated not only by companies’ fundamentals but also by personal beliefs, peers influence and information generated from news and the Internet. Rational and irrational investor’s behavior and their relation with the market efficiency hypothesis  have been largely debated in the economics and financial literature . However, it was only recently that the availability of vast amounts of data from online systems paved the way for the large-scale investigation of investor’s collective behavior in financial markets.
Testing for nonlinear dependence is of great importance in financial econometrics due to its implications in model adequacy, market efficiency, and predictability . Taking social media as a proxy for investor’s collective attention over the stock market, we provide empirical evidence that characterize social media impact on market prices as nonlinear.
Previous studies have investigated the predictive power of online expressed opinions and measures of collective attention on market movements . News are perhaps the most explored source of information, especially after the availability of electronically transmitted services and machine readable news [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]. The use of search engines [16, 17, 18, 19, 20, 9, 21] and Wikipedia  are examples of the extension of this investigation to broader types of online systems. In addition to that, social media and micro-blogging platforms play an increasingly significant role as proxies of collective intelligence and sentiment of the real world. Not only do they mimic real-world peer-to-peer relationships but they also provide a fine-grained real-time information channel that include stories, facts and shifts in collective opinion. Nonetheless, to what extent this information flood reflects financial dynamics is a relatively novel topic under great debate [23, 19, 15, 24, 25, 26, 27, 28, 29, 30, 9, 31, 32, 33, 34].
Recent developments have shown the importance of Twitter as an information channel about financial markets. An example is the U.S. Securities and Exchange Commission allowance of official company’s disclosure via Twitter in compliance with Regulation Fair Disclosure . Several research evidences also indicate that Twitter may describe and predict financial dynamics. Among the first and most influential works is Bollen et al. (2011) , where the authors used emotion analytics to forecast movements in the DJIA index. Later on, in a report for the European Central Bank, the same authors  showed that Twitter collective opinion not only has predictive power over stocks’ returns but it actually precedes changes in search volume (Google Trends), a known predictor of economic indicators. Further, Zheludev et al. (2014)  showed that Twitter can contain statistically-significant lead-time information about securities’ returns, most remarkably over future prices of the S&P500 index. Sprenger et al. (2014)  proposed a methodology that quantified the impact of Twitter messages in the market as well as identified different types of company specific events. Subsequent research by Ranco et al. (2015)  reinforced these results while analyzing links among Twitter peaks, excess of stocks’ returns and the identification of earnings announcements.
These recent works provide evidence that exogenous information gathered from sociotechnical systems may be useful to describe financial dynamics. However, the current body of the literature presents mixed results on the stocks’ returns predictability. On the one hand, some researches indicate predictability of price movements using News and social media [4, 5, 23, 19]. On the other hand, other studies report weak results [26, 24] suggesting that social media analytics have low power when used alone. Moreover, the use of ad hoc functional forms and assumptions in different studies makes it difficult to draw general conclusions about the nature of the relationship between sociotechnical systems and stock markets.
We take advantage of an information-theoretic framework to study the causality between social media and stock returns in a nonparametric way. We detect directional and dynamical coupling while not assuming any particular type of interaction between the systems. To our knowledge, our results provide the first empirical evidence that suggests social media and stock markets not only have significant lead-time coupling but also are dominated by nonlinear interactions.
2 Data Analyzed
Our analysis is conducted on the 30 components of the Dow Jones Industrial Average (DJIA) index, which we monitored during the two-year period from March 31, 2012 to March 31, 2014. The choice of these stocks was due to their representativeness of the stock market (see Supporting Information SI.A.1 for the complete list of companies). We consider two streams of time series data: (i) market data, which are given at the daily stock price, and (ii) social media data analytics based on 1,767,997 Twitter messages. Let be the closing price of an asset at day , as financial variable we consider the stocks’ daily log-returns: .
We consider Twitter data analytics as a proxy for the collective opinion over a stock. As opinion mining  per se is out of scope of this study, we build our analysis on top of Twitter data analytics supplied by PsychSignal.com . PsychSignal’s natural language processing (NLP) uses a sophisticated linguistic based approach to sentiment mining that is able to extract and score the nuanced financial language used by traders in online conversations.
We take the daily total number of bullish tweets related to a company as the social media time series . Fig. 1 shows the volume of bearish and bullish messages for the selected companies. A company is defined to be related to a given message if its ticker-id is mentioned as a cashtag, i.e., with its name preceded by a dollar symbol, e.g., $CSCO for the company CISCO SYSTEMS INC. In Twitter, a cashtag is a standard way to refer to a listed security. See Supporting Information SI.A.2 for further details on the Twitter data analytics.
3 Social Media and Stocks’ Returns: Linear and Nonlinear Causality
We investigate the characterization of causal inference between social media and stocks’ returns under the notion of Granger (G-causality) [38, 39]. We test the null hypothesis of social media not causing stocks’ returns. Firstly, we verify this hypothesis with a standard G-causality test under a linear vector-autoregressive framework. This linear model is tested against misspecification via a BDS test  which is a nonparametric method that is powerful to detect nonlinearity . Secondly, we detect significant causalities in possible nonlinear dynamical interactions. This is done without assuming any a priori type of interaction. We consider Transfer Entropy (TE) as the measure for nonparametric causality. Since its introduction by Schreiber (2000) , TE has been recognized as an important tool in the analysis of causal relationships in nonlinear systems . It naturally detects directional and dynamical information . This measure can be interpreted as the information flow between social media and future outcomes of stocks’ returns at lag , controlled by current information on stocks’ returns.
Consistent with a nonparametric analysis, we estimate the TE significance via randomized permutation tests. If the null hypothesis is rejected, there is evidence of nonlinear causality, otherwise we consider that there is no significant causality. The hypothesis tests are performed for lags ranging from 1 to 10 trading days. We apply the Bonferroni correction to reduce the probability of a Type I (false positive) error due to multiple hypotheses testing.
Fig. 2 shows the significant causality links between social media and stocks’ returns considering both cases: nonlinear (TE) and linear G-causality 222See Supporting Information SI.C for the complete set of p-values obtained.. Linear analysis discovers only three stocks with significant causality: INTEL CORP., NIKE INC. and WALT DISNEY CO. Nonlinear analysis discovers that several other stocks have significant causality. In addition to the 3 stocks identified with significant linear causality, other 8 stocks present purely nonlinear causality.
In Fig. 3, we show the number of stocks with significant causality aggregated by lag of interaction. The causality between social media and next-day stocks’ returns presents a stunning difference between linear and nonlinear cases. From linear G-causality one would say that there is significant causality between social media and next-day stocks’ movements for one stock only. Conversely, nonlinear measures indicated that 10 companies have significant causality in this direction. Higher delays show a drop on this number. These results suggest that linear-constraints are neglecting social media causality over stocks’ returns especially in the next-day period or in the short-term.
The low level of causality obtained under linear constraints is inline with results from similar studies in the literature, where it was found that stocks’ returns show weak causality links [6, 29] and social media sentiment analytics, at least when taken alone, have very small or no predictive power  and do not have significant lead-time information about stock’s movements for the majority of the stocks . Contrariwise, results from the nonlinear analyses unveiled a much higher level of causality indicating that linear constraints may be neglecting the relationship between social media and stock markets.
For the companies identified with nonlinear causality, we tested whether common functional forms and transformations used in the literature can explain the nonlinearities. We checked model adequacy and causality significance for various functional forms listed in Table 1, where the results are also reported. The original linear functional form is adequate for 5 companies but can not explain the nonlinear causality. Second-order differencing makes a linear functional adequate for the company VISA, but turns Microsoft as misspecified. GARCH and ARIMA filtering were applied in a tentative to separate signal from noise and to linearize the original time series. Nonetheless, significant causality was not observed. Other functional forms performed no better than the original linear specification a part from the absolute value transformation. It is indeed known that social media and news analytics predict absolute changes in market prices [24, 6] better than stock’s returns. This functional form is a proxy for stock returns volatility and therefore it has higher predictability than stock returns. Yet, half of the companies still had an unexplained nonlinear causality.
It is clear from the results obtained that the nonlinearities found can not be fully explained by returns’ volatility neither by naive transformations often employed in related studies. This indicates that the nonlinear causality is nontrivial and that there is forecastable structure that can not be explained by commonly-used functional forms. Therefore, the impact of social media on market prices may be higher than currently reported in related studies, because commonly-used functional forms are hiding significant causality, that are here reveled instead with a nonparametric analysis.
4 Quantifying the Direction of Information Flow
Transfer-entropy is an asymmetric measure, i.e., , and thus allows the quantification of directional coupling between systems. The Net Information Flow is defined as . One can interpret this quantity as a measure of dominant direction of information flow, i.e., a positive result indicates a dominant information flow from to compared to the other direction or, similarly, it indicates which system provides more predictive information about the other system .
TE has an intuitive interpretation under the notion of G-causality in the sense that social media may cause (future) stocks’ returns only when it provides more information to stocks’ returns than past stocks’ returns themselves. In fact, Barnett et al. (2009)  showed that linear G-causality and Transfer Entropy are equivalent for Gaussian variables. This result provides a direct mapping between the information-theoretic framework and the linear VAR approach of G-causality. Hence, it is possible to estimate TE both in its general form and with its equivalent form for linear G-causality. The former case is a nonparametric approach that is able to capture possible nonlinear coupling that are likely to be neglected in the latter case.
We can therefore quantify the Net Information Flow from social media to stocks’ returns using both nonlinear and linear frameworks. We investigated which direction of coupling is the strongest and to what extent the consideration of nonlinear dynamics affects the results compared to a linear-constrained analysis. Fig. 4 A) shows the results for the linear case. We observe an asymmetry of information, i.e., the systems are not coupled with the same amount of information flow in both directions. The stocks are clearly divided in two groups of approximately same sizes. One group shows stocks with positive net information flow, indicating that social media provides more predictive information about the stock market than the opposite. A second group of stocks indicates the opposite, i.e., information flows more from stocks’ returns to social media than in the other direction. In both cases, the absolute value of net information flow decreases with lag.
Surprisingly, the consideration of nonlinear dynamics unveils a much different scenario. Fig 4 B) shows the results of the same analysis without linear constraints. The net information flow becomes positive for all stocks analyzed. This result suggests that social media is the dominant information source indicating that the information provided by social media contributes more to the description of stock markets dynamics than the opposite.
The present study has revealed that social media has a significant nonlinear impact on stocks’ returns.
We analyzed an extensive data set of social media analytics related to stocks components of the DJIA index. Nonparametric tests for nonlinear specification and causality indicated three major empirical findings:
The consideration of nonlinear dynamics increased the number of stocks with relevant social media signal from 1/10, in the linear case, to more than 1/3 indicating that social media significant causality on stocks’ returns are purely nonlinear in most cases;
The nonlinearities found were nontrivial and could not be explained by common functional forms used in the literature. This indicates that the impact of social media on stocks’ returns may be higher than currently reported in related studies;
Nonparametric analysis indicated that social media dominates the directional coupling with stock market; an effect not observable within linear constraints.
We suggest that social media explanatory power on stock markets may be intensified if nonlinear dynamics are considered. In this respect, we provided strong evidence that supports the use of social media as a valuable source of information about the stock market.
From a methodological point of view, results indicate that a nonparametric approach is highly preferable for the investigation of causal relationships between sociotechnical and financial systems.
6.1 BDS Test for Linear Misspecification
When applied to the residuals of a linear model, the BDS test  is a powerful test to detect nonlinearity . Let be the residuals of the linear fitted model and define its -embedding as . The -embedding correlation integral is given by
where is an indicator function with if and zero, otherwise. The null hypothesis of the BDS test assumes that is iid. In this case,
The BDS statistic is a measure of the extent that this relation holds in the data. It is given by:
where can be estimated as described in . The null hypothesis of the BDS test indicates that the model tested is not misspecified and it is rejected at 5% significance level if .
is commonly set as a factor of the variance () of . We report results for and the embedding dimension . We also performed tests for and with no significant differences in the results.
6.2 Linear G-causality
Consider the linear vector-autoregressive (VAR) equations:
we test whether G-causes by comparing the errors in the prediction of in the restricted and unrestricted regression models in Eq. (5) and Eq. (12), respectively. Significance estimation is performed via analysis of variance. We indicated a significant causality if there is significant causality in at least one of the lags tested. We adjusted the p-values with a Bonferroni correction to control for multiple hypotheses testing.
6.3 Functional Forms Tested
Functional forms referenced in Table 1 were used as following.
6.3.1 Differencing: .
The first differencing is taken in both social media and returns time series.
The second differencing was tested in analogous way.
Represents a regression of returns on social media controlled by the stocks’ returns daily volatility.
where we consider
as an approximation of the daily returns volatility. and are the highest and lowest intraday price value, respectively.
6.3.3 Log-transformation: .
6.3.4 Absolute value: .
A GARCH filtering was applied in the original returns time series as follows:
with , and
The resulting residuals were then used instead of the original returns time series .
ARIMA filtering was applied in the original returns time series as follows:
The resulting residuals were then used instead of the original returns time series .
6.4 Nonparametric G-Causality: Transfer Entropy
Transfer Entropy (TE) was estimated as a sum of Shannon entropies:
where is a forward time-shifted version of at lag relatively to the contemporaneous time-series and . We reject the null hypothesis of causality if the Transfer Entropy from social media to stocks’ returns is significant. To remain in a nonparametric framework, the statistical significance of TE was performed using surrogate data. In that way, 400 replicates of were estimated, where is a random permutation of relatively to . We computed the randomized Transfer Entropy at each permutation for each time-shift () from 1 to 10 days. We then calculated the frequency at which the observed Transfer Entropy was equal or more extreme than the randomized Transfer Entropy of the surrogate data. Statistical significance was given at p-value . p-values were also Bonferroni corrected.
The estimation of the empirical probability density distribution, required for the entropy estimation, was performed using a Kernel Density Estimation (KDE) method, which has several advantages over the commonly used Histogram based methods (see SI.B.2).
6.5 Net Information Flow
The Net Information Flow from social media to the stock market is defined as: . For the nonlinear case, transfer entropy was computed as defined in the previous Section 6.4. Instead, to estimate a linear version of Net Information Flow, we compute Transfer Entropy for the linear case based on the work of . This work provides a direct mapping between Transfer Entropy and the linear G-causality implemented in the standard VAR framework. The authors showed that Transfer Entropy and linear G-causality are equivalent for Gaussian variables.
Particularly, assuming the standard measure of linear G-causality for the bivariate case as
 shows that:
if all processes ( and ) are jointly Gaussian.
This work was supported by PsychSignal.com, which provided the social media analytics. T.A. acknowledges support of the UK Economic and Social Research Council (ESRC) in funding the Systemic Risk Centre (ES/K002309/1). T.T.P.S. acknowledges financial support from CNPq - The Brazilian National Council for Scientific and Technological Development.
-  Fama, E.F.: Efficient capital markets: A review of theory and empirical work. The Journal of Finance 25(2) (1970) 383–417
-  Shleifer, A.: Inefficient Markets: An Introduction to Behavioral Finance. Clarendon Lectures in Economics. OUP Oxford (2000)
-  Brooks, C.: Testing for non-linearity in daily sterling exchange rates. Applied Financial Economics 6(4) (1996) 307–317
-  Tetlock, P.C.: Giving content to investor sentiment: The role of media in the stock market. The Journal of Finance 62(3) (2007) 1139–1168
-  Tetlock, P.C., Saar-Tsechansky, M., Macskassy, S.: More than words: Quantifying language to measure firms’ fundamentals. The Journal of Finance 63(3) (2008) 1437–1467
-  Alanyali, M., Moat, H.S., Preis, T.: Quantifying the relationship between financial news and the stock market. Sci. Rep. 3 (2013)
-  Lillo, F., Miccichè, S., Tumminello, M., Piilo, J., Mantegna, R.N.: How news affects the trading behaviour of different categories of investors in a financial market. Quantitative Finance 15(2) (2015) 213–229
-  Luss, R., d’Aspremont, A.: Predicting abnormal returns from news using text classification. Quantitative Finance (March 2012)
-  Mao, H., Counts, S., Bollen, J.: Predicting financial markets: Comparing survey, news, twitter and search engine data. ArXiv e-prints (2011)
-  Heston, S.L., Sinha, N.R.: News versus sentiment: Comparing textual processing approaches for predicting stock returns. Robert H. Smith School Research Paper (2014)
-  Ranco, G., Bordino, I., Bormetti, G., Caldarelli, G., Lillo, F., Treccani, M.: Coupling news sentiment with web browsing data predicts intra-day stock prices. (2014)
-  Groß-Klußmann, A., Hautsch, N.: When machines read the news: Using automated text analytics to quantify high frequency news-implied market reactions. Journal of Empirical Finance 18(2) (2011) 321 – 340
-  Li, Q., Wang, T., Li, P., Liu, L., Gong, Q., Chen, Y.: The effect of news and public mood on stock movements. Information Sciences 278 (2014) 826 – 840
-  Chan, W.S.: Stock price reaction to news and no-news: drift and reversal after headlines. Journal of Financial Economics 70(2) (2003) 223 – 260
-  Zhang, W., Skiena, S.: Trading strategies to exploit blog and news sentiment. In: In Fourth Int. Conf. on Weblogs and Social Media (ICWSM), 2010. â 186. (2010)
-  Curme, C., Preis, T., Stanley, H.E., Moat, H.S.: Quantifying the semantics of search behavior before stock market moves. Proceedings of the National Academy of Sciences (2014)
-  Preis, T., Reith, D., Stanley, H.E.: Complex dynamics of our economic life on different scales: insights from search engine query data. Philosophical Transactions of the Royal Society of London A: Mathematical, Physical and Engineering Sciences 368(1933) (2010) 5707–5719
-  Preis, T., Moat, H.S., Stanley, H.E.: Quantifying Trading Behavior in Financial Markets Using Google Trends. Scientific Reports 3 (April 2013)
-  Mao, H., Counts, S., Bollen, J.: Quantifying the effects of online bullishness on international financial markets. European Central Bank Workshop on Using Big Data for Forecasting and Statistics, Frankfurt, Germany (2014)
-  Bordino, I., Battiston, S., Caldarelli, G., Cristelli, M., Ukkonen, A., Weber, I.: Web search queries can predict stock market volumes. PLoS ONE 7(7) (07 2012) e40014
-  Da, Z., Engelberg, J., Gao, P.: In search of attention. The Journal of Finance 66(5) (2011) 1461–1499
-  Moat, H.S., Curme, C., Avakian, A., Kenett, D.Y., Stanley, H.E., Preis, T.: Quantifying wikipedia usage patterns before stock market moves. Scientific Reports Volume 3 (May 2013) Article number 1801
-  Bollen, J., Mao, H., Zeng, X.: Twitter mood predicts the stock market. Journal of Computational Science 2(1) (2011) 1 – 8
-  Zheludev, I., Smith, R., Aste, T.: When Can Social Media Lead Financial Markets? Scientific Reports 4 (February 2014)
-  Sprenger, T.O., Sandner, P.G., Tumasjan, A., Welpe, I.M.: News or Noise? Using Twitter to Identify and Understand Company-specific News Flow. Journal of Business Finance & Accounting 41(7-8) (09 2014) 791–830
-  Ranco, G., Aleksovski, D., Caldarelli, G., Grc̆ar, M., Mozetic̆, I.: The effects of twitter sentiment on stock price returns. PLoS ONE 10(9) (09 2015) e0138441
-  Yang, S.Y., Mo, S.Y.K., Zhu, X.: An empirical study of the financial community network on twitter. 2014 IEEE Conference on Computational Intelligence for Financial Engineering & Economics (2014)
-  Sehgal, V., Song, C.: Sops: Stock prediction using web sentiment. In: Proceedings of the Seventh IEEE International Conference on Data Mining Workshops. ICDMW ’07, Washington, DC, USA, IEEE Computer Society (2007) 21–26
-  Antweiler, W., Frank, M.Z.: Is all that talk just noise? The information content of internet stock message boards. Journal of Finance 59(3) (2004) 1259–1294
-  Sprenger, T.O., Sandner, P.G., Tumasjan, A., Welpe, I.M.: News or Noise? Using Twitter to Identify and Understand Company-specific News Flow. Journal of Business Finance & Accounting 41(7-8) (09 2014) 791–830
-  Nasseri, A.A., Tucker, A., de Cesare, S.: Quantifying stocktwits semantic terms’ trading behavior in financial markets: An effective application of decision tree algorithms. Expert Syst. Appl. 42(23) (2015) 9192–9210
-  Al Nasseri, A., Tucker, A., de Cesare, S.: Big data analysis of stocktwits to predict sentiments in the stock market. In Dz̆eroski, S., Panov, P., Kocev, D., Todorovski, L., eds.: Discovery Science. Volume 8777 of Lecture Notes in Computer Science. Springer International Publishing (2014) 13–24
-  Liu, L., Wu, J., Li, P., Li, Q.: A social-media-based approach to predicting stock comovement. Expert Syst. Appl. 42(8) (May 2015) 3893–3901
-  Souza, T.T.P., Kolchyna, O., Treleaven, P.C., Aste, T.: Twitter sentiment analysis applied to finance: A case study in the retail industry. arXiv preprint. http://arxiv.org/abs/1507.00784 (2015)
-  SEC: U.S. Securities and Exchange Commission. SEC says social media ok for company announcements if investors are alerted. http://1.usa.gov/1zFxUPa (April 2013) Last accessed on Jan 29, 2015.
-  Kolchyna, O., Souza, T.T.P., Treleaven, P., Aste, T.: Twitter sentiment analysis: Lexicon method, machine learning method and their combination. arXiv preprint. http://arxiv.org/abs/1507.00955 (2015)
-  PsychSignal: Website. https://www.psychsignal.com. Last accessed on Jan 18, 2016.
-  Wiener, N.: The theory of prediction. In Beckenbach, E.F., ed.: Modern mathematics for engineers. McGraw-Hill, New York (1956)
-  Granger, C.: Investigating causal relations by econometric models and cross-spectral methods. Econometrica 37(3) (1969) 424–38
-  Brock, W.A., Scheinkman, J.A., Dechert, W.D., LeBaron, B.: A test for independence based on the correlation dimension. Econometric Reviews 15(3) (January 1996) 197–235
-  Barnett, W.A., Gallant, A.R., Hinich, M.J., Jungeilges, J.A., Kaplan, D.T., Jensen, M.J.: A single-blind controlled competition among tests for nonlinearity and chaos. Journal of Econometrics 82 (1997) 157–192
-  Schreiber, T.: Measuring information transfer. Phys. Rev. Lett. 85 (Jul 2000) 461–464
-  Hlavackovaschindler, K., Palus, M., Vejmelka, M., Bhattacharya, J.: Causality detection based on information-theoretic approaches in time series analysis. Physics Reports 441(1) (March 2007) 1–46
-  Montalto, A., Faes, L., Marinazzo, D.: Mute: A matlab toolbox to compare established and novel estimators of the multivariate transfer entropy. PLoS ONE 9(10) (10 2014) e109462
-  Michalowicz, J.V., Nichols, J.M., Bucholtz, F.: Handbook of Differential Entropy. Chapman & Hall/CRC (2013)
-  Barnett, L., Barrett, A.B., Seth, A.K.: Granger causality and transfer entropy are equivalent for gaussian variables. Phys. Rev. Lett. 103 (Dec 2009) 238701
-  Silverman, B.W., Green, P.J.: Density Estimation for Statistics and Data Analysis. Chapman and Hall, London (1986)
-  Sheather, S.J., Jones, M.C.: A reliable data-based bandwidth selection method for kernel density estimation. Journal of the Royal Statistical Society. Series B (Methodological) 53(3) (1991) pp. 683–690
-  Scott, D.: Multivariate Density Estimation: Theory, Practice, and Visualization. A Wiley-interscience publication. Wiley (1992)
Appendix SI.A Material
si.a.1 List of Companies Analyzed
The name of the investigated stocks with respective Reuters Instrument Codes (RIC) follow: INTEL CORP. (INTC.O), VISA INC. (V.N), NIKE INC. (NKE.N), E.I. DUPONT DE NEMOURS & CO. (DD.N), JPMORGAN CHASE & CO. (JPM.N), BOEING CO. (BA.N), MERCK & CO. INC. (MRK.N), PFIZER INC. (PFE.N), MICROSOFT CORP. (MSFT.O), COCA-COLA CO. (KO.N), GOLDMAN SACHS GROUP INC. (GS.N), MCDONALD’S CORP. (MCD.N), GENERAL ELECTRIC CO. (GE.N), 3M CO. (MMM.N), UNITED TECHNOLOGIES CORP. (UTX.N), VERIZON COMMUNICATIONS INC. (VZ.N), CISCO SYSTEMS INC. (CSCO.O), HOME DEPOT INC. (HD.N), INTERNATIONAL BUSINESS MACHINES CORP. (IBM.N), AMERICAN EXPRESS CO. (AXP.N), PROCTER & GAMBLE CO. (PG.N), APPLE INC. (AAPL.O), UNITEDHEALTH GROUP INC. (UNH.N), CATERPILLAR INC. (CAT.N), EXXON MOBIL CORP. (XOM.N), JOHNSON & JOHNSON (JNJ.N), WAL-MART STORES INC. (WMT.N), WALT DISNEY CO. (DIS.N), CHEVRON CORP. (CVX.N) and THE TRAVELERS COMPANIES INC. (TRV.N).
si.a.2 Twitter Data Analytics
Twitter data analytics were provided by PsychSignal.com . The data are comprised of volume measures and sentiment analytics. Twitter messages are classified in two dimensions according to their likelihood of bullishness and bearishness towards a company. A company is defined to be related to a given message if its ticker is mentioned. The data set are based on English language content and it is agnostic to the country source of the Twitter message. The information is aggregated in a daily fashion and it is composed of the following variables:
symbol: the stock symbol (ticker) for which the sentiment data refer to;
timestamp_utc: date and time of the analyzed data in UTC format;
bull_scored_messages: this indicator is the total count of bullish sentiment messages;
bear_scored_messages: this indicator is the total count of bearish sentiment messages.
Some messages may be classified as “neutral” or at least not having relevant bullish or bearish tones. Those types of messages do not affect the bull_scored_messages and bear_scored_messages scores. It is also possible that no messages cite a company in a given day. In that case, the scores are zero.
Table SI.A shows an example of the Twitter sentiment analytics for the company APPLE INC. Table SI.B shows a summary description of the selected companies with the number of bearish/bullish Twitter messages identified in the period.
|Bullish messages||Bearish messages|
|Ticker||Total||Daily mean||Total||Daily mean||Total Messages|
Appendix SI.B Transfer-Entropy Estimation
si.b.1 Definitions of information theoretic measures
Let be a random variable and its probability density function (pdf). The entropy is a measure of uncertainty of , and is defined in the discrete case, as:
If the is taken to base two, then the unit of is the bit (binary digit). Here, we employ the natural logarithm which implies the unit in nat (natural unit of information).
Given a coupled system , where is the pdf of the random variable and the joint pdf between and , the joint entropy is given by:
The conditional entropy is defined by:
We can interpret as the uncertainty of given a realization of .
Transfer Entropy can be defined as a difference between conditional entropies:
which can be rewritten as a sum of Shannon entropies:
where is a forward time-shifted version of at lag relatively to the contemporaneous time-series and .
si.b.2 Kernel Density Estimation
In the entropy computation, the empirical probability distribution must be estimated. Histogram based methods and kernel density estimations are the two main methods for that. Histogram-based is the simplest and most used nonparametric density estimator. Nonetheless, it yields density estimates that have discontinuities and vary significantly depending on the bin’s size choice.
Also known as Parzen-Rosenblatt window method, the kernel density estimation (KDE) approach approximates the density function at a point using neighboring observations. However, instead of building up the estimate according to bin edges as in histograms, the KDE method uses each point of estimation as the center of a bin of width and weight it according to a kernel function. Thereby, the kernel estimate of the probability density function is defined as
A usual choice for the kernel , which we use here, is the (Gaussian) radial basis function:
The problem of selecting the bandwidth in equation (23) is crucial in the density estimation. A large will over-smooth the estimated density and mask the structure of the data. On the other hand, a small bandwidth will reduce the bias of the density estimate at the expense of a larger variance in the estimates. If we assume that the true distribution is Gaussian and we use a Gaussian kernel, the optimal value of that minimizes the mean integrated squared error (MISE) is
where is the total number of points and can be estimated as the sample standard deviation. This bandwidth estimation is often called Gaussian approximation or Silverman’s rule of thumb for kernel density estimation . This is the most common used method and it is here employed. Other common methods are given by Sheather and Jones  and Scott .
Appendix SI.C Results of the BDS and causality tests