1 Introduction

The Internet is increasingly recognized not only as a tool that people use, but as an environment where they function and live. The amount of time, energy and emotions spent on using online social networks (Šuvakov et al. 2012a; Giles 2010; Amichai-Hamburger and Vinitzky 2010; Cheung et al. 2011; Ryan and Xsenos 2011), online games (Szell et al. 2010; Szell and Thurner 2010), emails (Guimerà et al. 2003), blogs (Mitrović et al. 2010) or chats (Garas et al. 2012; Gligorijević et al. 2013) are getting unprecedented scores. Hence the social implications of the Internet (DiMaggio et al. 2001; Amichai-Hamburger 2002), the intricate relationships between the offline and the online worlds (Szell et al. 2010; Szell and Thurner 2010; Johnson et al. 2009), and mechanisms governing new techno-social phenomena (Kleinberg 2008; Mitrović and Tadić 20102012a; Chmiel et al. 2011) pose new challenges for interdisciplinary scientific research. Researchers are faced with the problem of transferring concepts of offline human behaviors into the online world of social networks (Giles 2011). The question whether humans behave completely differently as “users” is tackled in various empirical investigations (DiMaggio et al. 2001; Johnson et al. 2009; Garcia et al. 2012; Mitrović et al. 2011). A particular question regards the emotional interaction between users in online social networks: How is emotional influence exerted if only written text is exchanged? What kind of emotions are actually involved? What is the role of the underlying network structure in spreading the emotions? Therefore, study of the stochastic processes related with stepping of the users into the online world and spreading of their behaviors and emotions through the online social network, are of key importance.

In our recent work (Šuvakov et al. 2012a), we have compiled and analysed a large dataset which contains the dialogs between the users in the MySpace social network, currently ranked as the fourth largest social networking site after Facebook, Google+, and Linkedin. By combining the methods of statistical physics with a machine learning approach of text analysis, by which the emotional content of the messages was extracted, we have found a strong evidence of the user’s collective behavior in which emotions are involved. Specifically, the bursts of emotional messages occur, which obey the scaling laws and temporal correlations. Furthermore, a characteristic structure of the dialogs-based network was revealed as well as the dominance of the positive valence emotions. In order to investigate the mechanisms underlying the observed collective behaviors of users, in this work, we use agent-based modeling framework with the emotional agents (Schweitzer and Garcia 2010; Šuvakov et al. 2012b) and simulate the emotional influence between agents in the online social network.

Agent based approaches are gaining importance in quantitative study of emotions (Rodgers 2010; Kuppens et al. 2010). Our modeling framework has already proved its applicability for various online communications, e.g., emotional influence in chats (Garas et al. 2012), product reviews (Schweitzer and Garcia 2010; Garcia and Schweitzer 2011) and the dynamics on blogs (Mitrović and Tadić 2011; Mitrović and Tadić 2012b) and other online networked systems (Tadić and Šuvakov 2013; Tadić 2013). It is based on the concept of Brownian agents (Schweitzer 2003) which are described by two scalar variables, valence that describes the pleasure (attractiveness and averseness) associated with an emotion, and arousal that describes the activity level induced by the emotion. To quantify emotions by the valence and arousal components is motivated by Russel’s model (Russell 1980; Coan and Allen 2007) from psychology.

Fig. 11.1
figure 1

Inputs from empirical data of reference Šuvakov et al. (2012a): network (top) and the histogram of raw data of delay times (a ) and arrival of users time series (b )

The proposed model (Šuvakov et al. 2012b) is in various ways linked to the empirical observations in the MySpace network. Firstly, it takes some empirical findings as input for the computer simulations. In particular, the network of interactions, on which the model of agents is implemented, has been extracted from the empirical dataset of MySpace (Šuvakov et al. 2012a). To consider a realistic network structure is of a primary importance for the emotion dynamics, since it is known that hidden topology features, such as link correlations at next-neighborhood level, affect the spreading processes of information and other relaxation dynamics in complex networks (Roca et al. 2010; Tadić et al. 20072005). Further important empirical input regards the interactivity pattern of the MySpace users. Such patterns appear across different communication media (Malmgren et al. 2009; Castellano et al. 2009; Crane et al. 2010; Mitrović and Tadić 20102012a; Szell et al. 2010), representing a hallmark of a given communication system.

In specifying the model, we follow the agent-based framework of emotional influence outlined in Schweitzer and Garcia (2010), which was already applied to product reviews (Garcia and Schweitzer 2011), chat rooms (Garas et al. 2012), and blog discussion (Mitrović and Tadić 2011). In this framework, the emotional state of an agent i is described by two variables, valence v i (t) ∈ [−1, 1], and arousal a i (t) ∈ [0, 1], both of which follow a stochastic dynamics. In contrast to the previous work (Garcia and Schweitzer 2011; Garas et al. 2012), where the stochasticity was modeled by simply adding a stochastic force, in the present model we assume that stochasticity may result from three sources, similarly to the model of agents on blogs (Mitrović and Tadić 2011). Specifically, these are:

  • sampling from the empirical inter-activity time distribution P(Δ t), Fig. 11.1a;

  • the empirical rate p(t) at which new users enter the network, Fig. 11.1b;

  • a spontaneous reset of both valence and arousal to a predefined value \((\tilde{v},\tilde{a})\) with a probability p 0.

The mathematical complexity of the present model, with the emotional agents on a fixed network, lies in between two previously studied cases. On one side, we have the dynamics of blogs and chats with Bots, where the agent’s actions cause the network on which they are situated to evolve (Mitrović and Tadić 2011; Mitrović and Tadić 2012b; Tadić and Šuvakov 2013); on the other end is the model of the product review communications, where the agents are not exposed to any geometrical constraints (Schweitzer and Garcia 2010). Numerical implementation of the present model and the preliminary results are available online (Šuvakov et al. 2012b).

2 Model of Emotional Agents in MySpace Social Network

2.1 Structure of the Model

To describe how an agent is affected by the emotional contents of perceived messages, three levels of aggregated influence are considered in our model:

  • the aggregation of messages on the agent’s wall, which is captured by a temporally varying arousal and valence fields h i a, v(t);

  • the aggregation of messages perceived on the friends’ walls, resulting to additional arousal field \(\overline{h}_{i}^{a}(t)\);

  • a mean field h mf(t), determined from all agents’ walls, that captures a kind of “atmosphere” of the network.

In analogy to the empirical data, in the model each message carries a valence and arousal value, which give raise a valence and arousal component of the field, h i v(t) and h i a(t), respectively. Also in contrast to the previous modeling approaches in Schweitzer and Garcia (2010), Garcia and Schweitzer (2011), here, we assume that the agent’s valence is affected solely by the valence field, while the agent’s arousal and activity (e.g., in choosing conversation partners) are primarily affected by the arousal fields, but can also include the contribution of the valence fields, as it is explained below.

Using the discrete time dynamics, the emotional state of an agent i is described by the following maps:

$$\displaystyle\begin{array}{rcl} v_{i}(t + 1) = (1 -\gamma _{v})v_{i}(t) +\delta _{\theta _{i},1}\mathcal{F}_{v}(t)\,& &{}\end{array}$$
(11.1)
$$\displaystyle\begin{array}{rcl} a_{i}(t + 1) = (1 -\gamma _{a})a_{i}(t) +\delta _{\theta _{i},1}\mathcal{F}_{a}(t).& &{}\end{array}$$
(11.2)

Here \(\delta _{\theta _{i},1}\) is the Kronecker delta which is one only if the agent is in an active state and zero otherwise. The nonlinear functions \(\mathcal{F}\) capture how valence and arousal are affected by the information fields. A discussion supporting these forms of maps was provided in Schweitzer and Garcia (2010). Here, we use the following specific forms, which are suitable for the message exchange in the online social networks:

$$\displaystyle\begin{array}{rcl} \mathcal{F}_{v}(t) = [(1 - q)h_{i}^{v}(t) + qh_{ mf}^{v}(t)] \times [c_{ 1} + c_{2}(v_{i}(t) - v_{i}^{3}(t))][1 -\vert v_{ i}(t)\vert ]\,& &{}\end{array}$$
(11.3)
$$\displaystyle\begin{array}{rcl} \mathcal{F}_{a}(t) =\{ (1 - q)[\epsilon h_{i}^{a}(t) + (1-\epsilon )\bar{h}_{ i}^{a}(t)] + qh_{ mf}^{a}(t)\} \times [1 - a_{ i}(t)].& &{}\end{array}$$
(11.4)

Each of these functions consist of a term that depends on the information fields and a second term that depends on the arousal or the valence, respectively. For the latter, nonlinear assumptions are made in accordance with Schweitzer and Garcia (2010). The term [1 − | x | ] is added to confine both variables in the prescribed range of the phase space. The small parameter q ∈ [0, 1] adjusts the fraction of the influence of the mean-field information, h mf(t), whereas the small parameter ε ∈ [0, 1] adjusts the influence of the emotional contents of the friends’ walls, \(\bar{h}_{i}^{a}(t)\), in relation to the own wall, h i a(t) at time t. We assume that the arousal dynamics of an agent depends on the activity on the walls of its friends, that is captured by \(\bar{h}_{i}^{a}\). However, we neglect such influence in the valence, assuming that the level of pleasure of an agent i should depend on the messages directed to i rather than on the messages that the agent i can see at the walls of its neighbors.

For our investigation in this work, we assume that the mean-field contribution can be neglected, i.e. we set q = 0. This corresponds to the actual situation in the online social networks like MySpace and Facebook. For comparison, in blogs dynamics (Mitrović and Tadić 2011; Mitrović and Tadić 2012b) some mean-field influence (q = 0. 4) is necessary to match the empirical system; on the other hand, in product reviews (Garcia and Schweitzer 2011) or chat room conversation (Garas et al. 2012), the key role was attributed to the mean fields (q = 1). Moreover, in the case of social networks, the main contribution of the information field comes from the agent’s individual wall, thus we set ε = 0. 9. We define the sequence of all messages from agent j to agent i as M ji . The wall of an agent i contains the message sequences from all its friends. The influence of the aggregated messages on the agent’s i emotion, however, decays in time with a rate γ h. For the valence and arousal component of the influence field h i v(t), h i a(t), we assume the following dynamics (here z stands either for valence v or arousal a)

$$\displaystyle{ h_{i}^{z}(t) = \frac{\sum _{j}\sum _{m\in M_{ji}}\theta (t,t_{m})z_{j}(t_{m})W_{ji}e^{-\gamma ^{h}(t_{ ji}^{lm}-t_{ m})}} {\sum _{j}\sum _{m\in M_{ji}}\theta (t,t_{m})W_{ji}e^{-\gamma ^{h}(t_{ji}^{lm}-t_{m})}} e^{-\gamma ^{h}(t-t_{ ji}^{lm}) } }$$
(11.5)

where j runs over all neighbors of the node i in the network and m identifies each message from the streams of messages M ij along the link from the neighbor j. For each messages m the creation time t m is traced and the Heaviside step function θ[x] ensures that the influence of that message over time is correctly counted. The emotional content of the message is composed by the values of valence or arousal z j (t m ) of the neighboring agents j at time t m . Its influence further depends on the weight W ji of the directed link between the nodes, which is determined in the empirical network. The exponential terms indicate the aging messages and the decay of the entire influence filed with the rate γ h, where t ji lm is the time of the last message arriving on the wall of agent i. The denominator of Eq. (11.5) plays the role of a normalization to keep the field values properly bounded.

In addition to the individual field component h i , the influence of the friends’ walls aggregated in \(\bar{h}_{i}^{a}(t)\) is specified as follows:

$$\displaystyle{ \bar{h}_{i}^{a}(t) = \frac{\sum _{j}W_{ij}h_{j}^{a}(t)(1 + h_{ j}^{v}(t)v_{ i}(t))} {\sum _{j}W_{ij}(1 + h_{j}^{v}(t)v_{i}(t))} . }$$
(11.6)

In contrast to the above defined fields, Eq. (11.5), the messages on the neighbor’s wall can influence the agent’s i arousal by two different mechanisms. Firstly, \(\bar{h}_{i}^{a}\) is composed of the average over the weighted arousal fields on the friends’ walls at time t. The weights W ij , however, are modified by a term that takes into account the similarity between the valence v i (t) of the agent i and the valence fields of its friends walls h j v. The expression in the brackets in Eq. (11.6) indicates that the valence similarity enhances the importance of the friend’s wall and vice versa, the valence dissimilarity reduces its contribution to the current arousal below the established width of the link W ji . A psychological argument for this assumption is that users often search for information reinforcing their emotional state (Bradley 2009). Furthermore, there is a technical argument: to cope with information overload most social networking sites filter information such that content presented to the user is in line with its previous writing. We note that Eq. (11.6) captures the influence of every “friend-of-a-friend”, who post messages on the walls of the friends of an agent. In other words, a next-nearest-neighbor influence occurs in the online social networks, that cannot be perceived in the same way in off-line social interactions. Our model captures this important feature of the online communication dynamics. When an agent is in the active state, θ i  = 1, it writes a message with a probability ω i that increases with its current arousal a i . The proportionality, as mentioned before, depends on the global activity level, which is proxied by p(t), and a strength parameter a 0, hence \(\omega _{i}(t) =\delta _{\theta _{i},1}a_{0}p(t)a_{i}(t)\). The emotional content of the messages is given by the emotional state of the agent, v i (t) and a i (t), at the time of activity t. Finally, the recipient of the message is determined among the neighbor nodes. Instead of a uniform random choice, friend j of an agent will be chosen with a probability s j (t) that depends on (1) the aggregated information h ji (t) generated by j on the wall of i (whereas W ji represents the strength of the social link between them), and (2) the importance of the wall of friend j to agent i. The rational behind this assumption is the following: when a user writes a message to another user, this can be a part of an ongoing conversation or an initiation of a new conversation. The former is reflected in the first term and the latter in the second term of the following equation:

$$\displaystyle{ s_{j}(t) = \mathcal{A}[\beta \frac{W_{ij}h_{ji}^{a}(t)} {\sum _{k}W_{ik}} + (1-\beta )\frac{W_{ij}h_{j}^{a}(t)(1 + h_{j}^{v}(t)v_{i}(t))} {\sum _{k}W_{ik}(1 + h_{k}^{v}(t)v_{i}(t))} ]\, }$$
(11.7)

\(\mathcal{A}\) is the inverse normalization constant and β is a parameter weighting between these two processes. For simplicity, we choose β = ε, which weights the information in the neighbors’ walls against the own wall. The aggregated information h ji a(t) along the j → i link is assumed to depend only on the arousal component of the sender j in the following way:

$$\displaystyle{ h_{ji}^{a}(t) = \frac{\sum _{m\in M_{ji}}\theta (t,t_{m})a_{j}(t_{m})e^{-\gamma ^{h}(t_{ ji}^{lm}-t_{ m})}} {\sum _{m\in M_{ji}}\theta (t,t_{m})e^{-\gamma ^{h}(t_{ji}^{lm}-t_{m})}} e^{-\gamma ^{h}(t-t_{ ji}^{lm}) }. }$$
(11.8)

Similar to Eq. (11.5), this aggregates a set M ji of messages coming from the agent j on the wall of i.

2.2 Parameters of the Model and Input from the Empirical Data

As stated in Sect. 11.1, the network used for our simulations is taken from the empirical data of MySpace, which are collected and described in Šuvakov et al. (2012a). The network is a reduced version (termed Net3321) of the dialogs-based structure from 2-months dataset, which consists of N = 3321 nodes, connected by weighted directed links W ij (Šuvakov et al. 2012a). The initial value of the agent’s emotional state (i.e., when the agent appears for the first time in the process) are chosen uniformly at random from the intervals a i  ∈ [0, 1], v i  ∈ [−1, 1]. Their activity pattern is drawn from the empirical inter-activity time distribution P(Δ t), shown in Fig. 11.1a. While we are sampling from a distribution observed at resolution of t res = 1 min, the time scale t of our simulations is fixed by the driving signal p(t) with t bin  = 5 min time bin, i.e., each time step in the simulations corresponds to one time bin of the real time. Hence, in case of sampling a value Δ t < 1, the event happens at the current time step. Note that this includes five possible values of the delay time, to which different probability is assigned according to the high-resolution distribution in Fig. 11.1a. The global activity level on the social network is taken by the empirical signal p(t). In Fig. 11.1b, the signal p(t) that is used in the simulations is shown. Its resolution, here 5-min time bins, thus sets the time scale for all time series that are obtained from the simulated data in the following sections.

Apart from the empirical distribution function P(Δ t) and the time series p(t) that we use as input for the simulations, the values for the control parameters of the model are specified in Table 11.1. We can distinguish between the parameters which control the emotional state of the agents (“internal”, γ a, γ v, c 1, c 2), the parameters that affect communications between agents (γ h, q, ε) and the parameters that control the activity of agents (p 0, a 0).

These parameters have a different role and, consequently, importance for the stochastic process. Specifically, the “internal” parameters shape the profile of individual agents. In the absence of empirical data that yield the model of Eqs. (11.1) and (11.2), the parameters in Eqs. (11.3) and (11.4) are chosen such that the maps satisfy some formal conditions. In particular, c 1 ≠ 0 and c 2 > 0 support additive field effects and the presence of fixed points in the relevant regions of the phase space, respectively. Similarly, the choice γ h  < γ a provides with a slower decay of the cumulative arousal of the field compared with the arousal of each individual message. The interaction parameter ε, the ratio between the weights of own wall and the friend’s wall, is characteristic for the online social networks. Therefore, it should be nonzero. A plausible value, as shown in Table 11.1, is used for the simulations. In contrast, the mean-field fraction q = 0 is the most natural choice in the case of online social networks as MySpace since no network-wide knowledge is accessible to individual users. In principle, this parameter can be varied in the simulations, i.e. in analogy to online social systems on evolving networks (Tadić and Šuvakov 2013), where it can affect synchronization of the agents’ activity. The parameter p 0 measures the probability at which the emotional state of an active agent is resetting by an external influence with the specified emotion components \((\tilde{v},\tilde{a})\). In this respect, two different setups are discussed: (1) values \((\tilde{v},\tilde{a})\) are chosen at random from a uniform distribution, and (2) \((\tilde{v},\tilde{a})\) are fixed to one of the three sets representing a target emotion (a) “ashamed”, (b) “enthusiastic”, (c) “astonished”. The first case corresponds to the null hypothesis of a completely unknown external influence that might come from any kind of influence to the agent’s emotional state. The second case of fixed values of \((\tilde{v},\tilde{a})\) will allow us to test the collective effects of large scale events, as for example, mass media, by assuming their influence in the emotional state of the users of MySpace.

Table 11.1 Values of the control parameters and the input functions used in the simulations

3 Simulated Behavior of Agents and Comparison with the Empirical System

3.1 Agent’s Trajectory in Phase Space

Before we discuss the aggregated output, we provide two examples of the dynamics of individual agents in terms of their emotional variables valence v i (t) and arousal a i (t). The simulation results which are shown in Fig. 11.2, demonstrate that states with high arousal can be built up due to the interaction of an agent with its neighborhood or, less often, by a single large input from the external environment. Repeated activities in short time intervals occur if an agent remains ‘caught’ by an active neighborhood over long periods of time. In these time series, the peaks in both arousal and valence occur when the agent’s emotional state was influenced by messages from its neighbors, or when its emotional components are reset by a large external input \((\tilde{v},\tilde{a})\). In the absence of any action, however, both valence and arousal exponentially decayed towards zero. Further, one can notice that an agent’s valence fluctuates being influenced either towards positive or towards negative values, without any specific preferences.

Fig. 11.2
figure 2

Time series of the valence (lower curve) and the arousal (upper curve) of two active agents in a simulation of our MySpace model

In the remaining parts of this section, we compare some simulated results with the corresponding results that we obtain from the empirical dataset in MySpace. As it was explained above, some empirical data, i.e., the driving signal p(t) and the delay time distribution, P(Δ t), have been already used as the input parameters in the simulations. However, the activity patterns and emotional response of agents do not trivially follow from a driving signal p(t) and a given network topology. Instead, only with the right assumptions about the agent’s emotional interaction, we are able to reproduce the stylized facts as explained below. For the following simulation results, we sample the external influence \((\tilde{v},\tilde{a})\) from a uniform distribution. The effects of a specified emotion input in the collective behavior of agents will be studied later. Here, we can compare the valence distribution of the messages generated by the emotional agents in the network with the distribution of valence of the emotional messages of users in the empirical data of (Šuvakov et al. 2012a). For this purpose, we first extract the corresponding emotional contents—valence and arousal—from the texts of messages in the empirical data.

3.2 Extraction of Emotional Content from Message Texts

For comparison of the simulated emotional behavior of agents with the empirical data in MySpace network, here we also analyze the emotional contents of the text messages in the empirical data of reference Šuvakov et al. (2012a). Specifically, we quantify emotions with respect to two dimensions, arousal and valence (Russell 1980). The latter indicates the pleasure associated with the emotion (positive, negative, neutral), the former the level activity that it induces.

In order to extract the emotional content from the messages, we use sentiment analysis by applying a standard procedure introduced in Dodds and Danforth (2010). It uses the ANEW dataset, a lexicon of human ratings of valence and arousal with about 1000 words (Bradley and Lang 1999), for which the emotional charge, or valence, v i and the arousal a i was determined. An algorithm then calculates the frequency f i of such classified words in a given text message, to compute the valence and arousal of the text sequence as

$$\displaystyle{ v_{\mathrm{text}} = \frac{\sum _{i=1}^{n}v_{i}\,f_{i}} {\sum _{i=1}^{n}f_{i}} \;;\quad a_{\mathrm{text}} = \frac{\sum _{i=1}^{n}a_{i}\,f_{i}} {\sum _{i=1}^{n}f_{i}} . }$$
(11.9)

For the first time, here we apply this method to the MySpace dataset. Due to the limited size of the ANEW lexicon, the method should be preferably used on long texts because of statistical reasons. To overcome this limitation, we extracted the stem, or root form, of all words in the analyzed text. The stem contains most of the semantic information of a word (and thus its emotional content), and allows us to match similar words rather than exact matches, which eventually improves the statistics. To extract the stem, we used Porter’s Stemming algorithm (van Rijsbergen et al. 1980), a technique that applies inverse generalized rules of linguistic deflection, mapping deflected words to the same stem. For example, the stem of the words “lovely” and “loving” by that method is “love”, which matches the corresponding word in the ANEW lexicon. This way, the sentiment analysis covers a larger portion of the text and allows to calculate the emotional values for more than 60 % of the messages in the dataset.

The results of the analysis of emotional expression of the MySpace dataset are presented in Fig. 11.3. To be compatible with Russell’s circumplex model (Russell 1980), we rescaled the output of Eq. (11.9) to the range [−1, 1] and adopted the standard polar diagram for the quantitative representation of emotions by using the following transformation:

$$\displaystyle{ x' = x\sqrt{1 - \frac{y^{2 } } {2}} \;;\quad y' = y\sqrt{1 - \frac{x^{2 } } {2}} . }$$
(11.10)

Different points in this diagram are associated with different emotions. For comparison, the markers 1 − 19 indicate examples of emotions which are known in psychology (Scherer 2005).

Fig. 11.3
figure 3

Circumplex map of the emotions extracted from the MySpace dataset. The frequency is indicated by the color scale from 0 to 50, and the binning is done in a grid of 200 × 200 bins. Markers indicate different emotions: 1—“delighted”, 2—“amused”, 3—“interested”, 4—“expectant”, 5—“convinced”, 6—“passionate”, 7—“hopeful”, 8—“feeling superior”, 9—“astonished”, 10—“longing”, 11—“pensive”, all on positive valence side, and 12—“impatient”, 13—“worried”, 14—“suspicious”, 15—“distrustful”, 16—“ashamed”, 17—“frustrated”, 18—“disgusted”, 19—“miserable”, on the negative valence side

The distribution of valence values for the messages of our dataset is highly biased towards positive values, as the largest density in Fig. 11.3 is above 0. Figure 11.4 shows the distribution of valence for messages that contain at least one word from the ANEW dataset. We notice that the mode is at 0.5. On the other hand, we have shown (Garcia et al. 2012) that English written text is naturally biased towards positive emotions, with a mean μ v  = 0. 31 and a standard deviation σ v  = 0. 47 for the valence. This needs to be taken into account to interpret Fig. 11.4, so we renormalise each valence value using \(v' = (v -\mu _{v})/\sigma _{v}/\sqrt{w}\), where v is the valence from Eq. (11.9) and w is the amount of ANEW words in the message. The renormalized valence distribution is shown in the inset of Fig. 11.4. We find that, despite this renormalization, there is still a large bias towards positive emotions in the messages of MySpace.

On the other hand, the distribution of the expressed arousal (vertical axis of Fig. 11.3) is quite concentrated around values close to 0, i.e. MySpace messages rarely contain words expressing strong arousal. This finding is in line with previous survey studies (Paltoglou et al. 2013; Thelwall et al. 2010) in which arousal from written texts showed a small variance.

Fig. 11.4
figure 4

Distribution of estimated valence of messages with at least one word from the ANEW dataset. Inset: distribution of the renormalized valence taking into account the amount of ANEW words in the message and the statistics of human expression on the Internet from (Garcia et al. 2012). Both histograms show a clear bias towards positive expression, even above the natural bias of human expression

3.3 Comparison of Simulated and Empirical Distributions

For the comparison of simulated agent’s with the ones found in the empirical data, we consider the emotional valence of each agent in the moment of action. The histogram, averaged over all agents in the system, is shown in Fig. 11.5 together with the histogram of valences observed in the empirical data. The empirical distribution is equivalent to the one shown already in Fig. 11.4, except for the peak at v = 0 which contains all messages that did not contain any word from the ANEW dataset used for classification. We notice that both distributions have an obvious bias toward positive valence, which is stronger in the empirical data than in the simulations.

Fig. 11.5
figure 5

Distribution of the valence of MySpace messages (dark), including the ones without any ANEW term in the bin at v = 0. In grey, the distribution of expressed valences in the simulation. Both distributions have a large bin of nonemotional expression close to zero, and the rest of the distribution shows a strong bias towards positive values

Here, rather than focusing on the quantitative comparison, we affirm that our model is in fact apt to generate this bias as the result of emotional interactions. Without any interaction, the agent’s valence would relax towards zero because of the decay factor in Eqs. (11.1) and (11.2). However, the social interaction with other agents through the fields h on the network generates the positive bias in agreement with the empirical findings. This also supports previous work that argues about the social origin of the positive bias (Garcia et al. 2012; Rimé 2009). Further similarity between the simulated and the empirical system, in particular in the aggregated behavior of agents, is discussed Sect. 11.4.

4 Simulated Network-Wide Emotional Activity of Agents

4.1 Temporal Correlations in Emotional Messages of Agents

As already explained in Sect. 11.2, in the simulations we use P(Δ t) and p(t) as inputs in the computer code. Hence, other quantities, i.e., the time series of the number of all messages and the number of messages carrying positive/negative emotion, are reproduced in the simulations. Properties of these time series then can be compared with the respective time series of the empirical data studied in Šuvakov et al. (2012a). The simulated results are shown in Fig. 11.6 both in terms of the time series and the power spectrum S(ν) ∼ ν ϕ. While the driving signal p(t) has the power-spectrum exponent ϕ p  = 0. 67 ± 0. 11, we obtain \(\phi _{N_{c}} \approx 0.91 \pm 0.08\) for the driven signal, which exceeds the value \(\phi _{N_{c}} \approx 0.65 \pm 0.12\) of the corresponding empirical data. This suggests that the emotional interactions among agents induce even stronger correlations. A similar observation holds for the range of the scaling region in the fluctuations, shown in Fig. 11.6c, although the Hurst exponent is the same as in the empirical data (see Šuvakov et al. 2012a for more details).

Fig. 11.6
figure 6

Simulated time-series of the number of messages N c (t) in black and the driving signal p(t) in pink of the emotional agents on the network Net3321 (a ), power spectrum (b ) and scaled fluctuations of the simulated and empirical time series (c ). The straight lines indicate the slopes of the correlated part of the power-spectrum in (b ) and the scaling region in (c )

As discussed above, the simulated time series for N c (t) exhibit the long-term correlation, in analogy to the empirical system. However, the crossover between the uncorrelated and the correlated events occur at a larger time scale in the simulations, i.e., cascades on small time scales are not captured by the simulations. On the other hand, the behavior on long time scales is well reproduced. Thus, our model is able to reproduce the emergence of long range correlations in the emotional expressions, which indicates the emergence of collective emotions.

Fig. 11.7
figure 7

Time series (bottom) and (top) power-spectrum of the number of messages N c (t) in a simulation as response to an artificial driving signal composed of white noise with super-imposed circadian cycles

Let us now discuss the importance of the spectral properties of the driving signal p(t). Are the long-range correlation in the number of messages induced by the correlations in the driving signal? In order to test this, we performed simulations in which the driving signal is composed of white noise with a superimposed circadian component of the daily periodicity. The average value of the white noise is set to the mean of the empirical time series, \(\langle p(t)\rangle\), but there are no long range correlations, in contrast to the original signal p(t). Keeping all other parameters unchanged, we simulate the network response to this driving signal. Contrary to the results in Fig. 11.6, now N c (t) does not show any correlations, as displayed in Fig. 11.7, i.e., apart from the daily periodicity, the power spectrum retains the characteristics of a white noise. This suggests that the occurrence of circadian cycle of daily activity is not sufficient to create the long range correlations, which are characteristic for the real data. We comment on this in again in the conclusions.

4.2 Simulations of External Influence

To understand the influence of external events on the emergence of collective emotions, in our simulations we consider externally triggered resets of the emotional state of agents to a specified value for the valence and arousal, \((\tilde{v},\tilde{a})\). As it was explained in Sect. 11.2.2, \((\tilde{v},\tilde{a})\) can be either fixed or sampled from a uniform distribution. While the latter case is covered by the simulation results in Sect. 11.4.1, here we use fixed values for \((\tilde{v},\tilde{a})\) which indicate three different emotional inputs, namely: (a) “astonished” (v = 0.4, a = 0.88), (b) “ashamed” (v = −0. 44, a = −0. 5), (c) “enthusiastic” (v = 0.5, a = 0.32). In the psychology literature (Scherer 2005), the emotions “astonished” and “ashamed” are believed to have different influence on the social interaction and emotional communication. In our quantitative model, these two emotional states are in the opposite parts of the circumplex map (see Fig. 11.3): “astonished” is a positive emotion with a high arousal value, while “ashamed” is a negative emotion with a low arousal value.

Fig. 11.8
figure 8

Simulated time series N c (t) (a ) and (b ) in the case of fixed external influence \((\tilde{v},\tilde{a})\) set to the point corresponding to “astonished” and “ashamed”, respectively. In both cases the driving signal p(t) was used. Fluctuations (c ) and power spectrum (d ) of these time series

With the simulations, we examine how these fixed emotional inputs \((\tilde{v},\tilde{a})\) influence the cascade of emotions on the social network. The simulated time series and power spectra and fluctuations of N c (t) are shown in Fig. 11.8, corresponding to “astonished” and “ashamed” emotional input. The power spectra of N c (t) in both cases show the same shape of 1∕ν ϕ with the exponents close to 0. 76 ± 0. 11 in the case “astonished”, while 0. 98 ± 0. 05 approaching flicker noise, in the case “ashamed”. These values are higher but not significantly different to the value found in the case of the uniformly sampled emotion components \((\tilde{v},\tilde{a})\), shown in Fig. 11.6. But the correlations extend for a larger range in the case of “ashamed” (also noticeable in the lower value of S(ν) at high ν), even though it is a low-arousal negative emotion. On the other hand, the level of activity in the time series is higher in the case of the positive emotion “astonished”, due to a higher arousal in these messages.

Fig. 11.9
figure 9

Histograms of visited states in the circumplex for simulations with external influences sampled from a uniform distribution (a ) and in fixed to “ashamed” (b ), “enthusiastic” (c ) and “astonished” (d ). Arousal is rescaled to the interval [−1, 1]

The collective emotional response of agents that is observed in the correlated time series, is built on the actions of individual emotional agents on the network. The evolution of the emotional state of an agent, like the examples shown in Fig. 11.2, can be seen as a trajectory in a circumplex (Ahn et al. 2010), similar to the circle map shown in Fig. 11.3. In this case, the circumplex is obtained by applying the transformation of Eq. (11.10) on the emotion variables arousal a i (t) and valence v i (t) of each agent’s states over time. Hence, we can explore the collective effects of different types of external inputs by simply observing the emotional states which are “visited” by the agents on the circumplex.

In the color plots of Fig. 11.9 we show the histograms of different emotional states that were visited by the agents in our simulations. More precisely, we plot the emotion states of each agent i at every moment when the agent was active, i.e., θ i  = 1. The level of activity among the agents varies a lot, depending on their location in the network and the events occurring in the agent’s neighborhood. Consequently, an agent’s contribution to these emotion histograms will vary according to their activity in a given simulation. The patterns shown in Fig. 11.9 represent situations with a random and the three specific external inputs: “ashamed”, “astonished”, and “enthusiastic”. The histograms in the two upper panels of Fig. 11.9 show how high arousal states may arise starting from (a) uniformly distributed random input or (b) a low-arousal negative valence state like “ashamed”. In the lower panels, the external influences are set to two different high arousal positive states: “astonished” and “enthusiastic”. The influence of these states spreads through the networks by means of agent interactions through the field, giving raise to the asymmetrical V-shape pattern.

4.3 Propagation of Emotions in the Network

The agent-based model also allows us to understand how cascades of emotional influence propagate through the real social network of MySpace. Precisely, will positive emotions propagate along the same social links as negative ones? Obviously, agents may exchange positive or negative messages with different preferred neighbors. To what neighbor the message will be sent depends on the agent’s past interaction along that link, the strength of the influence fields and the valence similarity with the wall of the recipient agent. The global problem of finding the pattern of most frequently used links on the entire network is adequately investigated by the maximum-flow spanning tree of that network. On these trees, each node is attached to the rest of the tree by its strongest link. Again, strength of a link between two agents is determined as the total amount of messages sent along that link during the simulation time.

Figure 11.10 shows these strongest links between the agents for two simulations with different external influence, i.e., with a positive (“enthusiastic”) and a negative (“ashamed”) input emotion. For comparison, the time series from the same simulation runs are shown in Fig. 11.8 and the patterns of visited areas in the phase space, in Fig. 11.9b, c. Obviously, the two flow patters, shown by the spanning trees for the entire network of N = 3321 nodes, differ considerably from each other.

Fig. 11.10
figure 10

Maximum-flow spanning trees for agent dynamics in our MySpace simulations with \((\tilde{v},\tilde{a})\) fixed to the values corresponding to the state “enthusiastic” (top) and “ashamed” (bottom)

Note that the spanning trees reflect the directedness of the links, i.e., an agent i may have its strongest link to j (in terms of messages exchanged), but not vice versa. The occurrence of strong hubs in the social network is common. The hubs appear in the spanning tree as the agents to whom many other agents have their strongest links.

Interestingly, in the case of the positive emotion with a high arousal, “enthusiastic”, the large hubs occur along the central branch of the tree, and similarly, side branches contain smaller hubs of comparable size. On the other hand, in the case of negative emotions with a low arousal “ashamed”, the tree splits in two major branches, and the hubs of different sizes appear along each branch. It should be stressed that these dynamical patterns, which emerge after long simulation time, are based on the emotional interactions between agents in the same network structure. Further simulations and a systematic analysis would be necessary to quantify differences between these patterns by suitable measures.

5 Conclusion

We have studied dynamics of the emotion-driven exchange of messages in online social networks with a particular emphasis on the emergence of collective behaviors of users. In the model, the users are represented by the agents, whose arousal and valence fluctuate in time, being influenced by internal and external inputs and “reactivity” of the network. In full analogy to the empirical data, a high-resolution dynamics is maintained in the model. The rules of actions are motivated by realistic situations in the online social networks; the network structure and some of the parameters governing the dynamics are inferred from the dataset of MySpace dialogs.

Note that our model is directly applicable to other online social networks, which share the same interaction rules—message exchange through friend’s walls—provided that the parameters are inferred from the related dataset of that network. Several other parameters, for instance decay time of emotion and network “reactivity”, which can not be estimated from the available empirical data, have been kept within theoretically plausible limits. In addition, within the model we infer the action-delay and circadian cycles as generated by the real-world processes of MySpace users, which condition the pace of their actions and stepping into the world of the online social network, respectively. With this “native” set of control parameters, the simulation results enable us to derive several conclusions, in particular regarding the emotion spreading processes in MySpace, and point out the potential of the model for predicting user behaviors in hypothetical (experimental) situations.

Our main conclusions are summarized as follows:

  • Temporal correlations of user activity in MySpace occur on long-time scale and are accompanied by high arousal and predominantly positive emotions.

  • Rhythms of users stepping from offline-to-online world carry certain important features of the communication processes in the online social networks. Specifically, the temporal correlations in the online dynamics are built as a response to already correlated step-in processes. Otherwise, if not driven in a different way, the online social networks with their internal dynamics of the user-to-user contacts and restricted visibility of messages are not capable to generate correlations on a large temporal scale.

  • Patterns of emotion dynamics in the online world of social networks are different for positive and for negative emotions. In the empirical data of MySpace the positive-valence emotions dominate. However, model simulations of spreading emotional states with different arousal–valence components and different social connotations, “enthusiastic” and “ashamed”, for example, show different patterns in the phase space of the emotions involved as well as the social links used to spread the emotions on the network.

  • High-arousal states in the dynamics are built on small noisy input for all initial emotion states in our simulations, which is reminiscent of “party”-like behavior of agents. According to our model this is a consequence of collective effects—repeated actions of an agent caught in the active network environment.

Quantitative comparison of the simulated data with the empirical data analysed in Šuvakov et al. (2012a) indicate similar results, for instance, the long-range correlations in the emotional time series in Fig. 11.6, and the range of the expressed valences, in Fig. 11.5. This suggests that the model of emotional agents can reproduce the stylized facts of the empirical data of MySpace dialogs, when the parameters are appropriately chosen. Moreover, within the model, genesis of the emergent behaviors—based on contributions of each user (agent) and its social connections—can be revealed. This makes the predictive value of the model. It is more subtle, however, to relate the predictions of the model which regard the individual agent’s emotional state and its fluctuations with the “feelings change” observed in the psychology research of the online communications. In this respect, one can recognize that a characteristic area in the positive-valence high-arousal states recurrently being visited by the agents, may reflect the positive baselines of human valence and arousal found in Kuppens et al. (2010).

Moreover, the emergent asymmetrical V-shape patterns of Fig. 11.9 can be compared with the patterns of natural selective attention, that is often discovered in psychophysiological studies (Bradley and Lang 1999). For evolutionary reasons, humans have two modes of reaction to emotional content: appetitive and defensive motivation. Both tendencies can be seen in our simulations, opening the question of which one of them is predominant in the users’ internal emotions. In this way, our agent based model provides testable hypotheses for further research, as the dynamics of the emotional reaction of users of online communities might depend on the emotional state of new members. An experimental setup, similar to the setup presented in Küster et al. (2011), can further provide a test whether the physiological reactions to new community members (arrivals) follow the patterns predicted by our model.

In conclusion, the presented agent-based simulations give a new insight into emotion dynamics in online social networks. In the model, the interaction rules, closely related to MySpace and other social network sites, take into account influence of the next-neighborhood on the agent’s state—a salient feature of the online social networks, and the extended phase space where common emotions can be recognized. Hence, despite of its mathematical complexity, our model provides a “laboratory” for further experiments on the emotional agent’s behavior (e.g., under different driving conditions, varied external inputs, and changed values of the parameters) and for a comparative analysis of online and offline social networks.