Social Media Would Not Lie: Prediction of the 2016 Taiwan Election via Online Heterogeneous Data

Social Media Would Not Lie: Prediction of the 2016 Taiwan Election via Online Heterogeneous Data

Zheng Xie, Guannan Liu and Junjie Wu 1. School of Economics and Management, Beihang University, Beijing 100191, China
2. Beijing Advanced Innovation Center for Big Data and Brain Computing, Beihang University, Beijing 100191, China
Corresponding author:

The prevalence of online media has attracted researchers from various domains to explore human behavior and make interesting predictions. In this research, we leverage heterogeneous social media data collected from various online platforms to predict Taiwan’s 2016 presidential election. In contrast to most existing research, we take a “signal” view of heterogeneous information and adopt the Kalman filter to fuse multiple signals into daily vote predictions for the candidates. We also consider events that influenced the election in a quantitative manner based on the so-called event study model that originated in the field of financial research. We obtained the following interesting findings. First, public opinions in online media dominate traditional polls in Taiwan election prediction in terms of both predictive power and timeliness. But offline polls can still function on alleviating the sample bias of online opinions. Second, although online signals converge as election day approaches, the simple Facebook “Like” is consistently the strongest indicator of the election result. Third, most influential events have a strong connection to cross-strait relations, and the Chou Tzu-yu flag incident followed by the apology video one day before the election increased the vote share of Tsai Ing-Wen by 3.66%. This research justifies the predictive power of online media in politics and the advantages of information fusion. The combined use of the Kalman filter and the event study method contributes to the data-driven political analytics paradigm for both prediction and attribution purposes.

Election Prediction Heterogeneous Data Kalman Filter Event Study Method Social Media

1 Introduction

Recent years have witnessed the rapid development of social media and their innovative applications in many fields asur2010predicting (). For instance, it has been found that the volumes of tweets related to protests on Twitter are associated with real-life protest events steinert2015online (). Moreover, film mentions on Twitter can reflect box office revenues asur2010predicting (). Additionally, public moods extracted from tweets can predict changes in stock markets bollen2011twitter (), and a real-time earthquake reporting system was developed by analyzing only tweets sakaki2013tweet ().

The unprecedented prevalence of social media has driven politicians to make use of this channel to propagate their ideas and political views metaxas2012social (); effing2011social (); graham2013between (); enli2013personalized () to more directly approach potential voters. It is not unusual to see election candidates post their daily activities and political ideas on social media and even debate on social media before and during the campaign. These behaviors can attract online discussion from massive numbers of netizens and, compared with traditional polls, are an easier way to gather wide-ranging public opinions about the candidates. Some research has shown the predictability of election results based on social media information in various countries and regions, including the United States williams2008social (); lui2011predictability (); digrazia2013more (); macwilliams2015forecasting (), the United Kingdom franch2013wisdom (); burnap2015140 (), Germany tumasjan2010predicting (), the Netherlands sang2012predicting (), and Korea song2014analyzing (),where netizens’ behaviors and posts on social media were analyzed to infer the election results.

The existing research, however, usually exploits a single information source and uses simple descriptive statistics for election predictions, which easily results in hindsight bias and lacks generality. The way to ameliorate these issues is two-fold. On one hand, multiple sources should be included to obtain heterogeneous information for robust predictions. For instance, the keywords searched in Google represent the attention of the public, and the aggregated volumes can be used to predict the trends of influenza kang2013using (), stock markets preis2013quantifying (); curme2014quantifying (), consumer behaviors goel2010predicting (), etc. On the other, massive heterogeneous data obtained in real time are often too chaotic to provide consistent predictions; therefore, a method that can fuse the data and deliver robust predictions is indispensable. Our work in this paper is a novel attempt on this front.

We take Taiwan’s 2016 presidential election as a real-life case. Taiwan adopted direct election in 1996, and since then, Kuomintang (KMT) and the Democratic Progressive Party (DPP) have become the two major competing political parties. KMT pursues a “One China Policy” and the political legitimacy of the “Republic of China”, whereas DPP takes “Taiwan Independence” as its party program. In 2016, three candidates ran for the presidential election, including Eric Chu from KMT, Tsai Ing-wen from DPP, and James Soong from the People First Party (PFP). The election regulations adopt the “one man one vote” principle and execute the majority rule fell2005party ().

This research leverages time series data collected from various mainstream online platforms (i.e., Facebook, Twitter and Google) and visitation traffic to candidates’ campaign pages. These heterogeneous signals represent public opinions and are fed into a Kalman filter kalman1960new () to estimate the vote shares of each candidate dynamically. The most efficient signals are then identified based on the signal strengths characterized by the Kalman gain. In addition to prediction, this research attempts to automatically identify the events that most influenced the election by leveraging the event study model mackinlay1997event () that originated in the field of financial research.

The results show that the prediction errors for every candidate one day, week, and month before the election are no greater than 2.59%, 4.58% and 5.87%, respectively. The results include some interesting findings. First, online signals appear to be more accurate than traditional polls in election prediction, although the polls can still function on mitigating the sample bias of netizens. In particular, a simple Facebook“Like” on a candidate’s post is the most significant predictor, whereas the seemingly more informative “Comments” function is much less important. Second, online signals show clear convergence as the final election day approaches. For example, Google keyword searches fluctuated initially but became a strong indicator in the final stage. Third, bursty events most influential to the campaign have a strong relationship with the cross-strait relation topics. For instance, while the Xi-Ma meeting reduced support of Tsai Ing-wen by 0.55%, the Chou Tzu-yu flag incident followed by the apology video one day before the election increased her votes by 3.66%.

2 Data and Measurements

To identify the most popular Internet applications in Taiwan, we referred to professional Internet surveys111Internet Usage in Taiwan: Summary Report of October 2015 Survey. and web traffic reports from Alexa, comScore and Digital Age (see SI, TABLE 1). We selected Facebook, Twitter, Google, and candidates’ campaign homepages as the “online sensors” of public opinions towards the election and designed various daily updated measurements to characterize the signals during the period from Oct. 31, 2015 to Jan. 16, 2016 consecutively. A 30-day moving average was applied to each measure to avoid excessive fluctuation.

Facebook. Facebook is the most popular social platform in Taiwan and provides an easy way for candidates to reach out to a large audience. For each post by a candidate, users can click the “Like” tag to indicate a positive reaction. Hence, we can use the “daily average number of Likes per post” to measure a candidate’s popularity:


where is the number of Likes of post published by candidate on day , is the total number of the candidate’s posts, and is the window length of the moving average. Analogously, we compute the “daily average number of Comments per post” for each candidate as another signal from Facebook:


where is the number of comments on post published by candidate on day .

Twitter. We use three candidates’ names in both Simplified and Traditional Chinese as keywords(See SI, Sect.1.2) to retrieve tweets from Twitter. The measurement “number of tweets mentioning the candidate” is calculated as


where is the volume of tweets about candidate on day .

Search Engine. We also obtained search data from Google Trends to trace the evolution of a keyword’s search volume. We used the three candidates’ names in both Simplified and Traditional Chinese as keywords and restricted the search source to Taiwan. The measurement “search index ratio” is defined as


where is the aggregated search indexes of keywords about candidate on day .

Campaign Homepages. We collected the daily traffic to candidates’ campaign homepages data from Alexa, and used the “IP traffic ratio” as an opinion measure as follows:


where is the IP traffic volume to candidate ’s campaign homepage on day .

The above measurements convey different signals for continuous election prediction. We also collected offline election polls published by nineteen authoritative pollsters during the period from Aug. 1, 2015 to Jan. 16, 2016 (see SI, Sect. 1.1) for comparison. These polls were published aperiodically and infrequently, so we assume the opinions from a poll remain unchanged until a new poll has been released.

3 Methods

3.1 Vote Prediction Model

The goal of election prediction is to infer the underlying vote shares of various candidates based on heterogeneous noisy signals. A model that can fuse the signals in such a way to debias the prediction from noise and make dynamic predictions to reflect the evolution of public opinion is desired. We exploit the Kalman filter, a linear dynamic model, for this purpose. The filter was adopted in jackman2005pooling (); fisher2011polls (); walther2015picking () for election analysis, but previous studies were mostly based on polls and assumed only two candidates.

In general, a Kalman filter maps hidden states to observed variables with noise, and the current hidden states are assumed to transition from previous states with noise. That is,


where is a vector that maps the hidden state to observed multiple signals in , is the state transition coefficient, and is the initial value of the hidden state. and denote independent Gaussian random noise.

In our case, is the genuine vote share of candidate on day , and contains the observed multiple signals. We set and for scale equivalence of the variables. The initial vote is set as the latest poll result of TISR (see SI, Sect. 2.1), with to allow fluctuation. Nevertheless, the final prediction is insensitive to the initial values when the time series is sufficiently long (see SI, Sect. 2.2 and Sect. 2.3).

The remaining challenge is to estimate the noise parameters and . To reduce the model complexity, we assume and , . The maximum a posteriori estimation can then be obtained by maximizing the conditional density function:


with and . Accordingly (see SI, Sect. 2.1),


where is the estimated variance of .

3.2 Event Detection Method

Twitter, as an online plaza, aggregates information about different candidates during an election campaign. The volatility of tweets can thus signal influential events. A three-step detection method is designed as follows. Step I is to perceive events based on massive numbers of tweets. To this end, we watch the statistic , i.e., the number of tweets about candidate on day , and trace its volatility in the past days by comparing it with an upper bound , where is the average of on days and is the standard deviation. Based on a t-test with significance level , there exists an influential event if surpasses . We assume that only one new event is dominant in each burst, which is reasonable for political campaigns.

Step II is to estimate the event time window. The daily tweets about each candidate are first integrated into a single document; then, the terms in the document are weighted by the tf-idf method(see SI, Sect. 3.1). The 30 terms with the highest weights in the burst are selected as the typical words for that event. We then proceed to check the overlaps of typical words on the burst day plus or minus five days. The first day with non-zero overlap is deemed to be the start day of the event, and the last day with non-zero overlap is the closing day, which defines the event time window (see SI, TABLE 9, TABLE 10, and TABLE 11). We remove suspicious events with a time window of one day.

Step III is to measure the impact of events on public opinion. We denote the estimated initially transited from the previous day as (see transition function in (6)) and the final calibrated with multiple signals as (see mapping function in (6)). Intuitively, has absorbed the information about all pertinent events on day ; hence, the change from (equaling for and ) to indicates the impact of an event. To measure the significance of the impact, we apply the event study model Binder1998The () from the field of finance as follows:


where is a dummy variable equal to 1 if day is within the time window of event for candidate and is equal to 0 otherwise. is the total number of events detected for candidate , and is a regression constant. is the estimator of the effect of event on candidate , which passes the t-test if event has a significant effect on public opinion (see SI, TABLE 12, TABLE 13, and TABLE 14). In this way, we can identify the events that actually influence the election.

4 Results

4.1 Prediction Performance

Figs. 1(a)-(c) show various online signals two months before election day. Intuitively, the user behavior in different channels is related to the public opinion towards a candidate, but the signals have vastly different volatilities. This justifies the value of information fusion for election prediction.

Figure 1: Signals of public opinions from all the online channels for the three candidates.
Figure 2: Time series of the vote share predictions. The dashed lines are the actual election outcomes. On election day, the errors are less than 2.59%.

Fig. 2 depicts the dynamic vote predictions after fusing the four types of online signals, i.e., , , and , by the Kalman filter. Although the four signals behave differently, the fused signal representing the predicted vote share for each candidate is relatively stable and exhibits a clear tendency, confirming the effectiveness of the prediction system for information aggregation. The final result is impressive — while Tsai’s win is easy to predict even in October, the prediction errors for every candidate one day, week, and month before the election day are no greater than 2.59%, 4.58% and 5.87%, respectively.

To further justify the predictive power of online signals, we also compare our results with offline polls. As shown in Fig. 3, during the last two weeks of the election, our predictions (M1) outperform most of the pollsters (P1-P10) greatly, and can improve continuously by absorbing up-to-date information. This is possibly due to the fact that the anonymity of the Internet enables individuals to express their opinions freely and voluntarily, which could reduce the bias relative to that in the tele-interview setting of a traditional poll. Furthermore, currently, news usually breaks online first and then spreads at a tremendously fast pace from online to offline via physical social networks. Therefore, online information can also influence offline voting blocs during campaigns, which mitigates the bias effect of using only the netizen population in our method.

We also try to reduce the sample bias by mixing the prediction results from online signals with those from offline pollsters in older groups (see SI, Sect. 2.4). As shown in Fig. 3, the online-offline data fusion method (M2) indeed outperforms the online data fusion method (M1) in the early stage of the final two weeks, which indicates the power of sample bias correction. But the advantage disappears gradually as the final election day approaches, which again exposes the drawback of offline polls in responding to newly emerging information.

Figure 3: Timeline of the absolute prediction errors of final polls and data fusion methods. The bars on the left side of the timeline represent the prediction errors of the data fusion methods. In each interval between two gray dashed lines, there are two bars. The lower bar represents the absolute error of the online data fusion method, and the upper bar represents the absolute error of the online-offline data fusion method. The interval between two gray horizontal dashed lines indicates one day. The bars on the right side of the timeline show the prediction errors of the final polls from ten pollsters. Comparison of the bars on both sides shows that the absolute prediction errors of the signal fusion methods are smaller than those of the polls.

4.2 Signal Evaluation

We also explore the predictive power of various online signals via their daily Kalman gains. As shown in Fig. 4, Facebook “Likes” are consistently the strongest indicator among all the signals. This demonstrates the power of social media in collecting public opinions via a simple mechanism, although it is vulnerable to shilling attacks. The predictive power of the Google index appears to be time-sensitive, contributing less initially and becoming the second best indicator one month before the election. One possible explanation is that the election might not be a focal topic in the early stage of the campaign, making Google searches rather random. However, as the election day approaches, the campaign becomes the central topic and drives the public to search for information about the candidates. The two remaining signals, i.e., tweet volumes and homepage traffic, appear to be of much weaker predictive value, which may be due to their lack of popularity in Taiwan (see SI, TABLE 1) and diverse attitudes about candidates.

We further explore the distinct value of the “Like” function on Facebook. We compare it with the “Comment” function by substituting with in the Kalman filter. The results indicate that the prediction outcomes become significantly worse — the one-day-earlier prediction errors for Tsai and Chu increase to 5.42% and 4.86%, respectively(see SI,Sect. 2.5). These results indicate the superiority of “Like” over “Comment”. To understand this result, we search for the population of Facebook users who have ever liked or commented on the candidates and obtain the overlapping users who have both liked and commented on a candidate. Fig. 5 shows that these users constitute only a small proportion of the “Like” users but a much larger proportion of the “Comment” ones. Therefore, a considerable proportion of users who have commented on a post may also choose to like the post but not vice versa. In other words, the “Like” signal represents the positive attitude of a much larger population than that of the “Comment” signal, which may be attributed to the fact that a “Like” is a more direct and widely engaged in behavior for online users to express their positive opinions without great effort. Another disadvantage of “Comment” lies in its diversity of expression, which can be a blend of contradictory attitudes, including support, praise, opposition and even insult (see SI, Sect. 2.6).

Figure 4: Kalman gain for different online signals. The Kalman gain of the Facebook "Like" constitutes the highest proportion but gradually decreases while the Google signal continuously increases. Twitter and the campaign homepages are not indicative signals for the election. The Kalman gains of all the signals converge to steady states approximately one month before the election.
Figure 5: Proportions of overlapping users who have both liked and commented on the candidates’ posts among "Likers" and "Commentators".The intermediate vertical axis is a timeline covering the whole period of the election. The bar on the left side of the timeline represents the daily proportion of overlapping users to users who have ever liked. The bar on the right side of the timeline represents the daily proportion of overlapping users to users who have ever commented. The number of overlapping users accounts for less than 1% of all the users who have “liked” on average, with the maximum proportions being 3.51%, 3.74%, and 9.25% for the three candidates. By contrast, the overlapping users constitute more than 37.16%, 14.90%, and 12.03% of all users who have commented, on average, for the three candidates, and the maximum ratios are 73.05%, 59.75%, and 83.01%.

The overlapping users indeed constitute a group of firm supporters for each candidate who show their support by not only clicking “Like” but also going through the effort to publish comments. By further tracking the changes in the overlap ratios during the election, as shown in Fig. 5, we find that the ratio for Tsai is relatively stable, indicating that Tsai has a firm group of supporters regardless of her behavior during the campaign. By contrast, for Chu and Soong, the overlap ratios remain small until election day approaches, suggesting Tsai should partially attribute her success to her firm supporters rather than swing voters. This also explains why we can predict the victory of Tsai two months before election day.

Figure 6: Detected events and their influence on potential vote shares. The numbers of detected events during the elections are 8, 7, and 6, respectively, for the Tsai, Chu, and Soong. Each event spans a time window and influences the potential voting rates differently, as denoted by different colors. A light purple bar indicates that the detected event does not have a significant influence on the vote shares. A red bar indicates a positive effect of the event on vote shares, and a blue bar represents a negative effect of the event. The influence of each significant event is marked on the curve, and the number below it in brackets is the p-value of the t-test. The typical words used to determine the event timespan are detailed in SI,TABLE 9, TABLE 10, and TABLE 11. In addition, the Twitter bursty days detected in Step I are noted in the Twitter volume time series. The red points represent events with a timespan longer than one day, which are fed into Step II for further analysis. The blue points are removed.

4.3 Influential Events

We apply the event detection method to each candidate’s Twitter data to identify influential events. Fig. 6 shows the results and event descriptions. The most influential events detected with -values less than 0.05 include the meeting between Xi Jinping and Ma Ying-jeou (Xi-Ma Meeting), the emergence of negative comments on Tsai Ing-wen’s Facebook homepage possibly by users from mainland China, and the Chou Tzu-yu flag incident. All these events share a common feature; that is, they all belong to the category of cross-strait relation, which is always subtle and controversial in Taiwan’s political circle. Other seemingly important events from the perspective of the election campaign, such as the TV broadcast of the candidates’ debates and various types of electioneering activities in local areas, have insignificant influences on public opinion.

We further assess the influence level of the events, which is measured by the coefficient in (9). The Xi-Ma Meeting resulted in a 0.55% decrease in the vote share of Tsai Ing-wen. This result is not surprising because Tsai was believed to favor Taiwan independence over the “One China Policy”, and the meeting thus prompted the public to doubt Tsai’s ability to handle cross-strait relations. This same event increased Eric Chu’s vote share by 0.58% because he was thought to be more able to develop cross-strait peace after the meeting.

Despite the abundance of events during the campaign, the Chou Tzu-yu flag incident from the entertainment domain is the most influential. Chou Tzu-yu, a 16-year-old Taiwan singer, sparked huge controversy in social media for showing the Taiwan flag as the national flag of China. As the uproar intensified online, Chou’s company released a video in which Chou apologized for her behavior by stating that “there is only one China” and identifying herself as Chinese. The most subtle point is that the video was released the day before the election, which was described as a humiliation to Taiwan and spread quickly in Taiwan’s online social media. As a consequence, this incident increase the vote share of Tsai Ing-wen by approximately 3.66% and lowered the vote share of Eric Chu by approximately 2.62%.

5 Discussion

The accurate prediction of Taiwan’s 2016 Presidential Election suggests an interesting viewpoint that public opinions towards political campaigns can be determined via online user-generated content. This indeed coincides with some recent studies reporting that social media such as Facebook effing2011social (); enli2013personalized (); williams2008social (); macwilliams2015forecasting (); franch2013wisdom (), Twitter steinert2015online (); metaxas2012social (); effing2011social (); enli2013personalized (); franch2013wisdom (); graham2013between (); digrazia2013more (); burnap2015140 (); tumasjan2010predicting (); sang2012predicting (); song2014analyzing () and Youtube effing2011social () are able to aggregate public opinions about political matters. Donald Trump winning the 2016 US Presidential Election was also considered to be a victory for the heavy use of social media such as Twitter Yaqub2017Analysis (). Nevertheless, this finding remains controversial in academia, and the above studies have often been criticized for the unreliability of single-source information You2015A () and/or the unrepresentativeness of online user populations Gayo2011Limits (). Our study attempts to address these concerns.

First, we introduce multiple online channels as different types of signals to produce more robust predictions. These signals, while reflecting more or less latent public opinions, have varied fluctuations due to their different sensitivities to campaign dynamics and possible fake responses from the Internet “water army” (see Fig. 1). The fusion of these signals can help to filter out some noise by consensus learning to highlight the tendencies. Moreover, although one signal might contribute more to some specific election prediction, such as the Facebook “Like” for the Taiwan election, it is unlikely to find it omnipotent for different elections. The fusion of these signals could help to mitigate the risk of selection bias. This information fusion scheme gives our study some important extensibility — the four channels, namely, Facebook, Twitter, Google Trends and campaign homepages, could be considered to be the fundamental and preemptive online information sources for different elections.

We also find that although selection bias of the online voting population exists, its influence on the prediction results is limited. Prediction based on pure online information is much more accurate than the polls released by Taiwan’s mainstream pollsters (see Fig. 3). The reason behind this may be two-fold. On one hand, online users who pay close attention to election campaigns likely become active voters and constitute a large voting population on election day Gopoian1994Late (); Henderson2016Changing (). On the other hand, we should not underestimate the information exchange between online social networks and offline physical networks Bond2012A (); Kramer2014Experimental (). Older people who seldom interact with the Internet still have access to online information via ordinary family communications or traditional media’s reports on Internet opinions. This communication contributes to the opinion conformance across online and offline networks and further improves the representativeness of the online voting population. In fact, compared with traditional polls, which are susceptible to questionnaire wording Bryan2011Motivating (), reporting error Rogers2016Unacquainted (), ballot order Wang2014Context (), and social desirability bias Rogers2016Unacquainted (); Rand2009Dynamic (), online big data enables a much larger sample and thus can improve the sample resistance to human manipulation. The real-time availability of online data, which enables the timely update of predictions based on continuously incoming information, is another major advantage relative to polls.

Our study also suggests that the Kalman filter with the event detection model (see Materials and Methods) could be packaged as a fundamental kit for political vote analytics. Specifically, the Kalman filter is responsible for the dynamic prediction of vote shares given multi-source time-varying signals and multiple candidates. Meanwhile, the event detection model is responsible for the automatic identification of influential events during the campaign, which provides a causal explanation for the predictions. In other words, the two models together could provide interpretable predictions to political vote analytics, which is deemed particularly valuable for a big-data-driven research paradigm Hofman2017Prediction ().

The Kalman filter has been adopted in previous studies but either for backward review given the final result or for forward prediction given multiple historical elections data. Our study shows that while we cannot obtain the true vote shares until election day, we can still fine-tune the model parameters by using up-to-date time series signal data for the current election, which solves the problems in leveraging the Kalman filter for election prediction. Moreover, given the sum-to-one constraint in a statistical learning framework (see (8)), the Kalman filter is capable of building models for more than two election candidates. One may consider the inclusion of some other relatively stable factors, such as the globalization trend, economic status, the technology environment, etc., in the prediction model, which can be achieved by setting appropriate initial values of the Kalman filter. Nevertheless, our study shows that the Kalman filter is insensitive to the initial values as long as the prediction is based on a sufficiently long time series (see SI,Sect 2.2). In this case, the signals should have fully “absorbed” the influences of the macro factors.

Our study provides some political insight into the Taiwan presidential election. It is interesting that the simple “Like” function on Facebook collects the public opinions about candidates (see Signals Evaluation in Results), although it has been reported to be vulnerable to shilling attacks in electronic commerce De2014Paying (). The “Like” function is more beneficial than the “Comment” function, although the latter actually expresses more complex sentiments and richer opinions. This difference is attributes to the widespread use of Facebook in Taiwan (see SI, TABLE 1) and the easy-to-use characteristic and emotional unambiguity of the “Like” function. Another interesting finding is that the most influential events during the Taiwan election campaign are all closely related to cross-strait relations (see Influential Events in Results). In particular, in line with the findings in Gerber2011How (), the events more closely associated with public sentiment (such as the Chou Tzu-yu flag incident) appear to have a greater impact than those with merely political meaning (such as the Xi-Ma Meeting).

We provide accurate prediction and automatic causal analysis of the 2016 Taiwan Presidential Election, which illustrates the feasibility of applying a data-driven paradigm for political vote analytics. Although our focus is on Taiwan, the proposed signal fusion approach and the event detection model can be applied to other elections or referendums, especially those using majority rule. Considering the different Internet applications used across countries and areas, we may need to adjust the input online information sources and design new measurements for the new signals. Furthermore, we should consider how the election systems of particular countries or areas differ and require adjustment of the prediction model. For example, the US election system is not a direct election but relies on the Electoral College system with 538 electoral votes. Hence, we have to incorporate information about the states and locations of online users into the prediction. However, this information is often unavailable. Nevertheless, we can still consider online users as the voters for a “virtual” direct election and obtain the predictive results as the popular votes for the candidates, which could still indicate the winner if there is a large difference in vote share among candidates. The recent 2016 US Presidential Election demonstrates the power of voices on social media.



  • (1) Asur, S. & Huberman, B. A. Predicting the future with social media. In Web Intelligence and Intelligent Agent Technology (WI-IAT), 2010 IEEE/WIC/ACM International Conference on, vol. 1, 492–499 (IEEE, 2010).
  • (2) Steinert-Threlkeld, Z. C., Mocanu, D., Vespignani, A. & Fowler, J. Online social networks and offline protest. EPJ Data Science 4, 1–9 (2015).
  • (3) Bollen, J., Mao, H. & Zeng, X. Twitter mood predicts the stock market. Journal of Computational Science 2, 1–8 (2011).
  • (4) Sakaki, T., Okazaki, M. & Matsuo, Y. Tweet analysis for real-time event detection and earthquake reporting system development. IEEE Transactions on Knowledge and Data Engineering 25, 919–931 (2013).
  • (5) Metaxas, P. T. & Mustafaraj, E. Social media and the elections. Science 338, 472–473 (2012).
  • (6) Effing, R., van Hillegersberg, J. & Huibers, T. Social media and political participation: are facebook, twitter and youtube democratizing our political systems? In International Conference on Electronic Participation, 25–35 (Springer, 2011).
  • (7) Graham, T., Broersma, M., Hazelhoff, K. & van’t Haar, G. Between broadcasting political messages and interacting with voters: The use of twitter during the 2010 uk general election campaign. Information, Communication & Society 16, 692–716 (2013).
  • (8) Enli, G. S. & Skogerbø, E. Personalized campaigns in party-centred politics: Twitter and facebook as arenas for political communication. Information, Communication & Society 16, 757–774 (2013).
  • (9) Williams, C. & Gulati, G. What is a social network worth? facebook and vote share in the 2008 presidential primaries (American Political Science Association, 2008).
  • (10) Lui, C., Metaxas, P. T. & Mustafaraj, E. On the predictability of the us elections through search volume activity (2011).
  • (11) DiGrazia, J., McKelvey, K., Bollen, J. & Rojas, F. More tweets, more votes: Social media as a quantitative indicator of political behavior. PloS one 8, e79449 (2013).
  • (12) MacWilliams, M. C. Forecasting congressional elections using facebook data. PS: Political Science & Politics 48, 579–583 (2015).
  • (13) Franch, F. (wisdom of the crowds) 2: 2010 uk election prediction with social media. Journal of Information Technology & Politics 10, 57–71 (2013).
  • (14) Burnap, P., Gibson, R., Sloan, L., Southern, R. & Williams, M. 140 characters to victory?: Using twitter to predict the uk 2015 general election. Electoral Studies (2015).
  • (15) Tumasjan, A., Sprenger, T. O., Sandner, P. G. & Welpe, I. M. Predicting elections with twitter: What 140 characters reveal about political sentiment. ICWSM 10, 178–185 (2010).
  • (16) Sang, E. T. K. & Bos, J. Predicting the 2011 dutch senate election results with twitter. In Proceedings of the Workshop on Semantic Analysis in Social Media, 53–60 (Association for Computational Linguistics, 2012).
  • (17) Song, M., Kim, M. C. & Jeong, Y. K. Analyzing the political landscape of 2012 korean presidential election in twitter. Intelligent Systems, IEEE 29, 18–26 (2014).
  • (18) Kang, M., Zhong, H., He, J., Rutherford, S. & Yang, F. Using google trends for influenza surveillance in south china. PloS one 8, e55205 (2013).
  • (19) Preis, T., Moat, H. S. & Stanley, H. E. Quantifying trading behavior in financial markets using google trends. Scientific reports 3 (2013).
  • (20) 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 111, 11600–11605 (2014).
  • (21) Goel, S., Hofman, J. M., Lahaie, S., Pennock, D. M. & Watts, D. J. Predicting consumer behavior with web search. Proceedings of the National academy of sciences 107, 17486–17490 (2010).
  • (22) Fell, D. Party Politics in Taiwan: Party change and the democratic evolution of Taiwan, 1991-2004 (Taylor & Francis, 2005).
  • (23) Kalman, R. E. A new approach to linear filtering and prediction problems. Journal of basic Engineering 82, 35–45 (1960).
  • (24) MacKinlay, A. C. Event studies in economics and finance. Journal of economic literature 35, 13–39 (1997).
  • (25) Internet Usage in Taiwan: Summary Report of October 2015 Survey.
  • (26) Jackman, S. Pooling the polls over an election campaign. Australian Journal of Political Science 40, 499–517 (2005).
  • (27) Fisher, S. D., Ford, R., Jennings, W., Pickup, M. & Wlezien, C. From polls to votes to seats: Forecasting the 2010 british general election. Electoral Studies 30, 250–257 (2011).
  • (28) Walther, D. Picking the winner (s): Forecasting elections in multiparty systems. Electoral Studies 40, 1–13 (2015).
  • (29) Binder, J. The event study methodology since 1969. Review of Quantitative Finance and Accounting 11, 111–137 (1998).
  • (30) Yaqub, U., Chun, S. A., Atluri, V. & Vaidya, J. Analysis of political discourse on twitter in the context of the 2016 us presidential elections. Government Information Quarterly (2017).
  • (31) You, Q., Cao, L., Cong, Y., Zhang, X. & Luo, J. A multifaceted approach to social multimedia-based prediction of elections. IEEE Transactions on Multimedia 17, 2271–2280 (2015).
  • (32) Gayo Avello, D., Metaxas, P. T. & Mustafaraj, E. Limits of electoral predictions using twitter. In Proceedings of the Fifth International AAAI Conference on Weblogs and Social Media (Association for the Advancement of Artificial Intelligence, 2011).
  • (33) Gopoian, J. D. & Hadjiharalambous, S. Late-deciding voters in presidential elections. Political Behavior 16, 55–78 (1994).
  • (34) Henderson, M. & Hillygus, D. S. Changing the clockthe role of campaigns in the timing of vote decision. Public Opinion Quarterly 80, nfw027 (2016).
  • (35) Bond, R. M. et al. A 61-million-person experiment in social influence and political mobilization. Nature 489, 295–8 (2012).
  • (36) Kramer, A. D., Guillory, J. E. & Hancock, J. T. Experimental evidence of massive-scale emotional contagion through social networks. Proceedings of the National Academy of Sciences of the United States of America 111, 8788 (2014).
  • (37) Bryan, C. J., Walton, G. M., Rogers, T. & Dweck, C. S. Motivating voter turnout by invoking the self. Proceedings of the National Academy of Sciences of the United States of America 108, 12653–6 (2011).
  • (38) Rogers, T., Ten, B. L. & Carney, D. R. Unacquainted callers can predict which citizens will vote over and above citizens’ stated self-predictions. Proceedings of the National Academy of Sciences 113, 201525688 (2016).
  • (39) Wang, Z., Solloway, T., Shiffrin, R. M. & Busemeyer, J. R. Context effects produced by question orders reveal quantum nature of human judgments. Proc Natl Acad Sci U S A 111, 9431–9436 (2014).
  • (40) Rand, D. G. et al. Dynamic remodeling of in-group bias during the 2008 presidential election. Proceedings of the National Academy of Sciences of the United States of America 106, 6187 (2009).
  • (41) Hofman, J. M., Sharma, A. & Watts, D. J. Prediction and explanation in social systems. Science 355, 486–488 (2017).
  • (42) De Cristofaro, E., Friedman, A., Jourjon, G., Kaafar, M. A. & Shafiq, M. Z. Paying for likes?: Understanding facebook like fraud using honeypots 129–136 (2014).
  • (43) Gerber, A. S., Gimpel, J. G., Green, D. P. & Shaw, D. R. How large and long-lasting are the persuasive effects of televised campaign ads? results from a randomized field experiment. American Political Science Review 105, 135–150 (2011).

Supplemental Information

Appendix A Data

To measure the public opinions of the three candidates, we collected offline data from pollsters and online data from social media, search engines, and campaign homepages.

a.1 Offline Data

We collected a set of polls published by nineteen pollsters from 1 August 2015 to 16 January 2016. The pollsters include Decision Making Research, Kuomintang, Apple Daily, TVBS, Taiwan Indicators Survey Research (TISR), Liberty Times, SET News, Want Want China Times, Taiwan Think Tank, ETtoday, Shih Hsin University, Apollo Survey & Research, Now News, Taiwan Competitiveness Forum, My-formosa, Business Weekly, United Daily News, NextTV, and Now News. Among the polls from October 2015, the results of TISR are closest to the average of all the polls not done by political orientations. In addition, TISR, which is conducted every 15 days using random-digit telephone surveys, is the most frequently updated poll during the election. Thus, we select TISR as the representative of the polls. In each survey, in addition to the overall vote preference of the candidates, the polls investigate the opinions with regards to six population age groups (i.e., the people aged between 20 and 30, 30 and 40, 40 and 50, 50 and 60, 60 and 70, above 70 years). In this study, we collect the support rate in each age group from the polls published by TISR111Taiwan Indicators Survey Research(TISR),

a.2 Online Data

Generally, public opinions are concentrated on popular social media sites. To identify the most popular websites in Taiwan, we referred to professional Internet surveys (i.e., Internet Usage in Taiwan: Summary Report of October 2015 Survey 222Internet Usage in Taiwan: Summary Report of October 2015 Survey, and web traffic reports (i.e., Alexa, comScore and Digital Age). The top websites are listed in TABLE 1. We selected several sites primarily composed of user-generated content and classified them into three categories: social network (i.e., Facebook and Twitter), search engine (i.e., Google), and campaign homepages. We extracted the daily measurements from the above platforms as signals of collective opinions during the period of October 1, 2015 to January 16, 2016. To weaken the effects of measurement loss and violent fluctuations on prediction and to capture the trends, we apply a moving average to the measurements.The number of moving days used in the following analysis is 30.

Social Network. Facebook, which provides an easy way for candidates to reach out to a large audience, is the most popular social service platform in Taiwan. For each published post, users can "Like" or "Comment" on it to indicate their attitudes towards the candidate. In our study, we use Facebook API to retrieve all the posts published by the three candidates during the election period, the corresponding timestamp, the number of Likes, the id list of users that pressed the "Like" button, the number of "Comments", the "Comment" content and user id, etc.



Rank Alexa comScore Digital Age
1 Yahoo Google Facebook
2 Facebook Yahoo YouTube
3 Google Facebook Yahoo
4 Pixnet YouTube Google
5 ETtoday Pixnet Chinatimes
6 YouTube UDN Ruten
7 Giga Circle Wikipedia UDN
8 UDN Xuite Gamer
9 Xuite Apple Daily Mobile01
10 LIFE Yam Apple Daily
Table 1: Top 10 websites in Taiwan

To reflect the candidates’ popularity in terms of Facebook "Like", we calculate the daily average number of "Like" per post for each candidate as follows,


where is the number of Likes of the post published by candidate on day , and is the number of posts published by candidate on day . To compare "Like" with "Comment"on Facebook, we also extract daily average number of "Comments" per post for each candidate as an indicator.


where is the number of comments on the post published by candidate on day .

Some recent reports tumasjan2010predicting (); digrazia2013more (); o2010tweets (); mejova2013gop () have suggested that there is a statistically significant correlation between Twitter and election outcomes in terms of volume and sentiment. Thus, although Twitter is not as popular as Facebook in Taiwan, we select it as a measurement of voting preference. By querying the Twitter API, we obtained 283412 candidate-related Twitter messages posted from 1 October 2015 to 16 January 2016 in real time. To focus on Taiwan public opinions, we only use party names, the three candidates’ names and their morphs in Simplified and Traditional Chinese as keywords to retrieve tweets. The keyword list is presented in TABLE 2. By analyzing Twitter sentiment, we find that more than 80% of the retrieved tweets are news and do not represent public opinions. Thus, we use to represent the number of tweets mentioning a specific candidate,


where is the Twitter volume about candidate on day .

Search Engine. Search queries usually reflect information that users hope to obtain, which can be regarded as an indicator of their opinions and preferences. Thus, we also investigate Google, the most used search engine in Taiwan. We obtained the search data from Google Trends 333Google Trends,, which provides the time series of the search index for given words. Google Trends not only allows users to view the search index in a specific region for given words but also to compare the search frequencies of multiple keywords. In our study, we take the candidates’ names in Simplified and Traditional Chinese as keywords and further restrict the search source to Taiwan. Then, we calculate the ratio of search indexes as a signal reflecting the vote share for candidate ,


where is the search index of keywords about candidate on day .

Campaign Homepages. The three candidates set up campaign websites444Tsai Ing-wen,;
Eric Chu,;
James Soong,
to promote themselves and raise funds. The IP traffic of candidates’ homepages can be used to determine their popularity. We collect the daily traffic data and take the proportion as a measurement of opinions about candidate :


where is the IP traffic of candidate ’s campaign homepage on day . The traffic data are from Alexa 555Alexa,, which is a subsidiary of Amazon that provides commercial web traffic data for given sites.



Candidate Keywords
Tsai Ing-wen 蔡英文 (Tsai Ing-wen, candidate’s name in Simplified Chinese), 空心菜 (a nickname of Tsai Ing-wen), 小英 (a nickname of Tsai Ing-wen), 陈建仁 (Tsai Ing- wen’s vice presidential candidate), 民进党 (Democratic Progressive Party, the party name in Simplified Chinese), {CJK}UTF8bsmi 民進黨 (the party name in Traditional Chinese), 绿营 (a nickname of the party), {CJK}UTF8 bsmi綠營 (a nickname of the party)
Eric Chu 朱立伦(Eric Chu, candidate’s name in Simplified Chinese), {CJK} UTF8bsmi朱立倫 (candidate’s name in Traditional Chinese), 阿伦 (a nickname of Eric Chu), 朱市长 (a nickname of Eric Chu), 王如玄 (Eric Chu’s vice presidential candidate), 国民党 (Kuomintang, the party name in Simplified Chinese), {CJK}UTF8bsmi國民黨 (the party name in Traditional Chinese), 蓝营 (a nickname of the party), {CJK}UTF8bsmi 藍營 (a nickname of the party)
James Soong 宋楚瑜 (James Soong, candidate’s name in Simplified Chinese), 宋爷爷 (a nickname of James Soong), 宋省长 (a nickname of James Soong), 徐欣莹 (James Soong’s vice presidential candidate), 亲民党 (People First Party, the party name in Simplified Chinese),{CJK}UTF8bsmi親民黨 (the party name in Traditional Chinese)
Table 2: Keyword list used to retrieve tweets in Twitter

Appendix B vote Prediction Model and Results

b.1 Kalman Filter

The core of the Kalman filter is defined by the following set of equations:


Equation 15 defines the time trends of the online measures, , where is a vector that maps the state to the observed signals. Equation 16 defines the vote shares trend, where is the state transition coefficient applied to the previous state. and are independent Gaussian random noise with mean zero, observation covariance and transition variance . Equation 17 is the starting value that sets the dynamic system in motion. The logic behind the set of equations is that the online measures are flawed signals with the true vote states represented by the mean with mixing noise.The goal of the model is to fuse the flawed signals to estimate the daily state and to further transfer the estimate to next day to make a prediction.

To recursively estimate the daily vote state at time , the prediction of vote shares is first derived by the state transition equation, a variation of equation 16:


where is the vote state prediction for candidate at time given the signals up to , and is the updated estimation of the vote state at time given the signals up to . and are the prediction covariance and updated estimation covariance, respectively. Meanwhile, online measure is observed. Then, it is feasible to update the state estimation by absorbing the new signals into the prediction . We use a weighting function to express the combination of the state prediction and signals as follows:


where is the Kalman gain, which is used to weight the state prediction and various signals in the fusion. is the updated estimate covariance. By minimizing the updated state estimation error , we can derive the Kalman Gain


When the updated estimate is obtained, we can use equation 18 to predict the next-day vote share.

As shown in equation 18 to equation 22, daily vote state estimation depends on the linear dynamic system parameters, such as , , ,, , and . In particular, the two noise parameters and determine the impact of the signals on the state update. To estimate the two parameters, we adopt maximum posterior estimations, which can be obtained by maximizing the conditional density function. As and , there is a trade-off between the vote states and measurements of the three candidates, which implies that a change in one candidate’s vote state is equal to the sum of the changes in that of the other two candidates’. To characterize this constraint, we assume that the noise of measurements and state transitions for the three candidates are the same, that is, and . Then, we express the conditional density function as follows,


According to the multiplication rule of probability, we have


where is the dimension of the measurement vector.

Similar to equation 24, we can readily obtain:


Inserting equation 24 and equation 25 into equation 23 yields




Because and ln have the same maximum value, we transfer equation  26 into its logarithmic form,


Taking the partial derivatives of with respect to and gives


and the maximum posterior estimations of and can be written as


In the following, we construct the unbiased estimations for the variance and covariance matrix . Since the daily vote states and are normally unavailable, a suboptimal estimator can be obtained by replacing them with the filtering estimations and and the prediction ,


Denoting the innovation vector by


we have


In view of equation 20 and equation  35, the following equation holds.


Thus, we have




Therefore, the unbiased estimate of is


To ensure that , we take a suboptimal estimate,


The unbiased estimate of is


At time , we use equation 41, equation 42 and the signals up to time to update and and then apply the updated estimates to the next-day state calculations. In addition to the covariance of observation noise and the variance of state transition noise , the mapping vector , the state transition coefficient , and the initial state values and affect the state estimation. However, as shown by equation 41 and equation 42, those parameters determine the update of and , which indicates that it is not feasible to estimate them simultaneously via the maximum posterior method. Instead, we set the parameters as follows based on some assumptions.

Mapping vector . Since the signals are normalized, the scale of the signals and that of the state estimations are the same. Thus, is set to be a unit vector.

State transition coefficient . We introduce signals and update prediction at a daily frequency, which makes it possible to absorb the latest information into the prediction. Therefore, we assume that daily prediction is equal to the previous updated state estimation. The state transition coefficient is set to be 1.

Initial vote share . At the beginning of the prediction, there is little information about the three candidates’ vote ratios. We use the latest poll result of the pollster TISR as a rough estimation of the vote share. We also change the value to the mean of each candidate’s signal , where , and an equal value . However, the changes have almost no effects on the prediction results. Details are provided in  B.2.

Initial state variance . The initial state variance reflects our belief of the state value , which is a rough estimate. Thus, we make the variance large, . We test different settings and find that the fusion result is not sensitive to changes. The test results are shown in  B.3.

b.2 Robustness Tests for Initial Candidate Vote Ratio

The initial candidate vote ratio starts the prediction process. Since the candidate vote preference is unknown at the beginning of the prediction, we make a rough estimate. To test the influence of the initial estimate on the prediction, we examine three different sets of parameters. First, we set . The logic of this setting is that when little information about the candidates’ vote ratios is available, we assume that the three candidates receive equal vote shares. However, in contrast to the unknown vote ratio of the first setting, we believe that polls and social media signals provide clues about candidates’ popularity. Therefore, in the second and third settings, we take the latest poll results of the pollster TISR and the mean of social media signals as the initial state values, respectively. The results are shown in FIG. 7, FIG. 8, and FIG. 9.

All the figures show that the predictions under the three settings are consistent with respect to both trend and numerical value. Since mid-November 2016, the differences between the three cases are no greater than 5%. On election day, the differences are no greater than 3%. The small differences between the three cases indicate that the prediction is insensitive to the initial state value, especially more than one month after the start of the prediction.

Figure 7: The predicted vote share of Tsai Ing-wen based on three sets of initial vote ratios. After November 15, 2016, the differences between the three predictions are no greater than 5%. On election day, the differences are less than 1.60%.
Figure 8: The predicted vote share of Eric Chu based on three sets of initial vote ratios. After November 13, 2016, the differences between the three predictions are no greater than 5%. On election day, the differences are less than 1.10%.
Figure 9: The predicted vote share of James Soong based on three sets of initial vote ratios. After November 4, 2016, the differences between the three predictions are no greater than 5%. On election day, the differences are less than 2.70%.

b.3 Robustness Tests for Process Noise

As described in Sec. B.1, the daily state prediction depends on the updated previous state estimate. Then, the prediction is fused with the signals to update the current state estimation . As shown in equation 20 and equation 22 kalman1960new (), the fusion weight primarily relies on the process noise and the measurement noise .

The process noise can be iteratively calculated as follows,


As and are derived by maximum posterior estimation, the fusion weight can be obtained as long as is determined. We consider two parameter sets for :

First, we set . This setting assumes that the variance of the initial state distribution is 0, which implies that we are relatively sure of the mean value of the initial state.

Second, we set . This setting assumes that the variance of the initial state distribution is 1. Because the state value is greater than 0 but less than 1, the setting implies that we are relatively uncertain about the mean value of the initial state.

The time series of the prediction for the three candidates based on the above two parameter sets are shown in FIG. 10-FIG. 12. In the three figures, the curve of the first setting is almost coincident with that of the second setting. This coincidence indicates that the daily prediction is not sensitive to the setting of