Filtering the intensity of public concern from social media count data with jumps

Count time series obtained from online social media data, such as Twitter, have drawn increasing interest among academics and market analysts over the past decade. Transforming Web activity records into counts yields time series with peculiar features, including the coexistence of smooth paths and sudden jumps, as well as cross-sectional and temporal dependence. Using Twitter posts about country risks for the United Kingdom and the United States, this paper proposes an innovative state space model for multivariate count data with jumps. We use the proposed model to assess the impact of public concerns in these countries on market systems. To do so, public concerns inferred from Twitter data are unpacked into country-specific persistent terms, risk social amplification events, and co-movements of the country series. The identified components are then used to investigate the existence and magnitude of country-risk spillovers and social amplification effects on the volatility of financial markets.


Introduction
With globalisation, the need to understand the dynamics of country-risk perception and its effects on financial markets has become a relevant issue to investors, central bankers, and governments for both portfolio diversification and debt issuance [7,20,24]. Major political events are known to be an important driver of market volatility [5]; however, a measure of the underlying country-risk perception is still lacking.
The effect of new information on volatility in international markets has been studied extensively in the past few years. Previously, it was held that global risks are the only considerable risks in financial markets, but more recently, researchers have begun to examine country-risks and global risks to uncover local factors that cause stock market return volatility. Moreover, options have been traded on the VIX index since 2006, thus allowing volatility to be considered an asset.
The identification of public concerns related to specific issues of interest (e.g., country risks) requires a data source that can be used to proxy the perception of the general public. Unfortunately, existing sources of information on country-specific risks are either qualitative [40] or low frequency [23] and often represent the perceptions of small panels of experts, thus ruling out the possibility of using them as proxies for the general public's concerns.
To address this gap, in this paper, we focus on count series generated from big textual data regarding country-specific risks via online social media. This type of data is characterised by sudden information avalanches and is affected by topic-specific trends, thus requiring adequate statistical tools to disentangle these components. In this paper, we propose a new state space model for Web count data that allows country-specific risk series to be categorised into three separate components, each capturing a specific feature driving the intensity of the observables. In particular, (i) a smooth term represents the latent intensity of country-specific risk concerns, while (ii) a multiplicative jump component captures their social amplification, and (iii) a global component controls for common factors. This method of decomposing country-risk perception offers new ways to evaluate the impact of social media phenomena on market and sociopolitical systems. In this paper, we focus on the analysis of risk perception issues, but the proposed framework enables the use of count time series to analyse any Web phenomenon characterised by social amplification.
To overcome the limitations of the aforementioned data sources, we investigate usergenerated Web data. Content generated by the Web community, such as online social media post-writing and sharing activities, have been widely used to track aggregate behaviour and infer the dynamics of the public's attention, perceptions, and concerns about specific topics of interest [33]. Compared to other data sources (e.g., surveys and official statistics), big textual data from the Web allow for (i) larger sample sizes, (ii) higher velocity, and (iii) real-time collection [35].
Data from social media generally consist of a collection of character strings, which can be transformed into other data types for analysis with standard statistical methods [15]. For example, count data can be generated from texts through filtering conditions, which may consist of regular expressions (RegEx) or metadata restrictions (e.g., the author, geolocation, or date). Count data from the Web are becoming increasingly valuable and widely used in several fields. For example, data from Google's search engine and Twitter have been used recently to improve forecasting accuracy in macroeconomics [12] and finance [31]. The analysis of Web-based count data requires suitable and simple statistical tools designed for analysis and making predictions.

US UK
ρ U S (1) = 0.50, ρ U S,U K = 0.25, ρ U K (1) = 0.57  Figure 1 shows the daily number of Twitter posts published from April 2016 to March 2017 that contain the term "risk " and refer to the United States (US) or to the United Kingdom (UK). The series share some peculiar features: (i) smooth evolution and (ii) several jump events. The observed series are also characterised by positive auto-and cross-correlation, thus suggesting the presence of both temporal and cross-sectional dependence. Social media users' concerns regarding global-scale risks (e.g., trade wars, global financial crisis, and pandemics) may also impact country-specific activity, thus inducing the positive cross-correlation between the observed series in Fig. 1. To account for this fact, we enlarge our sample by including a third series regarding global risks, which are not imputable to a specific country, and use it as a common driver of US and UK observables. State space (or parameter-driven) models provide a flexible and interpretable framework for the structural analysis of serially-dependent time series [14]. To account for the correlation structure of the data, we propose a new state space model in which the smooth temporal evolution of the observed variables is driven by a dynamic latent series representing social media users' concerns.
A parameter-driven Bayesian model for multivariate count data was recently proposed by [1]. In their framework, the cross-sectional sum of past observations affects the dynamics of all latent series. Similarly, [42] proposed a method for predicting the time path of retweets. However, our goal is to decompose the public' latent concerns regarding country-specific risks.
An additional distinctive feature of the data in Fig. 1 is the presence of country-specific and non-synchronised activity peaks. These sudden jumps cluster over time and have different degrees of persistence and scale. Time series characterised by smooth trajectories with discontinuities that cluster over time are usually associated with exceptional events or structural breaks and call for the use of Markov-switching processes [18,10].
The sudden and transient nature of these jumping patterns allow them to be characterised as exceptional risk amplification events affecting the intensity of social media users' concerns. Social amplification phenomena are known to occur on Web platforms, such as Twitter, especially for risk-related issues [16]. We define social amplification as the sudden intensification of online communications containing a specific risk-related theme (e.g., a country). See [26] for a theoretical framework of the social amplification of risks. The concerns of online communities can be amplified by salient events, online news coverage, and other sociocultural factors affecting risk perception [32]. Recently, [34] found evidence of risk amplification in health-related risk debates occurring on Facebook. Similarly, [38] analysed Twitter posts to identify the intensity of societal concerns regarding climate-change related risks.
Country risks are important in the explanation and prediction of market volatility indices [17]. In particular, market operators are interested in identifying the specific contribution of each driver of public concerns in explaining the fluctuations of a volatility index to determine the country-risk spillover effects [22]. The measurement of country-risk perception may also empower government institutions with a new tool suitable for enacting their policy objectives, such as issuing of new government bonds. Moreover, by disentangling the different components of country-related public concern and their relationship with volatility, it is possible to assess the relative contribution of rational and irrational behaviours in explaining volatility indices. Motivated by these facts, in this paper, we are concerned with the identification and disentanglement of country risks, which are then used to explain the fluctuations of a market volatility index, the VIX.
The contributions of this paper are manifold. First, we identify the timing, persistence, and scale of social amplification events. Second, series-specific (country) effects are disentangled from common (global) contributions to intensity while controlling for exogenous factors that may contribute to explaining fluctuations in public concerns. Finally, the extracted intensities are used to highlight country-specific contributions to fluctuations in the VIX index.
The reminder of the paper is organised as follows. Section 2 presents the new statistical model for count time series data. The inferential procedure and algorithms are then described in Section 3. Next, the proposed methodology is used in Section 4 to study count data from Twitter posts that mention risk. Finally, Section 5 summarises the main findings.

A state space model for Web count data
Despite widespread interest in analysing risk perception and social amplification in online social media, statistical tools capable of exploiting specificity in the aforementioned data are limited. The peculiar features of count data obtained from social media, as discussed in the previous section, deserve special attention in the definition of a proper statistical model. We note that counts extracted from Web data and our dataset share similar characteristics, thus making the proposed statistical framework applicable to a wide range of empirical studies.
Modelling time series of counts pose several challenges, such as discreteness of the observations, temporal and cross-sectional dependence and over-dispersion. Despite renewed interest over the past decade [39], these issues still need to be resolved. Recent contributions include the dynamic Skellam model [27] used for studying financial tick-by-tick data, [41] study of health data with excess zeros, and the self-excited threshold Poisson model developed by [36]. Within the Bayesian approach, [30] used a zero-inflated Poisson model to study counts of user generated content in an on-line community.
In this Section, we propose a novel state space model for multivariate count time series which allows for: serial and cross-sectional correlation, sudden signal amplification events which cluster over time, and smooth dynamics. Computationally, the proposed model scales linearly in the cross-sectional dimension. We classify textual data from Twitter according to geographical markers (i.e., mention of the country in the text) to obtain a multivariate count time series {y 1,t , . . . , y J,t , z t } t consisting of country-specific series y j,t for each j = 1, . . . , J, as well as a global series z t that stems from texts without a geographical reference to any of the selected countries. See Section 4 and the Supplement for further details on the construction of the dataset.
Starting from the count data illustrated in Fig. 1, we aim to extract and disentangle components of the underlying dynamic intensity driving the observed counts: the public's concerns for country risk. As discussed in Section 1, the existence of unobserved public concerns driving Twitter posting activity suggests the use of a state space framework for count time series [13]. This choice allows us to model data on their natural scale while preserving a direct interpretation of the components of the model. We follow this approach and assume that the country-specific observables, y j,t , are Poisson-distributed with a persistent, smooth latent intensity process, x j,t , which represents country-risk concerns. This also allows for positive autocorrelation and instantaneous cross-correlation, as found in the data (see Section 1 and the preliminary analysis in Section ?? of the Supplement).
We account for persistent, smooth dynamics of positive-valued intensity x j,t by assuming a non-central Gamma distribution as the transition density of the process: The non-central Gamma distribution is obtained as a Poisson mixture of Gamma. Hence if where Ga(a, c) denotes a Gamma distribution with shape a and scale c. It has density A non-central Gamma transition density defines an autoregressive Gamma process of order 1 [19], or ARG(1). The parameter α j in Eq. (3) governs the magnitude of innovation in the latent state process, whereas β j , δ j account for persistence. [19] proved the stationarity of the ARG(1) process if β j δ j < 1 and derived the conditional mean and variance as E[x j,t+1 |x j,t ] = δ j α j +β j δ j x j,t and V[x j,t+1 |x j,t ] = δ 2 j α j + 2β j δ 2 j x j,t . The choice of the ARG process for the latent states is motivated by its flexibility and the fact that it facilitates the structural interpretation of the latent states (public concern in our empirical application).
As discussed in Section 1, the sudden jumps magnifying the volume of observed counts in Fig. 1 are due to social amplification phenomena. To avoid bias in the estimation of public concern, x j,t , we introduce a positive multiplicative factor, ξ j,t , thus obtaining the overall public concerns with amplification asx The multiplicative factor allows us to disentangle the contribution of transient social amplification events, x j,t ξ j,t , from the persistent evolution of country-risk concerns, x j,t . Furthermore, because jumps in Twitter counts are persistent and cluster over time (see Section 1), we assume that country-specific social amplification is driven by an L-state hidden Markov chain {s j,t } T t=1 , such that ξ j,t = ξ j,s j,t , where ξ j,l is a state-specific parameter. The transition probabilities of each chain j are assumed to be time-invariant and denoted by λ j,l,k = P (s j,t = k|s j,t−1 = l), with transition matrix Λ j . Finally, to account for the effects of exogenous variables on latent intensity, we include country-specific covariates, v j,t , in the analysis.
The resulting univariate model with local Markov-switching jumps has a state space representation: To assess the univariate model's (3) ability to capture country-specific latent dynamics, we investigate the correlation structure of the observables counts and filtered latent intensities. Table 1 reports that the Spearman's rank correlation between the observed count time series is 0.257, whereas it is 0.234 between the latent intensities. This result indicates that the univariate model is unable to correctly extract the latent intensity at country level since the correlation between the observables is entirely transferred to the latent intensities. This is undesirable since we want latents to only capture the share of intensity specifically attributable to country-level features, removing the effect of common factors. This calls for the use of a multivariate framework that accounts for positive correlation among the observables while allowing the impact of co-movements and confounding factors to be disentangled from countryspecific intensity.  Table 1: Spearman's rank correlation among observed counts (y j,t , z t ) and latent local intensities, without amplification (x j,t ) and with amplification (x j,t ).
To account for the cross-sectional dependence structure among the y j,t , we distinguish country-specific public concerns from global ones, and include a common latent factor, w t , in country-level intensity. The latent process w t encodes Twitter users' perceptions of global (rather than country-specific) risks; thus, it is assumed to drive the temporal evolution of the global series, z t . Note that including series z t helps in isolating the impact of common risk factors and seasonal effects from the country-specific concerns. This specification leads to a multivariate model with local Markov-switching social amplification, whose conditional independence relationships are summarised by the DAG in Fig. 2. The state space representation is We refer to the components of country-level intensity as follows: 'local' x j,t , 'amplification' The contribution of the proposed model for multivariate count time series is manifold. First, it accounts for series-specific and global latent intensities driving the observed counts, allowing to disentangle the impact of common factors from idiosyncratic latent dynamics. Jumps have been mainly studied in the context of real-valued time series [2] using an additive specification. Instead, we allow for jumps in count time series through a series-specific multiplicative term which amplifies the effect of series-specific intensities. Despite their limited use in the literature [8], series-specific multiplicative jumps allow for a more flexible modelling as compared to the widespread additive specification. Finally, we do not make the temporal independence assumption for the jump terms and model them using a hidden Markov chain that allows to infer different states of excitation within the time series of counts.
Besides, the functional form of model (4) permits a direct structural interpretation of the latent variables and parameters as series-specific or global intensities, and amplification. This is granted by the assumption of an ARG process for the latent intensities. Differently, the commonly used lognormal specification [37,21], despite allowing the inclusion of similar terms in the intensity, would make the interpretation more difficult due to the nonlinear exponential link function.
[25] presented a state space for multivariate Poisson data where the observed counts are driven by a common Markov process. However, our framework is more general in two respects. First, we assume a different state transition that allows for both stationary and nonstationary processes. Second, our inferential procedure also holds for different observation densities.
Recently, [10] proposed a Markov-switching Poisson integer-valued GARCH model to account for consecutive zeros and time-varying volatility in count data. Since their model is univariate and observation-driven, which means that the latent intensities are perfectly predictable, it is unable to account for features of the data highlighted in Section 1. Alternative approaches for multivariate count time series have been developed by [37], who modelled dependence by assuming a factor structure for latent intensities, and [21], who exploited copulas to impose dependence among the observables while assuming a VARMA process for the dynamics of log-intensities. From a forecasting perspective, [4] used the decouple/recouple strategy to define a dynamic model for multivariate counts that is computationally scalable in the number of series. Conversely, our interest lies in identifying and disentangling the structural components of latent public concerns. This motivates the parametric assumptions underlying our model (4), which prevent the direct applicability of their decouple/recouple strategy.
Given the structural form of model (4), the likelihood function is a high-dimensional integral with no closed-form solution. Hence, we apply a data augmentation approach and introduce the latent state variables s j,t , x j,t , w t in the set of observations, thus obtaining the complete-data likelihood function where T j,l = {t : s j,t = l} and N lk (S j ) = #{s j,t−1 = l, s j,t = k} are the number of transitions from state l to state k of the j-th chain S j . Motivated by our interest in identifying of social amplification phenomena in data, we assume L = 2 and impose ξ j,1 = 0 for every j. This leads to identifying regime 1 as having no jumps and regime 2 as the social amplification regime. However, the model specification is general and allows for any number of regimes L > 1 that can be identified using the constraint ξ j,1 < . . . < ξ j,L .

Prior specification
In this paper, we adopt a Bayesian approach that provides a simple way to introduce regularisation via the specification of appropriate prior distributions and permits a flexible modelling of jumps through hierarchical priors. The parameters α j and δ j (similarly, α w and δ w ) of the non-central Gamma distribution in (4) are not separately identifiable, thus requiring the introduction of constraints for their estimation. To solve the identification issue, we introduce a soft constraint by specifying a truncated prior distribution for δ j , δ w , which bounds them away from zero, and then test the robustness of the results for various truncation levels. In all the analyses performed, we find that the parameters δ j , δ w are never stuck at the lower bound, thus providing evidence that the proposed constraint is non-binding. See the Supplement for further details regarding the proposed truncation scheme and values of the hyper-parameters. We assume a flexible hierarchical prior for the country-specific social amplification factor, ξ j,2 . The overall prior structure for each j = 1, . . . , J is The notation T Ga(a, b; τ ) stands for a Gamma distribution truncated on the interval S τ = (0, τ ) ⊂ R + , parametrised by τ . Finally, the unnormalised prior distribution for γ j is conjugated for the shape parameter of a Gamma distribution [28] with positive real hyperparameters a γ , b γ , c γ . The conjugacy property allows for efficient posterior sampling via the inverse transform method without the need for a tuning parameter. Fig. 3 reports the directed acyclic graph (DAG) of the model and prior structure.
. . , T Figure 3: DAG of model (4). It exhibits the hierarchical structure of priors and related hyper-parameters: observables (shaded, gray circles), latent parameters (solid, white circles), and fixed hyper-parameters (dashed, white circles). Arrows' directions indicate the causal dependence relationships of the model.
Since this distribution is not tractable, we develop a MCMC algorithm to generate random draws from the posterior distribution and approximate all posterior quantities of interest. We refer to Appendix A and the Supplement for the detailed derivation of posterior distributions. Estimating the trajectory of latent intensity is known as the filtering problem. For special classes of state space models, such as linear Gaussian state space models, the filtering distribution is known in closed form, and efficient algorithms are available (e.g., the Kalman and Hamilton filters). In more general frameworks such as eq. (4), when no closed form expressions are available, the filtering problem may be solved by resorting to simulation-based methods, such as particle filters. We follow this strategy and rely on the selection/mutation (SM) algorithm [?, e.g., see]]Cappe2005HMM to obtain filtered estimates of the paths of latent states w t and x j,t . The SM algorithm addresses the degeneracy issue by selecting, at each point in time, a set of particles based on the associated weights and then simulating an independent extension for each selected trajectory. The static parameters governing the dynamics and amplification factors are sampled using an adaptive Metropolis-Hastings (aRWMH) step [3]. Finally, hyper-parameters are directly sampled from their corresponding posterior full conditional distributions.
We use the convention X j = {x j,t : t = 1, . . . , T } and X = {X j : j = 1, . . . , J} and similarly for the other variables and parameters. The MCMC algorithm is articulated in two main blocks, drawing the path of global intensity (w t ) and country-specific components (x j,t , s j,t , ξ j,s j,t ), as follows: (1) Sample the global latent intensity and the static parameters: (1a) Sample the latents W conditionally on (Y, Z, V, α w , β w , δ w , X, ξ, S) using a particle filter with the SM algorithm; (1b) Sample the static parameters of the ARG process for w t : • sample α w from P (α w |W, β w , δ w ) via aRWMH; • sample β w from P (β w |W, α w , δ w ) via aRWMH; • sample δ w from P (δ w |W, α w , β w ) via aRWMH; (1c) Sample the coefficients φ z from P (φ z |Z, V z , W) via aRWMH; (2) Independently for each j = 1, . . . , J, sample the country-specific latent intensity, hidden Markov chain, and static parameters: (2a) Sample the latents X j conditionally on (Y j , V j , α j , β j , δ j , ξ j , W, S j ) using a particle filter with the SM algorithm; (2b) Sample the hidden chain S j conditionally on (Y j , V j , W, X j , ξ j , Λ j ) using the FFBS algorithm; (2c) Sample the rows of transition matrix Λ j from P (λ j,l |S j ) for l = 1, 2; (2d) Sample, in block, the parameters associated with the jump terms: • sample η j from P (η j |ξ j , γ j ); • sample γ j from P (γ j |ξ j , η j ) via the inverse transform method; • sample the amplification ξ j,2 from P (ξ j,2 |Y j , X j , W, γ j , η j , S j ) via aRWMH; (2e) Sample the static parameters of the ARG process for x j,t : • sample α j from P (α j |X j , β j , δ j ) via aRWMH; • sample β j from P (β j |X j , α j , δ j ) via aRWMH; • sample δ j from P (δ j |X j , α j , β j ) via aRWMH; (2f) Sample the coefficients φ j from P (φ j |Y j , V j , X j , S j , ξ j ) via aRWMH.
We tested the sampler's performance in simulated experiments and compared it to a log-Normal specification for latent intensities w t , x j,t . The results suggest that our framework is better suited for minimising the risk of miss-classifying ordinary fluctuations of the observables as social amplification events, which is one of the objectives in our application. See the Supplement for further details. Note that model (4) and the proposed sampler can be easily modified to analyse binary or integer-valued time series since the observational densities in Eq. (4) only affect the distribution to be approximated by the particle filter.

Empirical application
In this application we model the public concern among Twitter users regarding countryrelated risks in the UK and US. According to [11], 'easy access to and efficient sharing of risk information [...] could accelerate the intensity as well as the speed of social attention to risk issues' . Accordingly, we apply model (4) to count data generated from Twitter posts mentioning risk to extract the intensity of country-risk concerns (e.g., political, macroeconomic, financial, or environmental) and identify risk amplification events. The period of investigation, which ranges from the 1 of April 2016 to the 1 of March 2017, is characterised by the United Kingdom's European Union membership referendum (23 of June 2016), the United States presidential elections (8 of November 2016), and their aftermath, including the Brexit negotiations and the Trump administration taking office. Referendums and presidential elections are major political events, so they receive broad media coverage and are characterised by intense speculation on their outcome and consequences. Since these events can potentially generate public concern regarding their implications at the national and international level, this dataset provides an ideal setting for disentangling the different components of country risks and evaluating their impact on the volatility of financial markets.

Data collection
Tweets containing the word risk were collected by programmatically querying the Search API of Twitter [29]. Further details about the the data strategy and query parameters are included in Section ?? of the Supplement. For each day of the period under investigation, we count the number of Twitter posts (considering both tweets and retweets) matching specific countrydictionary conditions (see RegEx Tables ??-?? in the Supplement), which are used to identify tweets referring to country-specific risks affecting either the US or UK. By doing so, we obtain the count time series y U S,t and y U K,t . Note that filtering risk data by country dictionaries without focusing on specific subtopics offers a broad lens to view all the (potentially timevarying) salient dimensions of country-risk perception. Conversely, some of these dimensions may be missed when using topical dictionaries since they cannot provide, a-priori, an exhaustive list of all the drivers of country risks.
Moreover, while country dictionary conditions (e.g., country names and acronyms) are exhaustive, unambiguous and stable over time, topic dictionary conditions with the same qualities are much more difficult to construct. Similarly, we create the global series z t by counting tweets about risk(s) that do not refer directly to the US or UK (i.e., tweets that do not match either country's dictionary conditions). Tweets counted the global series may refer to risks related to policies (e.g., Trump's foreign policy), events (e.g., the Brexit) and international factors (e.g., protectionism and international trade wars) which may affect both countries.
To control for the possible effect of breaking news and scheduled events that are expected to affect the volatility of financial markets, we also include (i) the share of newspaper articles containing the word risk, at both the country and global level, and (ii) the country-specific number of expected high-volatility events as covariates. See Section ?? of the Supplement for further details.

Results
Our data consist of T = 334 daily observations for J = 2 countries (the US and UK), and a global series. The count series for the UK and US are rescaled by a factor of 0.1 and the global series by a factor of 0.001. We run the Gibbs sampler for 20, 000 iterations after discarding the first 4, 000 as burn-in. Figure 4 shows the original data and the estimated latent intensity, distinguishing the persistent country-specific part (red line) from the estimated social amplification phenomena (red stars). The sampler identifies jumps that correspond to days characterised by the highest variation rates in the observations. In the first four months, which include the Brexit referendum, the path of the persistent component for the UK experienced a tumultuous period with higher average values compared to the following months. For the US, latent intensity appears rather stable, with some turmoil from mid-July to the US elections in November, as Donald Trump's polling against Hillary Clinton rose steadility [6], as well as when he took office in late January 2017. The days in which social amplification phenomena occur are reported as grey shades in Fig. 5, along with the distribution of their duration. The different country-level results corroborate the interpretation of social amplification as a local and unsynchronised phenomenon. In particular, most UK events occur before and right after the Brexit referendum, whereas social amplification in the US is more concentrated when Donald Trump took office. In particular, we find that during the first three months of the sample, corresponding to the period immediately prior to the EU referendum, which was characterised by the the Brexit victory and resignation of PM David Cameron, social amplification of risk with respect to the UK was frequent.
However, we find that events of social amplification are relatively more frequent for the US (i) at the beginning of June 2016, (ii) in August 2016, and (iii) from late December 2016 to February 2017. As aforementioned, interval (ii) was characterised by temporary reductions in the gap between Clinton and Trump in the polls, whereas the interval (iii) follows Donald Trump taking office as the President of the United States, and corresponds to the commencement of Trump's "America First" domestic and foreign policy.
Moreover, from the right-hand column of Figs. 4-5, we find that the average duration of amplification events in the UK is lower compared to the US, but their amplitude is higher in relative terms, capturing the fact that social amplification in the UK is more exceptional and intense compared to the US. This provides evidence in favour of the interpretation of social amplification as a transient phenomenon, which rapidly dissipates without having any persistent effect on the public's perception of risk. The composition of total intensity for the countries under investigation is shown in Fig. 6, which reports the daily share of each component over the total. Overall, we find that in both countries, (i) the share of local intensity, x j,t , evolves quite smoothly over time, and (ii) social amplification, when occurring, accounts for about 70% of the total intensity in both countries. These results provide evidence of time variation in the drivers of countryrisk perception, highlighting the role of social amplification in periods of extraordinary political events (e.g., referendums, elections, new presidents taking office), and the relative importance of the local and global components of risk perception on ordinary days. In particular, since August 2016 the weight of country-risk concerns, x j,t (dark grey), is significantly higher for the US than the UK, whereas the latter series is found to be mainly driven by the global term, w t (light grey). This may be a consequence of UK-related concerns experiencing a drop a few weeks after the Brexit referendum, aligning with the level of non-country-related risks. This drop may also be due to a switch in the nature of Brexit-related risks after the referendum, which started being perceived as global risks. Overall, these results suggest that for the UK, local factors are the most influential driver of public concern only in the first part of the sample, whereas the forces driving the intensity of US concerns are more evenly distributed, with the local factor playing the major role.
To deepen the analysis of social amplification phenomena, Table 2 reports the three most frequent words written during these periods (i.e., days t such that s j,t = 2). Interestingly, we find that the these words change over time, providing evidence that social amplification is not related to a specific event or topic; instead, it rather captures swings in posting activities regarding all topical dimensions of country risks.
For example, the jump in the US series in May 2016 refers to concerns related to the possible spread of the Zika virus in the US. Interestingly, the UK-risk perception jumped in January US UK Figure 6: Daily composition of intensities in percentage: local x j,t (dark grey shade), amplification x j,t ξ j,2 (red), covariates exp(φ j v j,t ) (gold), and global w t (light grey).
2017 in response to Donald Trump taking office, thus showing that local events may have significant ripples in the public's concerns regarding other countries. In summary, the results presented in Table 2 support the hypothesis that on days with social amplification, people are more intensively communicating their concerns regarding major political events. Hence the public concerns regarding these country risks may be amplified through social media.
We extend our analysis to include Germany and China and obtained results similar to those for the US and UK. Furthermore, we used topic-based classification of tweets to investigate political and economical risk dimensions. Interestingly, we find that the social amplification of the intensity of economic risks occurred close to the Brexit referendum, whereas Donald Trump taking office is associated with a political risk social amplification phenomenon. We refer the reader to Section ?? of the Supplement for further details.  Motivated by the long-standing debate on the relationship between risk perception and financial markets, we now investigate the performance of the extracted intensity of country-risk concerns in explaining fluctuations of a volatility index, the VIX. This analysis offers new ways to evaluate the impact of social media amplification phenomena on market volatility. Figure 7 plots the total intensity of country-risk concerns for the US and UK (blue and red) against the VIX index (black).
To explore this relationship further, we exploit the decomposition of country risks into the persistent and social amplification components (see Eq. (2)) to assess the contribution of each factor in explaining fluctuations in the VIX. Table 3 reports the estimation results of the linear regression: where we assume a non-informative prior and use four alternative specifications for the vector of covariates, f j,t : (i) local intensity with amplification,x j,t , (ii) jumps, x j,t ξ j,s j,t , (iii) local intensity, x j,t , (iv) local intensity and amplification, (x j,t , x j,t ξ j,s j,t ) . We consider three models: two including only a single country (a-b) and another with both countries (c). The best model for explaining fluctuations in the VIX includes the total risk intensity for both countries. We find that including risk intensity for both countries tends to improve the model's performance, thus suggesting the existence of cross-country risk spillover effects. Moreover, by disaggregating local intensity from the jump component, the results show that neither component in isolation has a better performance than their combination. If we also consider the results of the full model (bottom-right part of Table 3), this may be interpreted as evidence that both components are relevant, with social amplification playing a major role. This analysis shows that the flexible decomposition of country-risk intensity enabled by our framework allows us to investigate the impact of its components (and combinations of them) on a market index, such as the VIX.

Conclusions
In this paper, we investigated the relation between country-risk perception and financial markets using a measure of public concern at the country level extracted from online social media data. Count time series obtained from Web data pose several challenges, including the coexistence of jumps and smooth dynamics, with cross-sectional effects and common dynamics. To address these challenges, we designed a novel state space framework for multivariate time series of counts that is able to account for both of these features. The total intensity of each country series is given by the combination of a series-specific autoregressive term driving the persistent  Table 3: Bayesian linear regression of VIX on local intensity with amplification, ∆x j,t (top-left); local intensity, ∆x j,t (top-right); jumps, ∆x j,t ξ j,sj,t (bottomleft); local intensity, ∆x j,t , and jump, ∆x j,t ξ j,sj,t (bottom-right). Standard deviations of the posterior distributions are in parentheses. Coefficients with posterior credible intervals not containing zero are shaded in gray.
smooth dynamics, an idiosyncratic jump term that accounts for social amplification, and a global term that captures co-movements. The proposed method is applied to count time series extracted from Twitter posts about UK and US country risks. Using our model, we were able to identify periods of social amplification and relate them to specific events. Finally, to highlight the value of extracted components, we investigated their impact on the VIX and found evidence of country-risk spillover effects, driven primarily by social amplification phenomena. The proposed methodology is general and has a wide range of applications in other scientific fields where count time series are popular, such as biomedical and epidemiological applications.
We sample from these posterior distributions using an adaptive random walk Metropolis-Hastings (aRWMH) step with truncated lognormal proposal.
We sample from them using an aRWMH step with lognormal proposal.
We sample from them using an aRWMH step with lognormal proposal.
A.6 Sampling ξ j,2 We sample from the posterior distribution of the jump sizes ξ j,2 , for each j, using an aRWMH step with Gamma proposal P (ξ j,2 |Y j , W, X j , η j , γ j , S j ) ∝ ξ γ j −1 j,2 exp −ξ j,2 η j + t∈T j,2 x j,t t∈T j,2 (w t +x j,t (1+ξ j,2 )) y j,t A.7 Sampling φ z and φ j The posterior distribution of the coefficients of the covariates, φ z and φ j , for j = 1, . . . , J, are given by To improve the mixing of the chain, we use an aRWMH step with a Normal proposal to sample element-wise from the posterior distribution of φ z and φ j .