The dynamics of emotions in online interaction

We study the changes in emotional states induced by reading and participating in online discussions, empirically testing a computational model of online emotional interaction. Using principles of dynamical systems, we quantify changes in valence and arousal through subjective reports, as recorded in three independent studies including 207 participants (110 female). In the context of online discussions, the dynamics of valence and arousal is composed of two forces: an internal relaxation towards baseline values independent of the emotional charge of the discussion and a driving force of emotional states that depends on the content of the discussion. The dynamics of valence show the existence of positive and negative tendencies, while arousal increases when reading emotional content regardless of its polarity. The tendency of participants to take part in the discussion increases with positive arousal. When participating in an online discussion, the content of participants' expression depends on their valence, and their arousal significantly decreases afterwards as a regulation mechanism. We illustrate how these results allow the design of agent-based models to reproduce and analyse emotions in online communities. Our work empirically validates the microdynamics of a model of online collective emotions, bridging online data analysis with research in the laboratory.

DG, 0000-0002-2820-9151; FS, 0000-0003-1551-6491 We study the changes in emotional states induced by reading and participating in online discussions, empirically testing a computational model of online emotional interaction. Using principles of dynamical systems, we quantify changes in valence and arousal through subjective reports, as recorded in three independent studies including 207 participants (110 female). In the context of online discussions, the dynamics of valence and arousal is composed of two forces: an internal relaxation towards baseline values independent of the emotional charge of the discussion and a driving force of emotional states that depends on the content of the discussion. The dynamics of valence show the existence of positive and negative tendencies, while arousal increases when reading emotional content regardless of its polarity. The tendency of participants to take part in the discussion increases with positive arousal. When participating in an online discussion, the content of participants' expression depends on their valence, and their arousal significantly decreases afterwards as a regulation mechanism. We illustrate how these results allow the design of agent-based models to reproduce and analyse emotions in online communities. Our work empirically validates the microdynamics of a model of online collective emotions, bridging online data analysis with research in the laboratory.

Introduction
Intergroup emotions theory, based on appraisal theory [1][2][3] and the social identity perspective [4], suggests that dynamic variability of emotions over time can be found not only at the individual level but also at the level of group and collective emotions [5,6]. More specifically, emotional experience has been found to elicit the social sharing of emotion in the construction of emotional climates [7,8], via processes that involve emotion contagion [9], conformity with group norms [4] and social or group-based regulation of emotion [5,10] encounters, in particular because many of the sources of over-time variability of group-based emotions [5] and collective emotions [6] may be at least partially of an informational nature. Participatory online communities, such as social networking sites or discussion forums, provide a thriving medium for the emergence of such collective emotional phenomena.
Collective emotions are defined as states of an community in which a large number of individuals share one or more emotional states [6,10]. While the differences between face-to-face and online interaction are evident, collective emotions can also emerge in online communities [11,12], a topic that is receiving rising attention in the literature (see chapters 25-28 of [12]). In the field, collective emotions can be found frequently in online communities, including spontaneous fights in political forums [13], the spreading of Internet memes [14] and political movements [15], or user-generated content on YouTube that may, under certain circumstances, become viral through the excitement of thousands of users [16,17]. For example, in the 2008 Presidential campaign, supporters of the Obama campaign successfully initiated the spreading of the well-known 'Yes We Can' video that had attracted over 20 million views by the time of the democratic nomination [18]. In such cases, there is an intriguing interplay of collective emotions online and emotional behaviour offline.
While collective emotions also appear in offline situations, the case of online interaction has recently attracted a lot of attention for three reasons: (i) Internet access has spread rapidly over the past decade [19], (ii) its usage has notably diversified [20] and (iii) the traces left on publicly accessible posts and messages allow quantitative analyses of unprecedented size and resolution. Examples of the latter are recent insights into collective emotions that have been derived from forum discussions [13], real-time chatroom conversations [21] and Twitter messages [22]. The role of collective emotions in communication is, obviously, not entirely new to the Internet. In fact, communication sciences have been studying massmediated one-to-many communication for decades, particularly in the context of print media, radio and television [23]. Collective emotions in offline scenarios are related to the concept of emotional contagion [24], which is related to several communicative processes, such as dyadic mimicry [25]. Online interaction is still mainly based on textual communication, which has been shown to create interpersonal emotional interaction in real-time chats [21]. Furthermore, controlling social media interaction by its emotional content creates small linguistic cues in written emotional expression [26]. Online written interactions have the power to elicit emotions in the users of online media [27], offering us the chance to combine observational and experimental studies in a unified view of online collective emotions.
Emotional interaction leads to the emergence of collective emotional states that cannot be simplified to behaviour observed when individuals react in isolation to emotionally relevant events [10]. This micromacro gap calls for models that can explain the emergence of collective emotions from social interaction [28]. An established approach to understand collective social phenomena is agent-based modelling [29]. Agent-based models are mathematical formulations that define the states and interactions of agents, allowing the analysis of collective behaviour either through simulations or through methods from statistical physics. The aim of agent-based modelling is not to design a detailed model that includes all possible aspects of the behaviour of the agents, but to propose a minimal set of computation rules and dynamics that lead to the observed collective behaviour. A paradigmatic example is Schelling's model [30]: an extremely simplified model of spatial mobility that shows how social segregation emerges from weak individual biases [31].
Agent-based approaches and computational models are still scarce in empirical psychology [32]. However, this tradition may be about to change. Agent-based models can provide new insights into social psychology [33], unifying different models of social interaction into a comprehensive computational representation of emotions that can encompass a variety of aspects, including identification processes [34] that can take place during online social interaction [35], changes in selfcategorization as a group member [36], emotional contagion [9,24], as well as affective-discoursive patterns that may help to reconnect discourse studies with novel research on affect and emotion [37]. Towards this aim, the modelling in this paper will be based on the valence and arousal circumplex of core affect [38][39][40]. This view is not specific to emotion, but provides some grounding to the application of our techniques in social psychology. Regarding emotional dynamics, some works within mathematical psychology provide support for the usefulness of using agent-based modelling in such contexts [41]. For example, coherence in self-evaluation has been modelled as a cellular automaton [42], in which memories are represented by cells and the attitude of an individual to certain memory evolves depending on its relationship to other memories, leading to the emergence of self-esteem. Concepts of dynamical systems can also be applied to model emotions, for example explaining fight or flee reactions as bifurcations [43] in which the emotional state of an organism can sharply change depending on a control parameter. Furthermore, the principle of Brownian agents [29] has been proved useful to analyse the temporal  [32], modelling changes in emotions as equations with a deterministic and a stochastic component. In addition, agent-based models of emotions are also used in the context of momentary subjective well-being [44] and in cue-reward learning [45]. While these models explore and validate aspects of individual emotions, agent-based models of emotions under social interaction are still to be empirically analysed. Our focus on the social aspects of emotions is aimed at the design of models with potential to explain and reproduce collective emotions.
Agent-based models can be very useful to predict future user behaviour, or to design mechanisms that optimize certain aspects of the community. But this cannot be achieved if the microdynamics that drive agent actions is not validated beyond computer simulations or analytic results. It is relatively simple to design a model that, based on ad hoc assumptions, reproduces any observed macroscopic behaviour. As part of an interdisciplinary collaboration to understand the dynamics of collective emotions in online communities [46], the Cyberemotions modelling framework [11] was designed to provide generative mechanisms of online collective emotions, explicitly avoiding the pitfall of using ad hoc assumptions and implausible dynamics. This framework allows the creation of models of user emotions under different kinds of online interaction, linking collective behaviour with individual dynamics in the presence of online interaction mechanisms. The dynamics of emotions of agents in the Cyberemotions framework is phrased within the psychological theory of core affect [38], which provides a unified representation of the kind of emotions we refer to. While collective behaviour can be analysed through observational studies of large-scale datasets of online interaction, the individual dynamics must be empirically tested in experimental studies.
The Cyberemotions modelling framework has been shown useful to understand the conditions that lead to collective emotions in product reviews [47] and chats [21]. Following the concept of agent-based theory building in social psychology [33], we phrase the agent dynamics that reproduce online collective emotions [11] as testable hypotheses. In this article, we formulate and test those hypotheses against data collected in experiments on emotion dynamics. We report the results of three independent studies that allow us to quantify emotional changes while reading and writing posts in online forums. We measure the functional dependencies between online content and changes in emotional states, to compose a computational model that can simulate the dynamics of emotions under online interaction.

Emotional agents model
In the Cyberemotions modelling framework [11], the emotional state of an agent is composed of two variables: valence v i (t), quantifying the degree of pleasure associated with an emotion, and arousal a i (t), representing the degree of activity associated with the emotion. Agents have an expression variable s i (t) that quantifies their displayed emotions through online posts, which are aggregated with the expression of other agents in the online field of interaction h. The first assumption of our model is the existence of internal eigendynamics that make emotions relax to an equilibrium state. Secondly, the changes in emotions due to social interaction, or perception dynamics, are defined as functions that take as input the values of valence and arousal and the interaction field h. Thirdly, the expression of an agent through s i (t) is assumed to be triggered by expression rules that determine the value of s i (t) based on the emotional state of the agent, leading to a feedback of expression that changes the emotional state of the agent after expression. The field variable h takes positive values when online discussions are positively charged, negative when discussions are negatively charged, and 0 when no clear emotionality is present in online interaction. Figure 1 depicts the main variables of the framework and their influences. We model the dynamics of emotions as a linear combination with a stochastic component, following the principle of Brownian agents [29] δv and h v s a Figure 1. Schema of the agent-based model of emotion dynamics [11,47]. The internal state of an agent is composed of valence v and arousal a, and the communication through the online medium is quantified by the field h. Valence and arousal change according to a combination of internal eigendynamics and perceptiondynamics, the latter depending on the field h. Expression s is triggered by production rules depending on the emotional state of the agent. Expression changes the field and leads to a feedback of expression that regulates the emotions of the agent.
presence of emotional content in the field, while valence depends on the polarity of the online interaction. The functions F v and F a are defined as where b j and d j are parameters that define the changes in valence and arousal induced by different values of h. F v depends on h, while F a depends on the absolute value |h|, modelling the excitability of arousal with emotional content independently of its polarity. The dynamics of the field h can be quantified through aggregates of the emotions in the messages of a discussion [21,47], and are influenced by the emotional content of the expression of the agents, s i (t). This expression depends on the emotional state of the agent, following expression rules and being triggered by states of high arousal. When produced, the expressed text carries a polarity that depends on the valence of the agent. We formalize this through the equation where the expression of the agent has a value that is a function f s (v i (t)) of its valence. The expression s i (t) is activated if the arousal reaches a threshold value τ i , which is captured by the Heaviside step function Θ [x]. The feedback of expression produces an instant decrease in the arousal of the agent as an additional relaxation after writing a message.
In the following, we present an analysis of empirical data that explores emotion eigendynamics, perception dynamics, and rules and feedback of emotional expression through posts. Our results are based on a set of experiments that monitor the emotional states of their participants in different ways. We present data from three experiments in which participants were exposed to online emotional content, including reading about emotional experiences and writing about highly emotional topics themselves. These experiments, explained more in detail in the Material and methods section, were designed to test the dynamics of online emotional interaction, and to provide data in the form of subjective assessment of emotions. We investigate emotion dynamics within our agent-based framework, estimating the values of the parameters that drive individual emotions. Owing to the limited size of experimental data, we restrict our analysis to general emotion dynamics, ignoring individual differences. In the following, we drop the subindex i of our dynamics, leaving the analysis of the differences emotion dynamics across individuals for future research.
3. Material and methods 3 topics (e.g. lovingyou.com, femalesneakerfiend.com, loveshack.org) to cover a wide range of emotional topics ranging from contentious political discussions to questions about relationships, love and heart-ache. All threads were drawn from a larger sample, and pre-categorized by three psychologists to contain text expressing emotions with certain polarity (nine negative, nine positive and two neutral). Stimulus valence (positive, neutral and negative) was varied as a within-subjects factor. The experiment was conducted online using Questback EFS survey (www.unipark.de), where the participants read the threads in randomized sequence, one post per page, at home on their own computers. Participants received a link to the experiment, were provided with a description of the study, and generated an anonymous code to receive their compensation with course credit or 6 Euro. Electronic supplementary material, figure S1, shows an example of a post as seen by the participants that was preselected as part of a negative thread taken from a real BBC forum discussion. After reading the posts of a thread, participants provided subjective reports of their emotions on three seven-point Likert scales to assess the subjective emotional response. With a view towards the requirements of the repeated measurement situation (10 threads), we aimed to obtain sufficiently reliable measures while the relatively weak and fleeting emotional states that can be elicited by forum posts could still be expected to be present. For this purpose, e.g. even the two relatively short 10-item scales of the positive and negative affect schedule (PANAS, [48]) would have been too long and not sufficiently focused on the immediate emotional response to an individual emotional stimulus such as a forum thread. Instead, our measurement situation was much more comparable to experimental designs assessing emotional responses to emotional images, sounds or words in the laboratory [49,50]. These types of designs typically measure valence, arousal and sometimes dominance (power) via single-item graphical scales such as the self-assessment manikin (SAM) [51]. Single-item Likert-type measures, if well phrased and designed, are not necessarily worse than multiple-item scales [52]. For example the SAM has been the basis for the validation of the extremely well-cited international affective picture system (IAPS) [53]. However, the graphical version of the SAM requires some additional instructions and explanations that are, ideally, delivered by an experimenter who can respond to questions. In addition, valence has recently been increasingly discussed as a potentially two-dimensional construct allowing co-activation of both positive and negative feeling states, such as in the case of bittersweet mixed emotions [54].
We assessed valence via two separate Likert scales, as well as arousal via a third scale comparable with the phrasing of the SAM. However, no systematic evidence for mixed-valence emotions was observed. Cronbach's α = 0.88 across all positive and the inverse of all negative valence judgements suggested sufficient overlap between both items to justify integration of both scales into a single measure by subtracting the value of negative affect from the value of positive affect and mapping the result to the scale of [−1, 1]. The third Likert scale measured the degree of excitation experienced by the participant, which we likewise rescaled into our measurement of arousal in the scale [−1, 1]. Finally, to obtain additional data beyond the strictly emotional response, participants answered a short set of four appraisal-related questions in response to each thread (perceived interest, relevance, wish to continue and wish to participate). We rescaled these answers to scales of [0, 1], measuring in particular the probability of participation. The subjective assessments of emotions of this study are useful to study eigendynamics and perception dynamics, and the answers to the questionnaires provide data on how users decide when to create posts, following expression rules. -Study 2. This experiment was an equivalent of Study 1 in a controlled experimental set-up. To further improve the validity of the scales in comparison with the online assessment, and to reduce unwanted anchoring and sequence effects that might occur when items are presented on-block in a numbered grid, each scale was presented individually on the screen with input provided via a seven-button response-pad without numbered keys (Cedrus RB-730). The seven threads used for this experiment are a subset of those for Study 1 (three positive, three negative and one neutral). Again, the emotional responses were assessed using two items for valence (1: 'not at all positive' to 'very positive'; 2: 'not at all negative' to 'very negative') and one item for arousal ('very calm' to 'very excited'); however, this time using the standardized response pad in a laboratory situation instead of the keyboard at home. were asked to write contributions to positive and negative emotional topics either in the form of replies or as initiators of new forum threads. Topics were presented and responses were collected using Medialab (Empirisoft). In a within-subjects design, all participants were instructed to respond to a selection of five short positive forum posts, a selection of five negative posts, and to initiate one positive topic as well as one negative topic. This procedure resulted in the production of four forum posts per participant. When asked to respond to a forum post, the ability to choose from among a selection of pretested topics aimed to increase personal relevance of the chosen topic's content, and thus the emotional significance, while making it easy for participants to respond. When asked to initiate a new topic with a first post of their own, participants received direct on-screen instructions to write about a positive versus negative topic that they liked versus disliked, felt good versus bad about, and that they would be willing to share with others. Thus, while participants knew that their input to both types of forum discussions would not be posted online, they were asked to 'imagine that the text you write will be posted to an online forum, a newsgroup or an open chat'. We expected that some participants might find it easier to be asked to respond to a topic of their choice while others might have a greater preference for a more open discussion topic that they could define on their own, and this design aimed to facilitate the generation of overall sufficiently long responses from all subjects. Nevertheless, participants were free to write as much or as little as they liked. The participants provided subjective assessments of their emotions before and after writing the posts, which we will use to study the feedback of expression into emotions.
Conforming with standard ethical guidelines, participation in all three of the above studies was entirely voluntary, and participants were informed that they could quit participating in the study at any point in time without any negative consequences. Participants provided informed consent at the beginning of a study, and all participants were fully debriefed at the end of each of the studies in this research. Furthermore, to avoid any negative impact on participant's emotional well-being during or after taking part in the study, the study design provided a balancing positive emotional stimulus for each negative stimulus that was presented, thus preventing any build-up of negative emotional states. In the laboratory studies, participants were furthermore given the opportunity to ask questions to the experimenter who ensured that there were no potentially lingering negative effects of the negative forum threads at the end of the study.

Regression models of perception dynamics
Using an event timescale, we aggregate the data in a set of changes per time unit v(t)/ t and a(t)/ t, or valence and arousal 'velocity'. We then analyse their dependence on the instant value before reading the thread v(t), a(t), and the emotional charge of the thread (h). Instead of fitting the solution of the equations of emotion dynamics of equation (2.1) to the data, we used a regression model to estimate the changes in the variables as a combination of a linear and a stochastic component. This has the advantage that we do not need an explicit solution of equations (2.1), allowing us to test nonlinear relationships like the ones shown in equation (2.2).
Our experimental design defines three cases of h, corresponding to the fields generated by positive (h = +1), negative (h = −1) and neutral (h = 0) threads. We reformulate the continuous dynamics of equations (2.1) and (2.2) as discrete changes due to a combination of a relaxation force and a stimulus-dependent influence for valence and the dynamics of arousal as dependent on the absolute value of h First, to test the relevance of each term of the equations and avoid overfitting, we search for the best parameter subset through a maximum-likelihood procedure [55] that minimizes the Akaike information criterion [56]. Second, we fit the most informative parameter subset of equations (3.1) and (3.2) through the nonlinear least-squares method [57] (more details in the electronic supplementary material). Third, we compute an empirical estimatorp for each relevant parameter, finding the posterior distribution ofp in a Bayesian model with normally distributed priors [58] and 10 000 simulated samples.

Sentiment analysis
To test how emotions are encoded in text through function f s , we apply two sentiment analysis tools to the 182 posts produced in Study 3. First, we apply SentiStrength [59] a state-of-the-art sentiment tool that quantifies positive and negative content independently. SentiStrength is among the best performing sentiment analysis tools in benchmark tests of social media posts and comments [60], and has been used to study blog posts [13], chatroom messages [21], YouTube comments [17] and microblog posts [22]. SentiStrength provides two scales of positive, from 1 to 5, and negative sentiment, from −1 to −5. We classify a post as positive if its positive score is 3 or higher, and negative if its negative score is −3 or lower, following the methods of previous research [17,22,59].
The second tool we apply is qdap (quantitative discourse analysis package) [61], using the opinion mining lexicon [62]. qdap matches words against the lexicon and estimates a range of polarity between −1 and 1 for each sentence in the post. We classify a post as negative if the minimum value of polarity among the sentences in the post is below −0.25, and positive if the maximum value among sentences is above 0.25. Note that, in line with SentiStrength, this method can detect simultaneous positive and negative content in a post.

Eigendynamics and perception dynamics
In Studies 1 and 2, the order of the threads read by the participants was randomly determined, keeping the post ordering inside the thread but randomizing when each thread is presented. Participants were asked to provide their emotional reports between threads in order to obtain as accurate measures as possible without interfering with the task [63]. This sequence of tasks allows us to reconstruct the changes induced in valence and arousal after reading threads with different emotional content, in order to know how online discussions expressed in the stimuli influence the emotional state of a user. These influences compose the perception dynamics of online emotional interaction, and coexist with eigendynamics that are independent of the perceived content.
We formulate regression models (explained in the Material and methods section) to test the dynamics expressed in equations (2.1) and (2.2). Using a maximum-likelihood criterion, we find the most informative parameter subsets that explain the empirical changes in emotions, and compute the posterior distribution of each parameter in a Bayesian model with normally distributed priors [58].

Valence dynamics
For the case of v(t), the maximum-likelihood procedure detects that the equation of valence has significant terms up to the third order, with the exception of b 1 , which can be considered as 0 (details in the electronic supplementary material). The results of the nonlinear regression are shown in table 1. The eigendynamics captured by γ v and b describes a fast relaxation process towards a small valence baseline (0.056), in which valence decreases by more than 30% per minute. This can be observed in the valence change function for neutral threads in figure 2a, which takes the form of a negative slope that crosses the horizontal axis close to v = 0.
The strongest effect of h in the valence is through b 0 , which shifts the valence by a constant factor of 0.14 on the direction of the emotional charge of the thread. The nonlinear terms b 2 and b 3 are significant but small in magnitude, showing corrections only close to the limits of strong positive and negative valence.
The posterior distribution of each parameter estimate is shown figure 2b, showing the location and uncertainty of each parameter estimate given the empirical data. These results lend strong evidence for our hypotheses drawn from the Cyberemotions modelling framework. All parameters can be considered different from 0, and their effect sizes reveal the existence of relaxation eigendynamics and a linear influence of h with nonlinear corrections. To further test the robustness of this result, we evaluated the interaction of the experimental set-up in our statistical analysis (see the electronic supplementary material). We find no significant effect in any estimator with the exception of γ v , which differed on a total of 0.06 across experiments, less than 20% of its point estimate. In addition, the regression results suggest an important level of predictability of the valence, with an R 2 value above 0.5. The assumption that error terms are normally distributed is not far from reality, as a normal fit to the residuals through the method of moments gives R 2 (ξ v ) = 0.85 and a Shapiro-Wilk statistic of 0.8762.   Table 1. Parameter estimations of equation (3.1), R 2 value of nonlinear least-squares, and R 2 (ξ v ) of a normal fit to the residuals of the regression. * p < 0.01, * * p < 0.001, * * * p < 10 −10 .
parameter    This suggests the existence of additional terms beyond those included in equation (2.2). We tested if we should include a linear dependence on h in addition to its absolute value on an extended model. We found negligible linear effects of h (more details in the electronic supplementary material), supporting the assumption that arousal depends on h but not on its sign. Furthermore, we tested the effect of the experimental set-up as we did with the valence dynamics, finding that all parameters remain significant when controlling for the experimental conditions. The control parameters for the experimental set-up were not significant for any parameter but d 0 , which showed an attenuated effect in Study 2, yet remained significant and sizable (more details in the electronic supplementary material).

Simulating perception and eigendynamics
One of the advantages of an agent-based computational approach is that it allows us to implement computational equivalents to compare empirical and simulation results. Not only can we provide a quantitative explanation for the observed data, but we can reproduce its behaviour in simulations, or even apply it in the field of affective computing [65]. We simulated emotional agents using the parameter estimations of tables 1 and 2, computing their changes in valence and arousal when exposed to values of h corresponding to the emotional charge of threads. Figure 3 shows an example of a simulation of the model versus the sequence of responses and emotional charges of threads for a participant of Study 2. This illustrates the dynamics of an individual, rather than analysing the average response as shown in the regression results of table 2. The simulated and empirical data are similar, in particular with respect to the sign of movements of valence and arousal after each thread type. This kind of computational model serves as a building block to estimate, predict and reproduce emotional dynamics under online interaction.

Expression dynamics 4.2.1. Production rules
In Studies 1 and 2, participants were asked about their intention to participate in a given discussion.
One of the assumptions of the Cyberemotions framework is that arousal is the driving force behind user participation in online discussions. This assumption is formulated in equation (2.3), as a threshold function depending on arousal. We test this assumption through a hypothesis of a linear relation between participation tendency and experienced arousal, which starts from a given point of arousal   We fit the above equation through the method of multivariate adaptive regression splines (MARS) [66], finding the best fitting values for p 0 , α and τ . Table 3 shows the result of the fit, and figure 4a shows the relation for both studies. The intention to participate is heavily influenced by arousal when it is above 0. Below that level, participants had a ground tendency close to 0.2, but for positive arousal the participation tendency grew with a significant trend above 0.4 (see the electronic supplementary material for more details). This pattern is similar in both studies, with growing participation for arousal above 0. The differences between experiments are not relevant in the parameter estimates as formulated in equation (4.1), and only some deviation could be found for very high arousals when introducing an additional breakpoint (see the electronic supplementary material). We also tested a possible relation of participation tendency with valence, finding a weaker relation with a small increase for very positive valence, as explained in the electronic supplementary material.

Expression function
The interactive set-up of Study 3 allows us to test the dependence between online expression through text and subjective emotions, formalized in equation (2.3). Our hypothesis is that the emotional content measured through text, s i , is a function f s (v i (t)) increasing with valence but not with arousal. We test this hypothesis by applying two state-of-the-art sentiment analysis techniques to the text produced by participants in Study 3, quantifying whether a text contains positive and/or negative content simultaneously (more details in Material and methods). This way, for each post p we count with two variables pos p and neg p that take the value 1 if the text contains positive and negative content respectively, and 0 otherwise. On the side of subjective reports of emotions, we count with the subjective valence and arousal reported after writing the post, v p and a p . We test the relation between the content of posts and the subjective experience of participants through logistic regression models [67], formulated as logit(P(pos)) = p 0 + α v * v and logit(P(pos)) = p 0 + α a * a for positive content and similarly for negative content. Figure 5 shows the result of the models for positive and negative content in the post as estimated with SentiStrength. We find a significant influence of valence on the probability that a post is positive and negative, as reported in detail in table 4. In addition, we do not find statistical evidence of the role of arousal, in line with our assumption of f s as a function of the valence only. These results are robust when using an alternative sentiment analysis technique (see the electronic supplementary material).

Feedback of expression
The experimental set-up of Study 3 focused on the production of posts, with subjective assessment of emotions before and after writing the post. In a similar way as we did for the changes after reading a  thread, we calculated the feedback of expression in the emotional state of an individual after writing a post. In the Cyberemotions framework, we hypothesized a reset to a = 0 after a user posted a message, as an implicit regulation mechanism after emotional expression ('auto regulation' [27,68]). The change in arousal depending on previous arousal for first posts and replies is shown in figure 4b. For both types of production, negative arousals tend to increase and positive arousals tend to decrease toward a neutral value. We validated this observation through a linear regression, and found no significant difference between writing a first post or a reply (see the electronic supplementary material). In addition, a similar effect was present in valence, but only for the case of replies. Negative valence experienced an increase after replying in a conversation, as explained more in detail in the electronic supplementary material.
The changes in arousal after participation do not show a reset to a value of zero after writing a post, which was the initial assumption in the Cyberemotions framework. On the contrary, humans seem to experience a decrease on their arousal that does not necessarily reset it to the neutral value, which still leaves room for further activity even in the absence of interaction. This difference in posting dynamics should be taken into account in future models within our framework, but the causality between participation and arousal is supported by these results. When an Internet user perceives emotional content, her arousal increases, leading to higher chances of participating in the discussion. This participation induces an instant decrease in arousal, which, in combination with the internal relaxation of the arousal, would decrease the probability of further participation. If other users create more emotional content (of any valence sign), the arousal of the agent would increase again, leading to the coupling of user behaviour that explains collective behaviour in online communities.

Discussion
The work presented here shows how online communication influences the emotions of an Internet user, and how these emotions change over time. Our work aimed at testing the assumptions of the Cyberemotions agent-based modelling framework. Analysing subjective assessments of emotions, we found strong support for the presence of an exponential relaxation towards a ground state. In terms of emotional content in online discussions, we found that valence changes according to the polarity of threads, and that threads with emotional content lead to higher arousal than threads with neutral content. The agents in our framework express their emotions when their arousal reaches a particular threshold. We verify this by inspecting the dependence between reported arousal and the intention to participate in a conversation, which reveals that such participation tendency increases linearly when the arousal is beyond a threshold value. Another assumption of our modelling framework was the effect of writing a post on arousal, which we hypothesized as an instant decrease of arousal. Our empirical results indicate the existence of a decrease after replying to posts in an online discussion, when participants were in high arousal states before interaction.
In general, our results are consistent across experimental conditions in Studies 1 and 2, but some discrepancies are present for arousal. For example, it is likely that the unfamiliar laboratory situation in Study 2 as such may have elevated the average arousal level of participants. This would be consistent with notions of prior psychological research on the possibility of misattribution and transfer of arousal from another source of activation which may occur under certain conditions [69,70]. In Study 2, participants were more likely to feel more observed as well as more engaged in the task than in Study 1, which they completed at home. Intentional regulation attempts may have been facilitated by the more public social context of Study 2, as well as high levels of excitation in response to some of the threads [27]. The present research required very brief measures to avoid subject fatigue and dissipation of the emotional impact of having read the short threads, which limited the number of items that could be posed repeatedly. Compared with single-item Likert-scales, a two-dimensional single-item measure such as the Affect Grid [71] could have been even briefer, once sufficiently explained. However, this type of measure still faces conceptual issues [72], and specifically the good validity of the Affect Grid reported by the original authors [71] has been found to be only moderate by subsequent research [73].
In psychology, there is increasing awareness of the social nature of emotional-contagion processes [74], as well as a clear interest in the psychological consequences of the social sharing of emotions [75,76]. However, large-scale research on emotions in cyberspace is still a very recent development [10], and our work is the first one to show an integration of modelling with research in the laboratory. At the same time, there is an increasing sensitivity within the psychology about the use of data from large social networks such as Facebook, concerning established principles of informed consent and the opportunity to opt out of participation in any kind of experiment. For example, a recent article [26] has led to a statement of editorial concern regarding these aspects of personal privacy, and the young field of large-scale analysis of online emotions is likely to be faced with continued questions in this regard. By contrast, in this paper we have taken a different route to test assumptions of large-scale modelling of collective emotions by means of taking some of the central processes into the laboratory. As a result we have revealed much stronger and salient effects than the previously reported linguistic cues [26], showing that emotional interaction online goes well beyond subtle contagion processes.
From a psychological perspective, our findings are generally consistent with the assumptions of the Cyberemotions framework. The relation between participation and arousal above a threshold is of particular importance. This links our present results to some classic findings in experimental psychology, in particular with respect to the role of excitation on subsequent emotional behaviour [69,70,77,78]. Thus, while the concept of a carry-over of arousal is not new to psychology, computational modelling of these types of behaviours promise a more direct means of testing the precise dynamics involved in these processes. In addition, a computational model supports the transfer and application of our findings to large-scale phenomena on the Internet involving collective emotions. For example, at present, our data suggest that interventions aimed at a change of arousal might be a promising approach to the calming of the nerves in a heated online discussion, in comparison with valence-based interventions that primarily aim at the polarity of an ongoing discussion. Enhancing user interaction to create collective emotions is also relevant for the design of automatic dialogue systems [65] and virtual human platforms [79].
The dynamics of emotional states during online interaction show that arousal is driven towards negative values for non-emotional threads, which we did not take into account in the initial models of our framework. In addition, we found that replying to a post creates a valence increase for users that have a negative valence before interaction, as a beneficial result of the participation in an online discussion. Furthermore, our assumption of the decrease in arousal after expression is hereby extended, as we find that such a decrease does not reset the arousal to 0, but lowers it by some proportional amount. Further experiments shall focus on how simultaneous positive and negative emotional content influences the emotions of the readers of a thread. Further work should study how subjective emotions are encoded in expressions, which is included in our model through the function f s (v i ). Testing the way emotions are encoded in a text heavily depends on the sentiment analysis tool used to process the posts, for which particular experimental designs are necessary. While some of these hypotheses still remain untested, the