## Introduction

The experience of sadness is functional as it highlights a discrepancy between one’s actual state and one’s desired state1. Cognitive responses to sadness, however, do not always support well-being. Repetitive negative thinking (RNT) entails perseverative thinking about one’s problems or emotions and is a maladaptive response to sadness2,3,4 and a transdiagnostic risk factor for psychopathology5,6,7,8,9,10,11. The impaired disengagement hypothesis12 proposes that enduring negative thoughts, especially those directed towards the self, signal a cognitive conflict that leads to the disengagement of attention from negative thoughts via attentional control. From this perspective, RNT results from impaired cognitive conflict signaling and/or difficulties in enacting attentional control to divert attention away from one’s negative thoughts. In line with this perspective, deficits in inhibiting previous mental states are associated with RNT13 and cognitive control ability moderates the extent to which RNT follows negative moods14.

Three large-scale functional brain networks are increasingly incorporated into the impaired disengagement hypothesis due to their roles in conflict signaling, self-referential thought, and attentional control12,15. The default mode network (DMN) is characterized by a tendency to deactivate during tasks and to activate at rest, as well as during self-referential tasks16,17. The fronto-parietal network (FPN) is comprised of regions that have established roles in attentional control and working memory18,19,20, response selection21, and response suppression22. Due to its role in top-down, executive functions, the FPN is viewed as essential for guiding flexible, goal-directed behavior. Connectivity among the FPN and DMN provides important information about the capacity for flexible behavior, such as attentional control, with greater strength of connectivity between the DMN and the FPN associated with poorer cognitive task performance23,24. The salience network (SN) has two primary functions (for reviews, see refs. 25,26). One function relates to salience detection and the second relates to the facilitation of access to cognitive control resources (e.g., attention, working memory) following the detection of salient stimuli. The access to cognitive control is facilitated by signaling the engagement of the FPN while suppressing DMN activity15,27.

Alterations in DMN functioning in depression (see refs. 28,29 for reviews) are theorized to reflect impairments in switching between internally and externally directed thought that lead to RNT tendencies. Less work has focused on the DMN’s role in RNT in relation to both the FPN and the SN (see ref. 30 for review). A notable exception observed that increasing dominance of DMN activity over FPN activity is associated with increasing levels of depressive rumination31. Furthermore, differences emerge in the timing of activity in the insula (regions of the SN) prior to increases in FPN activity (and decreases in DMN activity) in depressed individuals relative to healthy controls, indicating a role for the SN in coordinating DMN and FPN activity in RNT (see also ref. 32).

We examine RNT as it occurs in response to sadness during the course of daily life in 29 remitted depressed individuals and 29 matched healthy controls. The inclusion of remitted depressed individuals ensured adequate between-person variability in sad mood and RNT, given findings that levels of RNT and negative mood are elevated in remitted depression33. Based on the role of the SN in switching between DMN and FPN activity upon the identification of cognitive conflict, we hypothesize that greater connectivity among the SN and the FPN, and among the SN and the DMN is associated with reduced RNT tendencies. In addition, given evidence that increased connectivity among the FPN and the DMN is associated with reduced ability to deploy cognitive functions, we hypothesize that increased connectivity among the FPN and the DMN is associated with a greater propensity to respond to sadness with RNT. We also test the moderating role of SN flexibility on the association between sadness and RNT. The SN is a uniquely flexible system, exhibiting substantial time-varying functional interactions with other functional networks34,35 and greater SN flexibility is associated with greater cognitive flexibility34. Based on the association between SN flexibility and cognitive flexibility, we hypothesize that greater SN flexibility is associated with a reduced tendency to follow sadness with RNT.

## Materials and methods

We made use of data from a study designed to provide insight into cognitive and affective function in individuals with remitted major depressive disorder. Detailed information on the larger study is available in refs. 36,37,38,39. The datasets analyzed and code used during the current study are available from the corresponding author upon reasonable request. The study was approved by the local ethics committee of the University of Heidelberg and conformed to the Declaration of Helsinki.

### Participants

Participants were 29 remitted depressed individuals with ≥2 episodes of major depressive disorder and 29 age-, sex-, and education-matched healthy controls without current or lifetime diagnosis for major depressive disorder. Participants were recruited by announcements in local newspapers and on the homepage of the Central Institute of Mental Health (CIMH), Mannheim, Germany. The remitted depressed individuals had to be in partial or full remission for at least two months. Exclusion criteria for all participants included clinical diagnoses of bipolar and psychotic disorders, substance dependence, current substance abuse, generalized anxiety disorder, current obsessive-compulsive, post-traumatic stress, and eating disorders according to DSM-IV as well as contraindications for magnetic resonance imaging. Psychopathology-related criteria for inclusion were assessed by a trained clinical psychologist who used the Structured Clinical Interview for DSM-IV axis I40. Detailed information about the sample used for the analyses is presented in Supplementary Table 1. The study was approved by the local ethics committee of the University of Heidelberg. All participants gave informed consent in writing.

### Procedure

We show a schematic of the procedure in Fig. 1. Demographic and clinical variables were collected at a baseline session. Affective and cognitive state variables were then measured by ambulatory assessment41. Ambulatory assessment was completed over four consecutive weekdays with 10 assessments per day using smartphones (HTC Touch Diamond 2) and the software MyExperienceIDE by movisens GmbH (Karlsruhe, Germany). The beginning of each assessment was indicated by a beep, at which point the participants rated momentary mood and cognitive processes. The analyses in the present study focused on reports of sadness and RNT at 10 assessments on each of the four days (a potential total of 40 assessments per person) during which participants reported on their levels of sadness and also their RNT.

The fMRI session took place within the two week period following the baseline assessment and the ambulatory assessment. Each participant underwent a sad mood induction (4.5 min) and further tasks which are not subject to the following analyses. During the sad mood induction, three key words were presented to remind participants of personal negative life events. The key words were presented for 1.5 min each during the sad mood induction scan, were chosen by participants, and were related to three negative life events produced after participants were individually assessed immediately prior to the fMRI session. Participants were also presented with sad background music (Adagio in G minor by Albinoni) during the sad mood induction scan.

### Measures

We made use of demographic and depressive symptom data collected during the baseline session, fMRI data collected during the sad mood induction scan, and sadness and RNT data from the ambulatory assessment.

Sadness was assessed during the ambulatory assessment protocol with the item “At the moment I feel sad”, rated on a scale from 0 (not at all) to 6 (very much).

#### Momentary repetitive negative thinking

RNT42 was assessed during the ambulatory assessment protocol with the item “At the moment, I am stuck on negative thoughts and cannot disengage from them”, rated on a scale from 0 (“not at all”) to 7 (“very much”). This measure has been used previously in ambulatory assessment studies of rumination37,43.

#### Depressive symptoms

At baseline, depressive symptoms during the previous 2 weeks were assessed with the self-rated Beck Depression Inventory II-Revised (BDI II44; German version45) and the Montgomery and Asberg Depression Rating Scale (MADRS46; German version47) rated by a trained clinical psychologist, both of which have shown good reliability, validity, and sensitivity to symptom changes48. We created a composite score for depressive symptoms by averaging the z-standardized BDI-II and MADRS scores36,49.

#### Blood-oxygen-level-dependent (BOLD) functional connectivity networks

A summary of our analysis of the functional imaging data is as follows: BOLD time series from the sad mood induction phase were preprocessed and an association matrix representing the functional connectivity among regions of the brain was created before connectivity indices of cognitive control were created. Additional detail is provided below.

### Data acquisition

One-hundred and eighty T2* weighted EPI images (TR = 1.5 s, α = 80°, TE = 28 ms) with 24 slices (slice thickness 4 mm, voxel size 3 × 3 × 4 mm3, FOV 192 mm) were recorded with a 3 T TIM Trio Scanner with a 12 channel head coil (Siemens Medical Systems, Erlangen, Germany). To allow participants to adapt to the scanner environment and to reduce between-volume variance, the first 20 images of each measurement were discarded.

### Data preprocessing

We processed the fMRI data with a preprocessing scheme based on studies that evaluated the performance of a wide variety of preprocessing pipelines in mitigating motion artifact in studies of BOLD functional connectivity50,51. The functional data underwent de-spiking to smooth outliers in each voxel using AFNI’s52 3dDespike, rigid transformation to correct for head motion using FSL’s53 MCFLIRT, and slice-time correction using FSL Slicetimer to control for temporal differences in the order of the acquisition of the slices in each brain volume. Skull stripping was performed on the structural data using FSL BET. The mean functional image was computed and bias-corrected, and the skull-stripped functional image was bias-corrected. Advanced normalization tools (ANTs54) were used to compute the transformation parameters for the mean functional image to the high-resolution structural image. ANTs segmentation was performed to obtain a warped structural image, a skull-stripped brain mask, and masks for white matter and cerebrospinal fluid. Confound regression was then conducted. The time series was detrended by regressing the time series on the mean and the polynomial trends, up to quadratic terms. AFNI’s 3dbandpass was used to filter out very high or very low fluctuations in the signal (with a high pass of 0.01 and a low pass of 0.12). Six head motion regressors and three matter regressors (global signal, white matter, and cerebrospinal fluid), as well as their derivatives, quadratic terms, and the squares of their derivatives (36 regressors in total) were regressed from the time series. ANTs was used to warp the high-resolution structural image to the MNI template. The transformation parameters from the ANTs functional to structural co-registration and the transformation parameters from the ANTs structural to MNI co-registration were used to warp the 4D functional image to the MNI template. Finally, high variance compounds were removed55 using nilearn56.

### Creating an association matrix

We then created an association matrix representing the strength of functional connectivity between pairs of brain regions. We defined regions of the SN, FPN, and DMN on a commonly applied parcellation scheme57. Coordinates of each region can be found in the supporting information. For each region, we extracted a time series of the BOLD signal separately for each individual. All regions were modeled as 10 mm diameter spheres around the center coordinates. The extracted time series were the average time series for all voxels within the sphere. We calculated the wavelet coherence matrix, C, using the extracted time series. Each element of Cij represented the magnitude squared coherence of the scale two (0.0625–0.125 Hz) Daubechies wavelet (length 4) decomposition of the time series of region i and region j. We based our choice of frequency on previous work demonstrating sensitivity to neural processes58,59,60.

### Between-network connectivity

We labeled regions by their putative functional systems. We calculated between-network connectivity as the mean value of the association matrix elements representing functional connectivity between the three networks of interest. This procedure resulted in three between-system connectivity indices: DMN and SN connectivity, DMN and FPN connectivity, FPN and SN connectivity.

### SN flexibility

We next created a dynamic functional connectivity index that quantifies the extent to which nodes of the SN interact with nodes outside of its community (Fig. 2a–d). The time series for each brain region was divided into T = 15 sliding time windows, each 20 TRs (30 s) in duration, with 50% overlap. The choice of window length was consistent with the majority of dynamic functional connectivity work to date employing 30–60 s windows, with most studies using 20 data points per window61. Within each window, edges between all nodes were estimated via wavelet coherence. The result was a time-ordered set of functional connectivity matrices for each subject.

We transformed the time-varying functional connectivity matrices into an ordered set of adjacency matrices, and subsequently into a multilayer network62,63. In this multilayer network, the graph in one time window is linked to the graph in adjacent time windows via identity edges that connect a node in one time window to the same node in neighboring time windows. We implemented multilayer modularity maximization in MATLAB64 and applied the procedure to each subject’s functional connectivity matrices separately. The algorithm was applied with a default structural resolution parameter of 1 and an inter-layer strength parameter of 1. As the algorithm is non-deterministic, we performed the optimization 100 times for each subject. This procedure resulted in 100 n × m matrices for each participant, where n is the number of nodes (264) and m is the number of sliding windows (i.e., 15), indicating the community allegiance of each node during each sliding window. We used these matrices to create node flexibility indices. Node flexibility captures the number of times a node changes communities across time, normalized by the number of times the node could have changed communities58. Using the Network Community Toolbox (http://commdetect.weebly.com), node flexibility was calculated for each subject across each pipeline as the average flexibility value across the 100 iterations of the dynamic community detection procedure. SN flexibility was calculated as the average node flexibility over all nodes within the SN.

#### Participant motion

We calculated framewise displacement (FD) of the BOLD time series to provide an index of in-scanner motion during the sad mood induction65. We used mean FD for each participant as a covariate in analyses. We used the percent of volumes with excessive motion to test the robustness of the findings to the exclusion of participants with excessive motion (FD > 0.05; Supplementary Tables 2 and 3).

### Data analysis

We tested the association among sadness and RNT, as well as the moderating effect of between-system functional connectivity and SN flexibility during sad mood induction, using a multilevel model to accommodate the nested nature of the data (i.e., repeated measures nested within persons)66. The sadness variable was lagged by one time point to create previous time point (t-1) sadness scores. This process allowed us to capture the temporal precedence required to increase causal inference of the association between previous moment’s sadness on current moment’s RNT. The first measurement of each day was removed to ensure that the association between the previous moment’s sadness and the current moment’s RNT was approximately equally spaced. Measurement occasions with missing data for sadness and RNT were removed. Of 2030 possible total measurement assessments (58 participants * 35 occasions accounting for lagging sadness and removing the first measurement occasion of each day), 1995 (98.28%) were available. The average time (in minutes) between assessments once the morning assessment was removed was 79.17 min (SD = 19.42). Results were robust to the inclusion of time points of ambulatory assessment data available per participant as a covariate (Supplementary Table 4) and no significant correlations emerged between completion rates and key study variables (all p-values > 0.05).

We then separated the sadness variable into a within-person and between-person variable to allow for both within-person and between-person inferences related to the association between sadness and RNT67. A time-invariant, between-person sadness variable (SadnessBW) was calculated as the arithmetic mean across each individual’s, grand-mean centered repeated measures. A time-varying, moment-level sadness variable (SadnessWN) was calculated as deviations from the between-person means. RNT was regressed on both the within-person and the between-person sadness variable, time in the study, DMN-SN, FPN-SN, DMN-FPN connectivity terms, SN flexibility, motion, sex, and depressive symptoms. Interactions among the within-person sadness variable and the functional connectivity terms were also included.

More specifically, we constructed the first level of the multilevel model as follows:

Level 1:

$${\mathrm{Repetitive}}\,{\mathrm{Negative}}\,{\mathrm{Thinking}}_{it} = \beta_{0i} + \beta _{1i}{\mathrm{SadnessWN}}_{i,t - 1} + \beta _{2i}{\mathrm{Time}}_{it} + e_{it}$$
(1)

where Repetitive Negative Thinkingit is RNT for person i at time t, β0i indicates the average level of negative thinking for the prototypical individual in the sample, β1i indicates within-person differences in RNT at time t associated with sadness at time t − 1; β2i indicates the effect of time in the study on RNT; and eit are time-specific residuals that were allowed to display autocorrelation (AR1).

Person-specific intercepts and associations from the Level 1 model were specified at the second level of the multilevel model, which we constructed as follows:

Level 2:

$$\begin{array}{l}\beta _{0i} = \gamma _{00} + \gamma _{01}{\mathrm{DefaultModeNetwork}} - {\mathrm{SalienceNetwork}}_{i}\\ +\; \gamma _{02}{\mathrm{DefaultModeNetwork}} - {\mathrm{FrontoparietalNetwork}}_{i}\\ +\; \gamma _{03}{\mathrm{FrontoparietalNetwork}} - {\mathrm{SalienceNetwork}}_{i}\\ +\; \gamma _{04}{\mathrm{SalienceNetworkFlexibility}}_{i} + \gamma _{05}{\mathrm{Motion}}_{i}\\ +\; \gamma _{06}{\mathrm{SadnessBW}}_{i} + \gamma _{07}{\mathrm{Age}}_{i} + \gamma _{08}{\mathrm{Sex}}_{i} + \gamma _{09}{\mathrm{Depression}}_{i} + u_{0i}\\ \beta _{1i} = \gamma _{10} + \gamma_{11}{\mathrm{DefaultModeNetwork}} - {\mathrm{SalienceNetwork}}_{i}\\ +\; \gamma _{12}{\mathrm{DefaultModeNetwork}} - {\mathrm{FrontoparietalNetwork}}_{i}\\ +\; \gamma _{13}{\mathrm{FrontoparietalNetwork}} - {\mathrm{SalienceNetwork}}_{i} + \gamma _{14}{\mathrm{SalienceNetworkFlexibility}}_{i} + u_{1i}\\ \beta _{2i} = \gamma _{20} + u_{2i}\end{array}$$
(2)

where the γ variables are sample-level parameters and the u variables are residual between-person differences that may be correlated with one another but are uncorrelated with the variable eit. Parameters γ01 to γ09 indicate the effects of person-level DMN and SAL connectivity, DMN and FPN connectivity, FPN and SAL network connectivity, SAL flexibility, motion, usual sadness, age, sex, and depressive symptoms on RNT. Parameters γ11 to γ14 indicate how between-person differences in DMN and SAL connectivity, DMN and FPN connectivity, FPN and SAL connectivity, and SAL flexibility moderated the association between the previous moment’s sadness on the current moment’s RNT.

We fit the model using lme4 in R68 with incomplete data being treated based on an assumption of being missing at random. We followed up on significant interactions using the Johnson-Neyman technique69,70 and plot simple slopes based on +1/−1 standard deviation about the mean value of the moderator variable. Statistical significance was evaluated at an α = 0.05. Between-network connectivity of the DMN and the SN was not a significant moderator (see Supplementary Table 5) and was removed from the final model.

## Results

Table 1 provides descriptive statistics for the variables used in the analyses. Multilevel model results are presented in Table 2.

### FPN and SN connectivity moderates the association between sadness and RNT

We observe an interaction between FPN and SN connectivity and the association between sadness and RNT (γ = −11.15, p < 0.001). The regression of RNT on sadness is significant and positive for participants with relatively weak connectivity among these systems (Fig. 3b; β = 0.21 (0.05), p < 0.001). Participants with low levels of FPN and SN connectivity experience increases in RNT following moments of higher than usual sadness (Fig. 3c). In contrast, participants with higher levels of FPN and SN connectivity show no moment-to-moment association between RNT and sadness (β = 0.01 (0.05), p = 0.89).

### DMN and FPN connectivity moderates the association between sadness and RNT

We observe an interaction between DMN and FPN connectivity and the association between sadness and RNT (γ = 11.65, p = 0.002). The regression of RNT on sadness is positive for participants with relatively high levels of connectivity between these networks (Fig. 3e; β = 0.22 (0.02), p < 0.001). Participants with high levels of DMN and FPN connectivity experience increases in RNT following moments of higher than usual sadness. In contrast, participants with low levels of DMN and FPN connectivity show no changes in RNT following moments of higher than usual sadness (Fig. 3f; β = 0.01 (0.05), p = 0.83).

### SN flexibility moderates the association between sadness and RNT

We observe an interaction between SN flexibility and the association between sadness and RNT (γ = −10.10, p = 0.02). The regression of RNT on previous moment’s sadness is positive for participants with low values of SN flexibility (Fig. 2e; β = 0.21 (0.07), p = 0.004). Participants with low levels of SN flexibility experience increases in RNT following moments of higher than usual sadness (Fig. 2f). In contrast, participants with higher levels of SN flexibility show no moment-to-moment association between RNT and sadness (β = 0.04 (0.03), p = 0.90).

Additional analyses confirm that results are robust to (i) the removal of non-significant covariates (Supplementary Table 6), (ii) the inclusion of group status (remitted depressed versus healthy controls) rather than the continuous measure of depressive symptoms (Supplementary Table 7), (iii) the inclusion of previous moment’s RNT to account for any covariation between RNT and sadness at time t-1 (i.e., establishing causality in the sense of Granger; Supplementary Table 8), and (iv) including interactions with depression group indicating that results hold irrespective of group status, although we note that the sample may be underpowered to detect significant three-way interactions (Supplementary Table 9). In all cases, the moment-to-moment association between sadness and RNT is moderated by connectivity among the DMN and FPN, connectivity among SAL and FPN, and SAL flexibility in a manner consistent with the main analyses.

## Discussion

RNT is a maladaptive response to sadness. Characterizing between-person differences associated with RNT tendencies will facilitate attempts to promote more adaptive responses to sadness. Building on the impaired disengagement hypothesis12 and empirical support for the role of cognitive flexibility in moderating the tendency to engage in RNT14, we tested the moderating role of functional connectivity among brain networks associated with cognitive control15. We show that functional connectivity among the DMN, FPN, and SN during sad mood moderates the moment-to-moment association between sadness and RNT in daily life. Increased between-network connectivity of the DMN and the FPN, and decreased between-network connectivity of the SN and the FPN, are associated with increases in RNT following increases in sadness. We also observe that participants with flexible engagement of the SN show no tendency to increase RNT following increases in sadness. Between-network connectivity of the SN and DMN does not moderate the association between sadness and RNT. The findings are consistent with the impaired disengagement hypothesis and highlight potential roles for cognitive conflict signaling and attentional control in inhibiting RNT13,14. Individuals with greater ability to identify cognitive conflict and to engage executive functions may be better able to inhibit perseverative thinking and to divert attention away from their negative mood to a greater extent than individuals with impairments in these functions.

The pattern of findings for DMN and FPN connectivity, and for FPN and SN connectivity, is in line with previous work indicating that greater strength of connectivity between the DMN and FPN is associated with poorer cognitive control performance23 and that the SN plays a causal role in switching between FPN and DMN activity27. The specificity of the association for FPN and SN network connectivity and not DMN and SN connectivity, however, indicates more complex interactions among the three systems than is currently appreciated in the broader literature. Recent work provides insight into these complex interactions71. During an n-back working memory task, increased connectivity between the FPN and DMN was associated with poorer performance. Coupling both levels of activation and connectivity within a dynamical model designed to probe the association between system activity and connectivity, there was no evidence that activity of the DMN was associated with the functional coupling between the DMN and FPN. In contrast, modulating FPN amplitude impacted the strength of connectivity between DMN and FPN. These findings suggest that connectivity between the SAL and FPN may be particularly important for cognitive control, with changes in activity in the FPN in response to signals from the SAL leading to changes in connectivity between the FPN and DMN and, in turn, changes in cognitive control abilities.

A notable finding is that SN flexibility was protective against experiencing increases in RNT following increases in sadness. This finding provides further support for a putative role of cognitive flexibility in understanding maladaptive responses to depressed mood. SN flexibility captures the extent to which nodes of the SN interact with nodes in other communities. Nodes that change communities many times may moderate multiple processes and may be essential for dynamic and adaptive processes58. Indeed, flexibility of the SN is associated with cognitive flexibility34. We find that SN inflexibility is associated with increases in RNT following sadness above and beyond time-invariant (i.e., static) functional connectivity indices, in line with the increasing recognition of the time-varying nature of brain network organization72 and its importance for understanding human mood and cognition59,73,74,75,76,77.

### Limitations

It is important to consider the findings in light of the study’s strengths and limitations. Our measure of RNT captures perceived uncontrollability over negative thoughts. Worry and rumination are two forms of RNT that have received extensive treatment in the literature, with worry being more future-focused and rumination more past-focused78. Examining the content of RNT will allow insight into the specificity of our findings to worry and rumination, though it has been argued that common processes exist across different forms of RNT79,80. Connectivity among the DMN, FPN, and SN provides a general index of cognitive flexibility but specific cognitive functions were not examined. Working memory has emerged as a particularly important function for understanding RNT and an examination of its neural correlates in relation to RNT during the course of daily life will be an important avenue for future research. The extent to which patterns of functional connectivity during sad mood induction specifically drives the results will require further investigation, especially since emotional states modulate cognitive flexibility81, including in the context of remitted depression38.

## Conclusions

Functional connectivity among the DMN, the FPN, and the SN, as well as SN flexibility, during sad mood induction moderates the lagged, moment-to-moment association between sadness and RNT in daily life. The findings highlight the utility of large-scale functional brain networks with roles in cognitive conflict signaling, self-referential thought, and cognitive flexibility above and beyond self-report and interviewer-rated depressive symptoms in understanding the cognitive-affective sequelae of sadness. Results also indicate the feasibility and importance of considering moment-to-moment interactions between affect and cognition in daily life and encourages their consideration in cognitive control training interventions82,83,84 as well as in mindfulness-based interventions85 designed to reduce RNT.