The individual dynamics of affective expression on social media

Understanding the temporal dynamics of affect is crucial for our understanding human emotions in general. In this study, we empirically test a computational model of affective dynamics by analyzing a large-scale dataset of Facebook status updates using text analysis techniques. Our analyses support the central assumptions of our model: After stimulation, affective states, quantified as valence and arousal, exponentially return to an individual-specific baseline. On average, this baseline is at a slightly positive valence value and at a moderate arousal point below the midpoint. Furthermore, affective expression, in this case posting a status update on Facebook, immediately pushes arousal and valence towards the baseline by a proportional value. These results are robust to the choice of the text analysis technique and illustrate the fast timescale of affective dynamics through social media text. These outcomes are of high relevance for affective computing, the detection and modeling of collective emotions, the refinement of psychological research methodology, and the detection of abnormal, and potentially pathological, individual affect dynamics.


Introduction
Emotions have profound influence on human cognition and behavior across many domains [1]: They bias memory, perception, and decision making [2] and provide feedback for past and guidance for current behavior [3]. Some of the most prevalent mental disorders, such as depression and anxiety disorder, are characterized by abnormal emotional states [4][5][6]. Moreover, emotions have a social function. Experiencing emotions induces a tendency to share them with others, causing them to experience these emotions too [7], thus giving rise to collective emotions with often profound impact on society at large [8,9].
While the influence of emotions on cognition and behavior is well established, most studies leave aside one crucial aspect: the temporal dynamics of emotional states. It is commonly assumed that emotions relax over time if they are not re-stimulated [10][11][12]. But at which rate do emotional states relax? Knowing this would tell us for how long after an emotion-inducing event the cognitive and behavioral impact of emotions can be expected to last. For example, is it enough to follow Jefferson's advice and count to ten or a hundred, in order to avoid the negative effects of anger? A second question concerns the baseline to which emotions return after an emotion-inducing event: Do we return to a state of completely neutral emotions or are there individual baselines shifted away from the middle point? Furthermore, expressing emotions can have an effect on affective dynamics: If we ignore Jefferson's advice and speak our minds while we are still angry, will this expressive act relax our emotional state-and if so, by how much?
In this study, we want to tackle these questions by (i) formulating a mathematical model of affective dynamics, and (ii) testing this model by analyzing the digital traces of spontaneous affective expression, in the form of a large-scale dataset of Facebook status updates.
This approach of testing psychological hypotheses with online data is still new, but has already proven its worth [13]. For example, it has been shown that the experience of excited emotional states leads to information sharing in social media [14], and in turn, that online emotional expression can drive emotional contagion [15], can regulate emotions through labelling [16], and can affect happiness through social comparison [17] and popularity through social regulation of emotions [18]. Other studies have shown how mood oscillates over seasons [19] and how air pollution is linked to expressed well-being [20]. Based on online data, it also possible to detect strong collective emotions, as they appeared in France following the terrorist attacks of Paris in November 2015, and to show how they can contribute to the rise of solidarity and to social resilience [21].
Analyzing online data helps us to avoid some of the limitations of more traditional methods to quantify emotional states. While self-reports of momentary emotional states can show their dynamics when gathered through hand-held devices [10], this method requires participants to assess their emotions several times a day, interrupting their daily routine and affecting their attention. The high demand on study participants limits sample sizes and the applicability of this method. Other research has used controlled experiments to elicit emotional reactions and track their evolution over time [12]. While this has the advantage of highlighting the dynamics of emotions in contrast to external sources of noise, it suffers a series of limitations to external validity. Artificial exposure to stimuli in experiments can greatly differ from the properties of natural exposure in real-world situations [22]. Laboratory research can also suffer other limitations, such as experimenter effects that distort the dynamics of emotions [23].
The large amounts of data produced by social media users offer a way to complement previous research on emotion dynamics. But using social media data in affective science also has limitations. The output of common sentiment analysis methods on social media posts over long periods of time has low correlation with the result of questionnaires on persistent mood states [24]. At faster timescales, however, sentiment analysis of social media text correlates with individual self-reports of momentary affective states [12]. Thus, the analysis of online data can, despite its limitations, complement more traditional psychological methods in important ways.
Quantifying emotion dynamics has potential further research applications that motivate our work. Through a social-interactionist approach [25], a better understanding of individual affective dynamics can also help us to explain the emergence of collective emotions. Collective emotions are hypothesized to sustain themselves for longer periods than purely individual emotional reactions [9]. Thus, having a better estimate of the average time scale of individual emotions can help us to identify collective emotions empirically. And finally, knowledge about typical affective dynamics in the general population can also help us to detect abnormal dynamics, which have been linked to mental disorders like depression [6,26].

Modeling affective dynamics
The individual dynamics of affect capture the changes in emotional states over time independent of social interaction or other external stimuli. In 2010, two research teams independently formulated models of individual dynamics of affect: The Cyberemotions framework [11] and the DynAffect model [10]. Both groups focused on the core affect dimensions of valence (pleasant vs. unpleasant) and arousal (excited vs. calm) [27]. Also, both groups assumed that affect (both valence and arousal) relax exponentially towards a baseline. The Cyberemotions framework aims at modeling the emergence of collective emotions in online communities, leaving details about online interaction to be defined by each model in the framework [11]. To this end, this framework also includes the antecedents and effects of emotional expression into affective dynamics. In particular, the Cyberemotions framework assumes that expressing emotions would have a regulating feedback effect on the emotional state-a claim backed by psychological research [28].
Some assumptions of the Cyberemotions framework have been tested empirically in experiments involving reading as well as writing emotional online posts [12]. Affect was quantified using self-ratings and sentiment detection on the participants' messages. The DynAffect model was tested in two experiments using repeated experience sampling of a student cohort in everyday life circumstances [10]. While evidence largely validates the dynamics of Dynaffect, studies produced puzzling outcomes with regard to the strength of exponential relaxation of affect: The estimates for the affective relaxation parameters were much larger in the first than in the second experiment. This was unexpected, because the only major difference between the two experiments was that the rate of experience sampling, i.e. how often participants had to rate their current valence and arousal, was more frequent in the first experiment. However, if we see these ratings as a form of affective expression, the regulation feedback effect postulated by the Cyberemotions model can explain why more frequent expressions lead to seemingly faster affective relaxation.
Thus, for our current study, we combine the assumption of exponential relaxation from both models with DynAffect's postulate of individual affective baselines [10] and the regulation effect of affective expression from the Cyberemotions model [11,12].
We formalize these assumptions following the formalism of the Cyberemotions framework [11,12]. We quantify the emotional state of an individual at time t through its valence v(t) and arousal a(t). The dynamics of valence and arousal only differ in their parameter values, not in their mathematical form, and thus we denote x(t) as either valence or arousal in the general equations.
Our individual emotions model consists of two parts. First, the effect of expression, by which the action of posting a status update induces an instant emotion down-regulation by a constant factor k: In the above equation, individual i started to write a status update at time t before , expressing an emotional state x i (t before ), quantified as valence or arousal. The emotional state of the individual when posting the status update is x i (t after ). For simplicity, we assume that the timescale of writing is faster than the timescale between posting status updates, and thus we model the effect of writing in x i as an instantaneous change. The baseline of x for the individual is μ i , denoting the ground state in which the emotions of the individual would tend to be stable over time in the absence of stimuli. This individual baseline can be measured through the average of several emotional states (valence and arousal) measured for the same individual over long periods of time. We use this approach as we later explain in Sect. 3.3. After the expression of the emotion, the state of the individual instantly changes to a value adjusted by the distance to the baseline multiplied by a constant factor k. This equation models a stable regulation towards the baseline when 0 < k < 1, which has been previously observed in experiments [12]. In our empirical analyses, we test the hypotheses that k is larger than zero and lower than 1, i.e. that there is an effect of expression that attenuates emotions towards a fixed individual baseline. The second component of emotion dynamics in our model is the internal relaxation of emotional states. Following the modeling framework [11] and empirical observations [10], we model the internal relaxation of emotions as a mean-reverting process towards the baseline: In the above equation, the change in emotional state per time unit is proportional to the difference of that emotional state to the individual baseline μ i . The noise term ξ (t) captures external forces that change emotions and that we are not modelling in this case. The coefficient γ quantifies that proportional relaxation towards the baseline. When 0 < γ < 1, the value of x i (t) approaches the baseline μ i over time. This kind of exponential relaxation has been observed in previous empirical research [10,12], serving as the starting point of our individual dynamics model. In this case, when the value of x i (t) is below the baseline, the value of x i (t) increases over time, approaching the baseline from below. Our empirical analysis aims to test the hypotheses that γ is below 1 and above zero, estimating the best-fitting value of γ .
Equation (2) is an example of an Ornstein-Uhlenbeck process [29]. We can formulate the expected value of x i after a fixed t time: We combine this solution with the effect of expression of Equation (1) to formulate the statistical model explained in Sect. 3.3.

Text analysis of affective expression
We study emotions as core affect [30], i.e. short-lived psychological states of high relevance to the individual that do not need to have a particular target. States in core affect are measured in terms of valence and arousal. Valence quantifies the degree of pleasure associated with an emotion and arousal the activation induced by that emotion. For example, the word "joy" manifests a positive valence, high arousal state, while the word "sadness" is used to express a negative valence, low arousal state. Further words can be annotated in this valence and arousal space, a method popularized by the ANEW lexicon [31] that builds on the semantic differential method [32]. Note that this approach assumes that affect can be measured from its expression through human communication. While a substantial level of noise can be expected when using these text analysis methods to quantify emotions, the use of large-scale data from social media and other digital resources allows the analysis of individual and collective emotions through temporal and structural patterns [16,19,21,33,34]. We quantify valence and arousal expressed in each status update through unsupervised methods that compute mean scores over stemmed terms in a text [35]. To verify that our results are not an artifact of a particular lexicon, we employ two lexica generated with different annotation schemes: the Affective Norms (WKB: Warriner-Kuperman-Brysbaert) lexicon [36], which includes 13,915 lemmas covering the most frequent terms from a subtitles corpus, and the NRC (National Research Council Canada) Valence, Arousal, and Dominance (NRC-VAD) lexicon [37], which includes more than 20,000 terms selected from various sources. We refer to these text analysis methods to quantify valence and arousal as the WKB method and the NRC-VAD method respectively. In the main text we present results using the WKB method and report results using the NRC-VAD method as an alternative in the Supplementary materials.
While other methods besides WKB and NRC-VAD have been developed to measure sentiment or affect from social media text, the lexica of these two methods are the most comprehensive, cover the widest ranges of emotional terms, and their fundamental principle has been validated in benchmark studies [38,39]. The flexibility of these unsupervised methods to quantify affective expression allows the generalization of our analyses beyond Facebook. This would not be possible if we apply supervised methods trained only for Facebook as a particular domain [40]. Other unsupervised methods have achieved high levels of accuracy for sentiment annotation tasks in terms of sentiment classes (positive, negative, neutral) [38]. Among the best is VADER [41], a tool that returns a numeric score of sentiment that has been trained and validated against categorical data. While this tool has been shown useful to characterize ensemble average valence in Twitter [16], we cannot use it to track individual-level valence values due to the trimodal distribution of VADER scores (see Fig. 9 in Supplementary materials).

Facebook status updates dataset
We analyze a dataset of Facebook status updates generated by the MyPersonality project [42]. This dataset contains more than 22 Million status updates that were voluntarily provided for academic research by 153,727 Facebook users between 2009 and 2011. Through the MyPersonality consortium, we accessed an anonymized timestamped dataset of status updates without any personally identifiable information. This dataset and subsets of it have been used in previous research on computational personality recognition [43], preference in music [44] and sentiment of religious affiliation [45]. We filter observations from the raw dataset according to the following guideline: First, we discard pairs of subsequent status updates that cannot get assigned at least one term from our sentiment lexicon each. Additionally, we remove low activity users that updated their status less than 20 times over the whole observation period. After data-preprocessing, we are left with 16.9 Million status updates by 114,967 users. Users included in this dataset self-selected by deciding to use the MyPersonality Facebook application. This might imply that their demographics and personalities differ from the general population [46], in line with general limitations for the use of social media data in the social sciences [47]. However, it is worth noting that this user sample is more diverse than the typical participant sample of psychological research, often composed of students of high socio-economic status [48]. The Facebook status updates of the dataset resemble diary-like records in which individuals write about moments in their life. This can be observed on the word cloud of the left panel of Fig. 1, which displays words typical found in a diary (day, good, have, be, love, want, time). The dataset does not include replies or comments into wider conversations. It only contains status updates that users wrote by their own initiative. Users chose to share their full time lines of status updates for research. While these status updates are still performative acts in front of the social environment of the user, they compose spontaneous communication in a medium used to talk about one's life. In contrast to other media like Reddit, Facebook status updates lack a particular fixed topic or context beyond what the individual user chooses to talk about. With an average of 143 status updates per user, this dataset composes a longitudinal and comprehensive record of social media text.
All data was voluntarily donated by the users of MyPersonality. Therefore, bot and spam accounts in this study are not an issue as in other social media like Twitter. Nevertheless, Twitter has the benefit of a widespread access for researchers and of very high data volumes, which enabled previous analyses of emotion dynamics [16]. The down side of this ease of access is the Twitter model organism problem [49], which calls for studies in other social media in order to generalize to human behavior [50].

Statistical model
We now derive a statistical model based on the principles expounded in the Modeling affective dynamics section above and that can be fitted with the output of text analysis of the Facebook status updates dataset. As a previous step to statistical analysis, we calculate the individual baselines of valence and arousal as the mean over the analyzed status updates of each individual. Then we subtract this baseline from the sequence of emotional expressions of a user. Thereby, we simplify the model such that relaxation happens towards zero, removing persistent inter-individual differences of affective baselines. For each sequential pair of status updates of user i between time t and t + t, we fit the following equations of the value of valence V i,t+ t and arousal A i,t+ t expressed in the second status update: where k v and k a quantify the regulation effect of online expression, γ v and γ a quantify the relaxation speed, and v and a are regression residuals assumed to be normally distributed and uncorrelated. We fit the above model with the nls function of the stats package for the R statistical language [51]. We fit the model with weights for each sample proportional to the logarithm of t + 1 in order to focus on the fast timescale of valence and arousal. An alternative to this decision is to use an empirical method to find a time cutoff [16]. However, to include all data in our analysis, we choose a weighted regression scheme instead of finding a cutoff timescale. We compute 95% confidence intervals and p-values with the coeftest function of the lmtest package for R and run a series of regression diagnostics to validate the assumptions of our statistical model.
Note that contrary to previous research [16], we fit the emotional expression at the individual status update level rather than the binned mean value versus time. This has the advantage that our estimates can be used to calibrate models of individual emotions and give precise estimates of the parameters of emotion dynamics.

Results
The 2d-histogram of individual baselines of valence and arousal is shown on the in the left panel of Fig. 1. The baselines of arousal are generally located below its midpoint, with a mean value of 4.13. With very few exceptions, the baselines of valence are concentrated around a value above the midpoint, with a mean of 5.88. These two values are very close to empirical observations in self-reports [10]. Positive valence baselines are also consistent with the Pollyanna principle [52], which has been observed previously in other kinds of online expression [53,54] and general text [36,55]. Further descriptive figures can be found in the Supplementary materials, including examples of individual trajectories of expressed valence and arousal.

Affective memory
Expressed emotions relax towards the baseline, but this does not happen instantly. Figure 2 shows the mean changes in expressed valence and arousal as a function of the valence and arousal of the previous status updates at three timescales. The first status update belongs to one bin of the 9 × 9 affective grid and the mean value of its subsequent status update is directed towards the baseline. Status updates written within short timespans (with a maximum t of 5 minutes) do not completely reach the baseline value. At longer time scales ( t up to 2 years) the expected value of valence and arousal of the second status update is clearly at the baseline, as shown on the right panel of Fig. 2. These patterns illustrate the existence of both an attractive force and an affective memory in which the  Shaded areas are 95% bootstrap confidence intervals. There is strong correlation between two subsequent status updates at a very fast time scale. If time between status updates increases, both correlation coefficients decrease and quickly become non-significant emotions expressed in two consecutive states are related as long as the time in between is short.
In the following, we present the general patterns of emotion dynamics up to 300 seconds, but our statistical analysis includes all time intervals between subsequent posts of the same user. We present figures with patterns up to 300 minutes in the Supplementary materials.
We quantitatively assess the existence of affective memory through the autocorrelation function of valence and arousal in consecutive status updates of the same individual. Figure 3 shows Pearson's correlation coefficient as a function of time between status updates for arousal and valence, with 95% bootstrap confidence intervals computed over 10,000 samples. For short timescales the correlation coefficients are significant, reaching values above 0.4. The value decreases for longer time intervals, reaching for the first time nonsignificant values after 141 seconds for valence and after 129 seconds for arousal. This shows that there is a robust affective memory at short time scales. However, when we consider status updates separated by few minutes, the correlation between expressed valence and arousal is indistinguishable from zero. These results are the same using an alternative text analysis method, as shown on Fig. 1 of the Supplementary materials.

Affect dynamics model fits
When starting from a given value of valence and arousal, the expected value of the emotions expressed in the next status updates is shown on Fig. 4 as a function of time between status updates. The process is mean-reverting: When starting from a negative value (note that we have subtracted individual baselines), the expected value approaches zero from below. When starting from a positive value, this approach happens from above. The expected value becomes indistinguishable from zero at longer timescales, as shown in Figure 3 of the Supplementary materials.
We validate the above observations by fitting the statistical model introduced in Sect. 3.3. The coefficient estimates of the fits for valence and arousal are shown in Table 1. The relaxation coefficient for arousal (γ a = 0.0105 s -1 , CI = [0.0101, 0.0108]) is stronger than for valence (γ v = 0.0070 s -1 , CI = [0.0068, 0.0072]). This observation is consistent with previous results of experiments [12] and in-vivo self-reports [10]. Users that write status updates with high arousal content are less likely to have comparable high arousal in the next status update if more than a few minutes pass in between them. Note that these rescaled measures have to be interpreted as deviations from the affective baseline of each user. The feedback effect of expression is captured by the estimates of k v and k a , taking values of 0.38 and 0.45 respectively. This indicates that a large fraction of the initial emotional state is regulated by expression, with roughly 40% of valence and arousal remaining. Our initial hypotheses of γ and k between zero and one for both valence and arousal are supported by these results, indicating the presence of stable emotional relaxation towards the individual baselines and a regulation effect of affective expression.
An illustration of the fast relaxation towards the baseline that is captured by the model can be observed in Fig. 5. Starting values of high valence or arousal instantly regulate by a proportional factor and then exponentially approach zero from above. The converse is also observable for arousal and valence values below zero, which first regulate towards zero and then approach it exponentially from below (also observable on Fig. 4).
Heteroscedasticity and Autocorrelation Consistent estimates for the models yield coefficient estimates very close to the ones reported in Table 1 and remain significant. These results are very similar when using the alternative sentiment analysis method, as reported  The memory patterns of our model, while consistent with previous research, could also be explained by collective and cultural synchronization processes that influence emotional expression. For example, seasonal greetings such as "happy New Year" or "merry Christmas" could introduce artifacts in our measurement as manifestations of collective mood [34]. We account for these effects in our analyses, we repeated the model fits including additional inter-individual weekly baselines for valence and arousal. Results are very similar with this seasonal corrections, as presented more in detail in the section "seasonal correction" in the Supplementary materials.

Conclusions
Our analysis of the temporal dynamics of affective expression on Facebook validates our model of affective dynamics. We confirmed the existence of individual affective baselines, which are concentrated around a slightly positive valence and moderate arousal point. Furthermore, using a nonlinear regression model, we validated the assumption that valence and arousal exponentially relax towards the individual baseline. This can be seen as a short-term memory of emotional expression: Valence and arousal of two consecutive status updates of the same individual are highly correlated up to few minutes, but become uncorrelated for longer time spans. We find considerable regulation effect exists for both valence and arousal-meaning affective expressions instantly reduce the magnitude of affective states by a proportional factor. Our results are consistent with previous observational analyses of emotion labelling in Twitter [16]. When compared to our work, the analysis of [16] focused on the relaxation of emotions after an explicit labelling report, a phenomenon that operates at a longer timescale than our analysis of spontaneous relaxation of valence and arousal. This illustrates that various aspects and timescales of affective life can be analyzed through social media data, capturing both the relaxation trends of core affect and of mood and other more persistent phenomena.
While our analysis has revealed fundamental properties of emotion dynamics, it is important to highlight its limitations. Our model is not a predictive tool that can provide accurate estimates of sentiment in the future, especially when looking at long timescales. However, the large-scale dataset we analyzed allowed us to make robust inferences that point to emotion dynamics in general. Future studies can include additional external data (e.g. social interaction, time of the day, demographic attributes) to generate predictive tools beyond our work. In addition, social media activity has a performative nature and data is generated with self-selection biases that can affect the results of text analysis. Nonetheless, our analyses allow us to overcome some limitations of traditional methods, tracking emotions over long timespans in a large sample of users more diverse that the typical sample of a psychology study. Furthermore, our results agree with previous results and are consistent across the two sentiment analysis methods we applied. All methods in psychology have limitations, only by comparing their results in various scenarios we can converge to a unified understanding of human behavior.
The evidence gathered by our analysis contributes to an emerging research line of computational modelling of emotions [9,11]. Computational models, in particular agentbased models, formalize the dynamics of individual properties and the interaction and communication between individuals to explain collective and complex behavior. For these models to go beyond theoretical arguments, it is necessary to empirically test their assumptions and to calibrate their parameter values with empirical data. Our work has validated a series of assumptions of these models [12] and we have calculated precise values for the parameters of individual emotion dynamics as manifested through social media.
Such quantitative models of affective dynamics can also contribute to the understanding and treatment of affective disorders. While complex psychological dynamics measured with questionnaires bring limited information to assess well-being [56], a data-richer scenario (like social media research) might provide enough accuracy to reveal the role of complex affective dynamics. Other than to psychopathology, empirically calibrated emotion dynamics models can also be applied to simulate emotional reactions in affective comput-ing technologies [57]. For example, facial expressions of virtual humans can be simulated with our model [58], and dialog systems can provide plausible emotion dynamics with the appropriate parameters [59].
Furthermore, our findings have some implications for the methodology of affective psychology. In particular, our model can help researchers to (i) estimate the actual affective impact of a given stimulus, based on its dynamic relaxation, (ii) determine the necessary length of measurement intervals and breaks between stimuli, in order to avoid carry-over effects of emotions, and (iii) beware of and control for the regulation feedback effect of affective expression, which might also occur after self-ratings.
The parameters of our models are very similar to the ones found in experiments of online interaction [12]. Despite using a very different design (observation vs experiment), methodology (text analysis vs self-rating) and sample composition (student sample vs Facebook users), we obtain very similar estimates for the affective baselines and relaxation parameters. This constitutes a strong validation of our model of affective dynamics-much more so than a simple replication of previous studies. Beyond that, our methods have additional advantages when compared to traditional methods: They include larger and more representative participant samples, behavior can be measured for longer time periods, and the cost of data gathering and reuse is substantially lower. This shows how psychological research can be advanced through data science, especially through the analysis of largescale data sets of online behavioral traces.