The “Neural Shift” of Sleep Quality and Cognitive Aging: A Resting-State MEG Study of Transient Neural Dynamics

Sleep quality changes dramatically from young to old age, but its effects on brain dynamics and cognitive functions are not yet fully understood. We tested the hypothesis that a shift in brain networks dynamics relates to sleep quality and cognitive performance across the lifespan. Network dynamics were assessed using Hidden Markov Models (HMMs) in resting-state MEG data from a large cohort of population-based adults (N = 564, aged 18–88). Using multivariate analyses of brain-sleep profiles and brain-cognition profiles, we found an age-related “neural shift,” expressed as decreased occurrence of “lower-order” brain networks coupled with increased occurrence of “higher-order” networks. This “neural shift” was associated with both increased sleep dysfunction and decreased fluid intelligence, and this relationship was not explained by age, sex or other covariates. These results establish the link between poor sleep quality, as evident in aging, and a behavior-related shift in neural dynamics.


INTRODUCTION
With the increasing proportion of older adults in the worldwide population (Beard et al., 2016), there is a pressing need to understand the neurobiology of healthy aging. Sleep quality changes dramatically from young to older age, and might be both causative and indicative of brain changes in healthy aging (e.g., Feinberg et al., 1967;Scullin and Bliwise, 2015;Fjell et al., 2018). As people get older, sleep becomes more fragmented (e.g., Bliwise et al., 2009), less efficient (Gadie et al., 2017) and there is a decline in the quantity and quality of the "deep" stages of sleep, such as slowwave sleep (SWS) and REM sleep (Ohayon et al., 2004;Mander et al., 2017). Among older adults, sleep problems have been associated with increased risk of developing cardiovascular disease (Wu et al., 2018), dementia (Shi et al., 2018), and mental health problems (Roberts et al., 2000). An outstanding question is how these variations in sleep quality are related to brain function and cognitive performance, which also change with age.
One way to investigate the relations between sleep quality and brain functioning is by relating sleep measures to resting-state functional connectivity. In recent decades, resting-state functional connectivity, measured mainly with functional magnetic resonance imaging (fMRI), have proved effective in distinguishing various patient groups from controls (e.g., Alzheimer's disease, major depression, schizophrenia; see for example Lee et al., 2013). Substantial work has also used resting-state fMRI (rsfMRI) to examine the effects of age on functional connectivity (Andrews-Hanna et al., 2007;Grady, 2008;Ferreira and Busatto, 2013;Chan et al., 2014;Geerligs et al., 2015;Grady et al., 2016) with consequences for cognitive functioning (Tsvetanov et al., 2016;Bethlehem et al., 2020). Nevertheless, a recent attempt to relate resting-state functional connectivity to sleep quality, revealed no association between functional connectivity within or between restingstate networks and any objective or subjective sleep parameters (Lysen et al., 2020).
Decades-long investigation of sleep dysfunction and cognitive performance in healthy aging also yielded mixed results. Some studies suggest a link between poor sleep and reduced cognitive performance at older age (Feinberg et al., 1967;Hokett et al., 2021). For example, using a large cohort of healthy older adults (N∼1500, 65 + years old), Tsapanou et al. (2017) showed that poor sleep quality and longer sleep duration were linked to low memory performance. In another large-scale multicohort study, sleep problems were associated with subjective cognitive decline in multiple cognitive domains including memory, naming, orientation and calculations (Tsapanou et al., 2019). Furthermore, it has been shown that, for older adults, subjective sleep problems in later life were predictive of cognitive decline as indicated by their score in the Mini Mental Status Examination (MMSE; Folstein et al., 1975). Nevertheless, others have indicated that these relations might be more limited. In particular, following a comprehensive review of seven correlational and experimental domains, Scullin and Bliwise (2015) concluded that in older adults, variability in sleep often does not relate to cognitive functioning, and that solely improving sleep may not reverse cognitive impairments.
The discrepancy between studies may be in part due to methodological factors when investigating the effects of sleep on brain and cognitive function in healthy aging. First, the relations between sleep quality and the brain, as measured with fMRI, might be affected by age-dependent confounding factors like cerebrovascular reactivity and head motion (Power et al., 2012;Tsvetanov et al., 2015;Geerligs et al., 2017;Lehmann et al., 2017;Wu et al., 2021). While some of these confounds, like neurovascular coupling, can be addressed by more sophisticated modeling (Tsvetanov et al., 2021b), others like head-motion are notoriously difficult to correct (Maknojia et al., 2019). Moreover, the brain-sleep relations might not be fully captured by static measures of functional connectivity. In particular, dynamic fluctuations in activity and connectivity can support flexible reorganization and coordination of neural networks (e.g., Allen et al., 2014), prompting the extension of functional connectivity to further include dynamic measures (e.g., Cabral et al., 2017;Vidaurre et al., 2018). Nevertheless, the fundamentally limited temporal resolution of fMRI, owing to the sluggish hemodynamic response, precludes it from disclosing the potentially richer dynamics in brain connectivity. Finally, another important aspect to be considered is the multivariate nature of the relations between sleep patterns, cognitive patterns, and the associated neural mechanisms (Gadie et al., 2017).
In addressing these issues, we related transient restingstate neural dynamics to sleep quality, cognitive performance, and age, using a multi-level multivariate approach (Passamonti et al., 2019;Tsvetanov et al., 2021a;Tibon et al., 2021). We used magnetoencephalography (MEG) as a direct measure of neural activity sampled at 1 kHz and higher. Unlike fMRI, MEG is not affected by age-related changes in vascular factors (Tsvetanov et al., 2015), and allows simpler and more robust methods for correcting head-motion artifacts (e.g., Taulu and Simola, 2006). We used measures of resting-state MEG dynamic functional connectivity, inferred in our previous study (Tibon et al., 2021) from a population-based adult-lifespan cohort (18 to 88 years of age 1 ), using Hidden Markov Models. These measures capture transient states of activity and connectivity signatures lasting a few hundred milliseconds (HMM; Baker et al., 2014;Vidaurre et al., 2016Vidaurre et al., , 2017Vidaurre et al., , 2018Brookes et al., 2018;Hawkins et al., 2020). In addition to MEG scanning, these individuals also completed a self-report sleep questionnaire (PSQI: Pittsburgh Sleep Quality Index; Buysse et al., 1989) and a wide range of cognitive tasks. In the current study, we used Partial Least Squares (PLS) to relate patterns of neural dynamics to profiles of sleep quality and cognitive performance.
Using similar methods, we have previously observed a "neural shift, " expressed as increased occurrence of brain states involving "higher-order" networks and decreased occurrence of brain states that involve early visual networks. This neural shift was associated with both increased age and decreased fluid intelligence, suggesting that it likely reflects reduction in neural efficiency rather than compensation (Tibon et al., 2021). In light of the reduction in neural efficiency account, we predicted that the neural shift will be associated with the level of sleep dysfunction and that this association is distinguishable from the effects of age.

Participants
A flow diagram of the inclusion process is shown in Figure 1.
A population-based sample of 708 healthy human adults (359 women and 349 men) was recruited as part of Stage 2 of the Cambridge Centre for Aging and Neuroscience (Cam-CAN; see text footnote 1; Shafto et al., 2014). Ethical approval for the study was obtained from the Cambridgeshire 2 (now East of England-Cambridge Central Research Ethics Committee), and participants gave full informed consent. Exclusion criteria included poor vision (below 20/50 on Snellen test; Snellen, 1862) and poor hearing (threshold 35 dB at 1,000 Hz in both ears), ongoing or serious past drug abuse as assessed by the Drug Abuse Screening Test (DAST-20;Skinner, 1982), significant psychiatric disorder (e.g., schizophrenia, bipolar disorder, personality disorder), neurological disease (e.g., known stroke, epilepsy, traumatic brain injury), low score in the Mini Mental State Exam (MMSE; 24 or lower; Folstein et al., 1975), or poor English knowledge (non-native or non-bilingual English speakers); a detailed description of the exclusion criteria can be found in Shafto et al. (2014), Table 1. Of these, only participants who were considered for our previous study (Tibon et al., 2021; N = 594, following the removal of 98 participants who did not have full neuroimaging data, 15 participants with poor MEG-MRI co-registration, and one participant who had no visits to one of the HMM states) were included. In addition, 30 participants who were included in Tibon et al. (2021), but did not have full PSQI data (in all seven measures of sleep quality), were excluded from the current study. Thus, the final sample included 564 participants (age range 18-88; see Table 1 for participants' characteristics).

Sleep Measures
Sleep quality was assessed using the PSQI (Buysse et al., 1989), a well-validated self-report questionnaire designed to assist in the diagnosis of sleep disorders. The questions are grouped into seven components including overall sleep quality, sleep latency, sleep duration, sleep efficiency, sleep disturbance, sleep medication use, and daytime dysfunction due to sleepiness. Participants' scores in these components were used in our analyses. Each of the sleep components yields a score on an ordinal scale, ranging from 0 (good sleep/no problems) to 3 (poor sleep/severe problems), with higher  Dosage ranging between "once a day" to "as needed." *Note that some participants reported having more than one qualification.

Cognitive Tasks
Thirteen cognitive tasks, performed outside the scanner, were used to assess five broad cognitive domains, including executive function (fluid intelligence, multitasking), memory (visual shortterm memory, story recall), language (spot the word, sentence comprehension, picture-picture priming, verbal fluency, proverb comprehension), processing speed (choice motor speed, choice motor coefficient of variation) and emotional processing (face recognition, emotion expression recognition). The tasks are fully detailed in (Shafto et al., 2014). Task scores, also used in our previous study (Tibon et al., 2021; see Table 1 for full details), were obtained from Borgeest et al. (2018), in which missing data (< 12% in all tasks) were interpolated using Full Information Maximum Likelihood (Enders and Bandalos, 2001) across the full Stage 2 sample (n = 708), as implemented in the Lavaan R package (Rosseel, 2012).

Magnetoencephalography Resting-State Data
MEG resting-state data included 4 temporal characteristics for 8 inferred brain states (i.e., 32 measures overall). The acquisition, preprocessing, and analysis pipeline are fully described in Tibon et al. (2021), and are summarized in Figure 2. In short, MEG data were recorded from each participant while resting in a 306-channel VectorView MEG system (Elekta Neuromag, Helsinki). Each resting-state scan lasted 8 min and 40 s, and the entire duration of the scan was included in the analysis. The data were preprocessed using MaxFilter 2.2.12 software (Elekta Neuromag Oy, Helsinki, Finland) SPM12 2 , and the OHBA Software Library (OSL 3 ), and co-registered to each participant's structural T1-weighted MRI. Source space activity was then estimated for each participant at every point of an 8 mm whole-brain grid comprised of 3,559 grid points, using a single-shell lead-field model and a linearly constrained minimum variance (LCMV) scalar beamformer (Van Veen et al., 1997;Woolrich et al., 2011), parceled into 38 regions of interest (ROIs; as in Colclough et al., 2015), and summarized by the first principal component across grid points within that parcel. The amplitude envelope of each parcel's time-course was then calculated using a Hilbert transform. Group-level exploratory analysis of networks (GLEAN 4 ; Vidaurre et al., 2017) was then applied to the temporallyconcatenated envelope data across all participants, in order to infer 8 brain states via Hidden Markov Modeling (HMM). As reported in Tibon et al. (2021), we selected a priori eight states, as this number represents a reasonable trade-off between a sufficiently rich but not overly complex representation of network dynamics in resting-state MEG data (Baker et al., 2014). HMMs describe the dynamics of neural activity as a sequence of transient events, each of which corresponds to a visit to a particular brain state. Each state describes the data as coming from a unique 38-dimensional multivariate normal distribution, defined by a covariance matrix and a mean vector. Therefore, each state corresponds to a unique pattern of amplitude envelope variance and covariance that reoccurs at different time points. The HMM state time-courses then define the points in time at which each state was "active" or "visited." These estimated state time-courses, represented by a binary sequence showing the points in time when that state was most probable, were obtained using the Viterbi algorithm (Rezek and Roberts, 2005). Using these time-courses, the temporal characteristics of each state were quantified according to four measures of interest: (1)

Relating Brain States to Sleep Quality and Cognition
For the brain-sleep analysis, we adopted a two-level procedure (Passamonti et al., 2019;Tsvetanov et al., 2021a). In the firstlevel analysis, we assessed the multidimensional relationships between temporal characteristics of the HMM states and sleep quality using PLS implementation in Matlab, the Mathworks Inc. This analysis describes the linear relationships between the two multivariate data sets by providing pairs of latent factors, as linear combinations of the original variables that are optimized to maximize their covariance. It is similar to the canonical correlation analysis (CCA) used in our previous study (Tibon et al., 2021), which instead maximizes the correlation between the latent variables. Although both CCA and PLS are useful to characterize relationships between two datasets, PLS has been suggested as a more appropriate tool for mixed datasets (Grellmann et al., 2015;Beaton et al., 2019), as is in our case, with the continuous and ordinal nature of the HMM and sleep data, respectively. All variables were z-scored before being subjected to the PLS analysis. First, we used a permutation-based PLS with 10,000 permutations (by shuffling subjects in the sleep dataset) to relate the 4 temporal characteristics across all 8 HMM states (Set 1, 32 variables) to the 7 sleep measures (i.e., the seven components from the PSQI questionnaire: overall sleep quality, sleep latency, sleep duration, sleep efficiency, sleep disturbance, sleep medication use, and daytime dysfunction due to sleepiness; Set 2).
Once we established the relationships between the HMM brain measures and the sleep measures, we asked whether the relationship between the HMM profile and the sleep profile (i.e., the relations between the participants' scores on the latent variables obtained by the PLS analysis) varied with age, using a moderation analysis (see Tsvetanov et al., 2016Tsvetanov et al., , 2018, for a similar approach with different measures). Specifically, we constructed a second-level multiple linear model where HMM scores (on the latent variable), age, and their interaction term (HMM scores × age) were used as independent variables, and sleep scores (for the paired latent variable) were used as the dependent variable (all statistical tests were two-sided).
We then conducted another PLS analysis to relate the 32 HMM measures (Set 1) to the 13 cognitive measures (Set 2). This analysis resembles that in our previous study (Tibon et al., 2021) but uses PLS (instead of CCA) and a somewhat different sample (due to the exclusion of additional participants for which sleep data were not available). Similarly to our previous report, this analysis revealed a neural "shift" expressed as decreased occurrence of "lower-order" brain networks, and increased occurrence of "higher-order" networks, which was associated with decreased fluid intelligence. The reason to repeat this analysis in the current study was to obtain PLS scores and loadings that would be comparable with those obtained by the abovementioned PLS analysis, relating the HMM states to the sleep measures. Using these comparable scores, we asked whether the neural shift that was observed in our previous study, is also related to the pattern of sleep quality observed in the current study. To this end, we correlated both the HMM loadings and the profile scores (in two separate analyses), obtained by the first PLS analysis (i.e., which related HMM states to sleep quality) with the HMM loadings and profile scores obtained by the second PLS analysis (which related HMM states to cognition). Significant correlations would indicate that the pattern that was obtained for sleep quality and the pattern that was obtained for cognition are associated with the same neural pattern.

Relating Brain States to Sleep Measures
Our first step was to apply PLS to relate the 32 temporal characteristics of the HMM states (four metrics for each of the 8 states) to the seven sleep measures. This analysis identified one significant pair of latent factors (p = 0.01, based on a null distribution of 10,000 permutations). Figure 3A presents the loadings of this significant pair. For Set 1 (HMM data), the three frontotemporoparietal states (FTP1, FTP2, FTP3), and one of the sensorimotor states (SM1) showed positive loadings for the FO and NO measures, and negative loadings for the MIL measure. Furthermore, the first early visual state (EV1) showed negative loadings for FO, MLT, and NO and positive loadings for MIL. The second early visual state (EV2) displayed a similar pattern to that of EV1 for NO and for MIL, but not for NO (in which case the loadings for EV2 were positive). For the higher order Scatter plot of the bivariate association between the loadings for the HMM measures obtained via the brain-sleep PLS analysis and the HMM measures obtained via the brain-cognition PLS analysis. Different colors reflect different types of states (FTP, HOV, EV, or SM), and correspond to the same color coding used in Panel A. (C) Scatter plot of the bivariate association between subject scores for the HMM brain profile obtained via the brain-sleep PLS analysis and the HMM brain profile obtained via the brain-cognition PLS analysis. Each point represents the score for a given individual in the analysis. Age is color-coded such that darker colors represent younger age. Two outliers were removed for the purpose of this visualization. This removal did not change the results (i.e., the correlation between these measures slightly increased and remained highly significant, r = 0.81, p < 0.0001). In this plot, each data-point represents one participant, whereas in panel (B) above each data-point represents one measure.
visual state (HOV) and the second sensorimotor state (SM2) most loadings were lower than the threshold (±0.2), and those that exceeded the threshold-NO for HOV and MLT for SM2-were still relatively low. We therefore chose to exclude these states from further interpretations.
For Set 2 (sleep data), all of the components showed positive loadings (reflecting greater sleep dysfunction). The highest loadings were obtained for sleep efficiency, followed by sleep duration, and use of sleep medications. The lowest loadings were obtained for daytime dysfunction due to sleepiness. Taken together, poor sleep quality was associated with more and longer occurrences of states involving frontotemporoparietal regions and a state involving sensorimotor regions, and fewer, shorter occurrences of an early visual state.
The results obtained with the PLS analysis identified a neural shift that resembles the one related to cognitive decline as observed in our previous study (Tibon et al., 2021). However, before exploring this association further, we asked whether the relationship between the HMM brain profile and the sleep profile differs across the lifespan, and whether it exists above and beyond the relation between the HMM brain profile and age. For this moderation analysis, we constructed a multiple linear regression model that included participants' scores for the HMM profile, their age and the interaction (HMM profile × age) as predictors, and participants' scores for the sleep profile as the dependent variable. The HMM scores were significantly associated with sleep scores after accounting for the main effect of age [β = 0.05, t(560) = 2.4, p = 0.017], demonstrating that the established brain-sleep relationship was not driven solely by age effects. The sleep scores were further associated with age [β = −0.29, t(560) = −5.5, p < 0.001], verifying previous findings of age-related decline in sleep quality (e.g., Gadie et al., 2017). The interaction between age and HMM profile was not significant [β = 0.01, t(560) = 0.63, p = 0.5]. We then repeated the moderation analysis after including additional variables as potential covariates. The results did not change in meaningful way (see full details in the Supplementary Material).

Relating Brain States to Cognition (Verification of Previous Findings)
Next, we applied PLS to relate the 32 temporal characteristics of the HMM states (four metrics for each of the 8 states) to the 13 cognitive measures. This verifies the results of our previous study (Tibon et al., 2021), but uses a comparable method and sample to those that were used here, to test the association between HMM states and sleep. This analysis revealed a significant pair of latent variables (p = 0.01), depicting a pattern that highly resembled the pattern obtained in our previous study (two additional significant pairs depicted a different pattern, and were not explored further). The loadings obtained for this pair are shown in Supplementary Figure 1, together with the loadings obtained via CCA as in our previous study, in order to allow direct comparison. Although some of the loadings changed slightly, they were highly comparable with our previous results. Thus, here too, we observed that greater involvement of frontotemporoparietal states and reduced involvement of early visual states are associated with decreased fluid intelligence.

Correspondence Between Brain Profiles
Our final step was to investigate whether the neural shift that was associated with sleep dysfunction is the same as the one that was associated with decreased fluid intelligence. To this end, we correlated the HMM loadings obtained from the PLS analysis that related the HMM states to sleep measures, with the HMM loadings obtained from the PLS analysis that related the HMM states to cognitive measures. The correlation between these measures was highly significant, r = 0.83, p < 0.0001. However, as shown in Figure 3B, some states were more similar across the two PLS analyses than others. In particular, whereas the loadings obtained for the frontotemporoparietal, high-order visual, and somatosensory states were highly similar (r = 0.98, r = 92, and r = 97, respectively), noticeable variations were observed for the early-visual states (r = 0.64). Finally, we correlated participants' scores for the HMM profile obtained from the PLS analysis that related the HMM states to sleep measures with their scores for the HMM profile obtained from the PLS analysis that related the HMM states to cognitive measures. The correlation between these measures was also highly significant, r = 0.78, p < 0.0001.

DISCUSSION
The results of our study show that transient neural dynamics, particularly those of frontotemporoparietal and early-visual states, are associated with sleep dysfunction. We found that increased sleep dysfunction is associated with increased occurrence of brain states involving "higher-order" networks and decreased occurrence of a brain state that involves an early visual network. Importantly, the same neural pattern was associated with decreased fluid intelligence and increased age (originally reported in Tibon et al., 2021, and verified in the current study). In our previous study (Tibon et al., 2021), borrowing from the approach that was applied to explain the posteriorto-anterior shift with aging (PASA), commonly observed with fMRI during task (Grady et al., 1994;West, 2000;Glisky et al., 2001;Park et al., 2004;Raz and Rodrigue, 2006;Davis et al., 2008;Park and Reuter-Lorenz, 2009;Grady, 2012;Nyberg et al., 2012;Morcom and Henson, 2018), we considered two competing accounts for the shift from "lower" to "higher" networks that we have observed. The functional compensation hypothesis suggests that greater activation of higher-order regions serves to compensate for impairments in posterior brain regions, in order to maintain levels of cognitive performance. Thus, under the compensation account, we expect greater activation to correlate with an attenuated age-related decrease in cognitive performance. Alternatively, the inefficiency account suggests instead that the increased activation in higher-order regions reflects reduced neural efficiency or specificity. The crucial difference between these two accounts is that, whereas the functional compensation hypothesis predicts that the shift would correlate with better cognitive performance, the inefficiency account predicts the opposite pattern. Our previous findings that the neural shift was associated with worse cognitive performance, suggested that it represents reduced neural efficiency, thereby supporting the latter account. The current study provides further support for the neural inefficiency account by verifying the relations between the neural shift and decreased cognition (observed in our previous study) with another analytical approach, and by showing that the neural shift is further related to another maladaptive patternincreased sleep dysfunction.
The relationship between brain dynamics and sleep disturbance remained significant to other factors including chronological age. While the brain profile was associated with age (as was also demonstrated in our previous study, Tibon et al., 2021), it was further associated with the sleep profile above and beyond its relations to age. This suggests that the established relationship between brain and sleep cannot be solely explained by age. Notably, these results diverge from those obtained in a recent study by Lysen et al. (2020), in which sleep parameters were not associated with resting-state functional connectivity.
Nevertheless, there exist important differences between the study by Lysen et al. (2020) and the current study. Indeed, by using dynamic measures of functional connectivity, the current study includes another dimension that goes beyond the static measures that were employed by Lysen et al. (2020). Another consideration is that the hemodynamically convolved signal measured by fMRI as in Lysen et al. (2020) is limited to low frequencies and may be unable to detect the transient neural dynamics that we observed here with MEG.
By using a novel data-driven method to infer brain states from MEG data, we were able to overcome some of the limitations of the more common use of fMRI to examine functional connectivity, such as confounding effects of vascular health, head motion, and the ability to examine only very slow dynamics owing to low-frequency fluctuations of the fMRI response. Moreover, by using multivariate analyses to relate patterns of neural dynamics to patterns of sleep quality and cognitive performance, we were able to investigate multifaceted profiles that are not captured well by summary measures and univariate analysis. Indeed, not all measures were equally associated with the neural pattern. Specifically, measures of fluid intelligence were highly associated with increased occurrence "higher-order" brain states and decreased occurrence of early visual brain states, whereas measures of crystallized intelligence were not. The pattern of findings was consistent with previous reports (Tibon et al., 2021). A novel finding of the current study, was the association between the observed neural pattern and overall increase in sleep dysfunction. The strength of the association with individual sleep measures varied: it was highly associated with sleep duration, efficiency, and sleep medication use (loadings > 0.5), moderately associated with sleep quality, latency, and disturbance (loadings > 0.2), and only loosely associated with daytime dysfunction due to sleepiness.
Using latent class analysis (LCA), Gadie et al. (2017) were able to classify individuals into four different classes representing "sleep types, " associated with distinct profiles of "sleep symptoms." The probability of an individual showing the component profile associated with each class changed as a function of age for three of these classes labeled "good sleepers, " "inefficient sleepers, " and "delayed sleepers." The component profile of the class labeled "inefficient sleepers" resembled the pattern observed in the current study (though notably, it was also associated with increased sleep latency). This suggests that while age is associated with a general reduction in sleep quality, the neural shift observed in our study represents a more specific pattern of reduction. Importantly, our study shows that the relations between the neural shift and the sleep pattern cannot be fully attributed to age as a moderating factor (i.e., in our moderation analysis, these relations remained significant when controlling for age). Thus, in addition to its relation to aging, the neural shift is further associated with inefficient sleep patterns that exist beyond age, throughout the entire adult lifespan.
An important factor that was associated with the neural shift observed in the current study was usage of sleep medications (3rd highest loadings). Interestingly, studies have shown that some sleep medications are associated with changes in functional connectivity. For example, in a study by Pflanz et al. (2015), resting-state functional connectivity was investigated with fMRI, following seven-day diazepam administration. The authors found increased connectivity in response to diazepam administration in the medial visual network and middle/inferior temporal network. Furthermore, in a recent study (Frölich et al., 2020) with a sample of older adults (aged 55-73), infusion of midazolam resulted in increased rsfMRI functional connectivity between the dorsal default mode network and the posterior salience network. In the current study additional data regarding the kind of sleep medications and/or the dosage that was used are not readily available (the sparse data that were obtained are reported in Table 1), nor can we infer any causal relations between sleep medications and functional connectivity. Therefore, potential associations between specific prescriptions and neural patterns cannot be explored further. It is important to note, however, that while it is unlikely that the neural shift is solely explained by usage of sleep medications (as other sleep measures also had substantial contribution), it is still associated with this factor to some extent. These relations between sleep medications and neural patterns should be explored further in future studies, especially given our finding that the neural pattern that is associated with increased use of medications is linked to reduced cognitive performance and neural inefficiency.
In the current study, we observed a strong correlation between the loadings of the HMM measures obtained via the brainsleep PLS analysis, and the HMM measures obtained via the brain-cognition PLS analysis, suggesting that they represent a highly similar pattern. Nevertheless, not all HMM measures were similarly comparable. In particular, while the HMM measures describing the frontotempoparietal states were highly similar, those describing the early-visual states were not. This is mainly because the observed sleep pattern was only reliably related to one of the early-visual states, whereas the observed pattern of cognitive performance was associated with both. We speculate that the reason for this discrepancy is that cognitive performance depend more on the visual system than sleep quality, and are therefore more strongly associated with particular neural patterns that involve these regions.
One limitation of our study is that we used cross-sectional data, which precludes direct inferences about aging. However, we are not aware of any longitudinal MEG data on such a large, representative population, thus our results could be useful to generate hypotheses for future studies. The limitations of the MEG methods used in this study are thoroughly discussed in Tibon et al. (2021). In short, some properties of the assumptions and application of the HMM approach (e.g., group concatenation, Gaussian observation model, coarse percolation of ROIs, and a priori specification of 8 states) might result in oversimplification of the underlying neural dynamics. Nevertheless, some level of simplification is necessary for robust and interpretable modeling. Once the basic patterns are established, the parameters of the models can be adjusted to allow further optimization [see also discussion in Baker et al. (2014) and Quinn et al. (2018)]. Moreover, the current study used subjective reports of sleep quality. Although the PSQI questionnaire used for this purpose is well validated, it is yet to be determined whether the neural pattern that we have observed also correlates with objective measures of sleep quality (e.g., duration spent in Slow Wave Sleep; see review of various sleep measures in Hokett et al., 2021). Finally, the answers to the sleep questionnaire referred to the last month before the evaluation, and may not accurately represent long-term sleep patterns. Despite these limitations, our study verifies our previous findings, and further offers novel insights on the relationships between patterns of functional neural dynamics and sleep dysfunction in cognitive aging.

DATA AVAILABILITY STATEMENT
Raw data from the Cam-CAN project are available from http://camcan-archive.mrc-cbu.cam.ac.uk, subject to conditions specified on that website. For a complete description of Cam-CAN data and pipelines, see Shafto et al. (2014) and Taylor et al. (2017). In addition, pre-processed mean data used for analyses and figures, together with all the analysis code, are available at https://osf.io/6nh5w/.

ETHICS STATEMENT
The studies involving human participants were reviewed and approved by Cambridgeshire 2 (now East of England-Cambridge Central Research Ethics Committee). The participants provided their written informed consent to participate in this study.

AUTHOR CONTRIBUTIONS
RT designed, planned, carried out the analyses, and wrote the manuscript. KT consulted on the analyses and provided input on the manuscript. All authors contributed to the article and approved the submitted version.

FUNDING
The Cambridge Centre for Aging and Neuroscience (Cam-CAN) research was supported by the Biotechnology and Biological Sciences Research Council (BB/H008217/1). RT was supported by a British Academy Postdoctoral Fellowship (PF170046: SUAI/028 RG94188). KT was supported by the Guarantors of Brain (G101149). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

ACKNOWLEDGMENTS
We would like to thank Noham Wolpe for helping with classification of sleep medications. We are grateful to the Cam-CAN respondents and their primary care teams in Cambridge for their participation in this study. We would also like to thank colleagues at the MRC Cognition and Brain Sciences Unit MEG and MRI facilities for their assistance.