Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Optimizing an automated sleep detection algorithm using wrist-worn accelerometer data for individuals with chronic pain

  • Louis Faust ,

    Roles Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Writing – original draft, Writing – review & editing

    Faust.Louis@mayo.edu

    Affiliation Robert D. and Patricia E. Kern Center for the Science of Health Care Delivery, Mayo Clinic, Rochester, Minnesota, United States of America

  • Emma Fortune,

    Roles Conceptualization, Funding acquisition, Investigation, Methodology, Writing – review & editing

    Affiliation Robert D. and Patricia E. Kern Center for the Science of Health Care Delivery, Mayo Clinic, Rochester, Minnesota, United States of America

  • Omid Jahanian,

    Roles Conceptualization, Data curation, Methodology, Validation, Writing – review & editing

    Affiliations Robert D. and Patricia E. Kern Center for the Science of Health Care Delivery, Mayo Clinic, Rochester, Minnesota, United States of America, Rehabilitation Medicine Center, Mayo Clinic, Rochester, Minnesota, United States of America

  • Sey Oloyede,

    Roles Data curation, Resources, Writing – review & editing

    Affiliation Robert D. and Patricia E. Kern Center for the Science of Health Care Delivery, Mayo Clinic, Rochester, Minnesota, United States of America

  • Clifford Trouard,

    Roles Resources, Writing – review & editing

    Affiliation Pain Rehabilitation Center, Mayo Clinic, Jacksonville, Florda, United States of America

  • Suzanne Dixon,

    Roles Project administration, Resources, Writing – review & editing

    Affiliation Pain Rehabilitation Center, Mayo Clinic, Jacksonville, Florda, United States of America

  • Erica Torres,

    Roles Project administration, Resources, Writing – review & editing

    Affiliation Pain Rehabilitation Center, Mayo Clinic, Jacksonville, Florda, United States of America

  • Chris Sletten,

    Roles Funding acquisition, Investigation, Supervision, Writing – review & editing

    Affiliation Pain Rehabilitation Center, Mayo Clinic, Jacksonville, Florda, United States of America

  • Paul Scholten

    Roles Funding acquisition, Investigation, Supervision, Writing – review & editing

    Affiliation Department of Physical Medicine & Rehabilitation, Mayo Clinic, Rochester, Minnesota

Abstract

Objective

To optimize a wrist-worn accelerometer-based, automated sleep detection methodology for chronic pain populations.

Patients and methods

A cohort of 16 patients with chronic pain underwent free-living observation for one week before participating in an Interdisciplinary Pain Management Program. Patients wore ActiGraph GT9X devices and maintained a sleep diary, documenting their nightly bedtimes and wake times. To derive sleep quality measures from accelerometry data, the Tudor-Locke sleep detection algorithm was employed. However, this algorithm had not been validated for chronic pain patients. Therefore, a sensitivity analysis of the algorithm’s parameters was conducted, identifying a set of parameters which maximized the agreement between sleep periods identified by the algorithm and sleep periods identified by participant’s sleep logs, which were considered ground truth. Sleep measures derived when using the optimized parameters were then compared against sleep measures derived using the default parameters.

Results

Our optimized parameter set achieved a mean sleep detection agreement of 67% with participant’s sleep logs, while the default parameter set achieved a mean agreement of 50%. Statistically significant differences were observed between sleep measures from the optimal and default parameter sets (P < .001). These findings suggest an optimized parameter set should be favored for chronic pain populations.

Conclusion

The Tudor-Locke algorithm provides automated sleep detection for accelerometry data; however, caution must be exercised when applying the algorithm to populations beyond its validated scope. In this manuscript, we provide an empirically optimized parameter set for applying this algorithm to adults with chronic pain.

Introduction

The bidirectional relationship between sleep and chronic pain necessitates monitoring sleep in chronic pain populations [1]. Poor sleep quality disrupts pain modulation, increasing pain sensitivity and reducing tolerance [25]. Conversely, chronic pain disrupts sleep, resulting in difficulty in falling asleep, staying asleep, and achieving restorative sleep [6]. These disruptions may stem from pain-related discomfort or nocturnal awakenings due to pain flare-ups [7]. Poor sleep quality is also linked to functional impairments, reduced quality of life, and higher risks of depression and anxiety [810]. Therefore, improving sleep outcomes is an essential pillar of pain management [11].

To comprehensively assess sleep in chronic pain populations, various methods have been employed, including subjective questionnaires and polysomnography (PSG): recognized as the gold standard for evaluating sleep architecture and diagnosing sleep disorders [7,12]. While PSG provides accurate measurements, its reliance on overnight hospital stays limits scalability, and its controlled setting may not fully reflect natural sleep patterns [13,14]. Therefore, at-home monitoring tools may provide more ecologically valid assessments of sleep quality [15].

Accelerometers offer these capabilities as non-invasive tools that provide high-resolution, objective sleep data which correlate well with PSG, making them preferable to self-report surveys [1619]. As such, accelerometers have been used to study sleep across various populations, including those with sleep disorders and chronic pain [2022]. However, significant preprocessing is required to accurately extract relevant measures, demanding careful methodological choices [23,24].

To simplify preprocessing, several software platforms offer user-friendly interfaces for computing measures of physical activity, sleep, and device wear time. Despite their convenience, users must still understand and select the appropriate methods to ensure reliable outcomes. For example, ActiGraph’s ActiLife software uses a three-stage process: (1) an algorithm classifies each raw data epoch as “sleep” or “wake”, (2) using the resulting sleep/wake time series, a different algorithm then identifies sleep periods, lastly (3) sleep measures, such as duration and efficiency, are computed for each identified sleep period. The user must choose algorithms for stages (1) and (2) of this process, which can significantly impact results [25,26].

This study focused on stage (2), specifically investigating the Tudor-Locke (TL) algorithm, a method for identifying sleep periods from sleep/wake time series [27]. While the TL algorithm has been validated for children, its suitability for populations beyond this scope, such as those with chronic pain likely to exhibit abnormal sleep characteristics, remains unclear [27,28]. Therefore, this manuscript aimed to optimize the TL algorithm for a cohort of chronic pain patients. A sensitivity analysis identified a set of parameter values that maximized the agreement between the algorithm and participants’ self-reported sleep logs, providing evidence for a new set of parameter values when examining chronic pain populations.

Materials and methods

Study design

This study focused on a cohort of chronic pain patients who participated in an interdisciplinary pain management program (IPMP) at Mayo Clinic. Patients in this program have “high-impact” chronic pain that significantly impacts their physical and often emotional functioning [29]. Typically, these patients have persistent pain irrespective of the underlying etiology, despite extensive treatment with usual interventions including physical therapy, medications, interventional pain treatments and, in some cases, surgery. The overall aim of our research is to evaluate the efficacy of IPMP on patient’s pain management, utilizing objective measurements of physical activity and sleep to assess participants’ treatment response. The aim of the study presented in this manuscript focused on optimizing the TL sleep period identification algorithm to characterize sleep in chronic pain patients, pre-IPMP participation.

Participants were eligible for this study if they met the following qualifications: 1) were between 18-85 years old; 2) were enrolled in the IPMP for chronic pain; 3) agreed to wear an activity monitor; and 4) agreed to complete follow-up assessments. Participants were ineligible if any of the following criteria applied: 1) were receiving worker’s compensation; 2) could not provide independent consent; 3) were pregnant or became pregnant during the study time frame; 4) were employed at Mayo Clinic; 5) were non-independent ambulators; or 6) had a functional movement disorder.

Upon enrollment, participants were mailed an ActiGraph GT9X device to wear for one week before starting the IPMP and instructed to perform their typical daily activities and nightly sleep routines. Participant’s baseline sleep routines were captured using ActiGraph devices and self-report sleep diaries. ActiGraphs were set to a sampling rate of 30Hz. Sleep measures were processed using ActiLife software (v6.13.4) and R (v4.3.1). Statistical analyses were conducted using R (v4.3.1) and Python (v3.12.1).

To ensure sleep routines were reliably represented, participants needed at least five nights of sleep in which 1) the device was worn to bed and 2) sleep and wake times were documented in a sleep log. This five night minimum has been shown to reliably estimate weekly average sleep duration and variability [30]. Additionally, recorded nights did not need to be consecutively measured [30]. Among the 17 participants assessed at baseline, 16 had sufficient wear time and sleep log data. The median number of eligible nights was 7 (IQR, [6, 7]).

Ethics

This observational study was approved by the Mayo Clinic’s IRB after a full board review under protocol number 21-006718. All participants provided written informed consent prior to taking part in the study. The study ran from September 19th, 2022, through December 5th, 2023.

Data processing

To derive sleep measures from raw accelerometry data, ActiLife employs a three-stage process. The first stage requires an algorithm to process the raw accelerometry data, classifying every epoch as “sleep” or “wake”. In this study, “epochs” were one minute long, as required by the TL algorithm for detecting sleep periods later in stage two [31]. ActiLife provides two algorithms for stage one: Cole-Kripke and Sadeh. Cole-Kripke was chosen over Sadeh as it was developed and validated on an adult population [32], while Sadeh was validated on children and young adults [33]. Although ActiLife also allows users to implement their own custom algorithm for this stage, Cole-Kripke’s comparable performance to state-of-the-art algorithms and built-in availability, makes it the pragmatic choice for clinical use [34].

In the second stage, a different algorithm identifies sleep periods from the resulting sleep/wake time series. ActiLife offers two options: the TL algorithm and ActiLife’s own algorithm. Sleep periods can also be manually defined using self-reported sleep logs.

The TL algorithm uses three parameters to detect sleep periods: (1) Bedtime Definition - the minimum number of consecutive sleep epochs necessary to start a sleep period (default: 5 epochs); (2) Wake Time Definition - the minimum number of consecutive wake epochs which mark the end of a sleep period (default: 10 epochs); and (3) Min Sleep Period Length - the minimum amount of time necessary between the bedtime and wake time (default: 160 minutes). The TL algorithm then parses the sleep/wake epochs to identify sleep periods as contiguous blocks of epochs fitting within these definitions. In addition, ActiLife provides two optional parameters. Minimum Non-Zero Epochs, which requires the sleep period to contain at least X epochs with activity counts greater than zero to prevent falsely detecting non-wear periods as sleep (default: 0 epochs). And Max Sleep Period Length, setting an upper limit to sleep period length. By default, this is set to 1440 minutes, as ActiLife restricts sleep periods to less than 24 hours [31].

For completeness, ActiGraph’s own sleep period detection algorithm was evaluated. However, since it does not require tuning parameters, a sensitivity analysis was not necessary.

The final stage computes sleep measures from each identified sleep period, requiring no user input.

Tudor-Locke sensitivity analysis

To identify optimal TL parameters for our chronic pain population, we conducted a sensitivity analysis on four parameters: Bedtime Definition, Wake Time Definition, Min Sleep Period Length, and Minimum Non-Zero Epochs. Max Sleep Period Length was kept at its default value to avoid arbitrary upper limits on sleep period length. The values evaluated were:

  • Bedtime Definition and Wake Time Definition: 5, 10, 15, 20, 25, and 30 minutes
  • Min Sleep Period Length: 30, 60, 90, 120, 150, 160, and 180 minutes
  • Minimum Non-Zero Epochs: 0, 5, 10, 15, 20, and 25 epochs

Using all possible combinations of these parameters, we tested 1,512 unique parameter sets, opting for a code-based approach using the R package actigraph.sleepr to avoid manually operating ActiLife’s graphical user interface. This package includes implementations of the Cole-Kripke and Tudor-Locke algorithms [35].

Each parameter set’s performance was measured by the Percentage of Agreement between TL algorithm-derived sleep periods and participant’s sleep logs. Percentage of Agreement was calculated as the number of one-minute time-points where both methods agreed the participant was asleep, divided by the total number of unique time-points where either method classified the participant as asleep.

As our focus centered on agreement between sleep periods, periods of wake were not included. Additionally, periods of wake/restlessness within a sleep period were not evaluated, as they were not recorded in sleep logs. Although we considered metrics like Cohen’s Kappa for inter-rater reliability, we found Percentage of Agreement more suitable, as it imposed a greater penalty when the TL algorithm failed to identify any sleep periods for a night. Such failures are often due to excessive movements throughout the sleep period. These movements result in an insufficient number of sleep epochs—identified by the Cole-Kripke algorithm—from occurring consecutively, preventing a sleep period from being recognized by the TL algorithm for that night.

For each parameter set, Percentage of Agreement was calculated separately for each participant and then averaged across all participants. This approach limited bias from the varying amounts of data contributed by participants. The optimal parameter set was selected based on the maximum average agreement score.

Sleep measure comparison between default and optimized Tudor-Locke parameters

After identifying an optimal parameter set for our chronic pain population, we evaluated the TL algorithm with this optimized parameter set (TLO) through two analyses, comparing TLO against the TL algorithm with default parameters (TLD) and participant’s sleep logs (SL).

Sleep measures derived from each method were compared, with SL considered as ground truth. All ActiLife sleep measures were included (detailed in Table 1). Note that Latency - the time it takes to fall asleep, is included for completeness. However, the TL algorithm will always produce a value of zero, as the algorithm requires the first epoch of any sleep period to be a sleep state [31].

thumbnail
Table 1. The set of sleep measures computed by ActiLife, including definitions for each measure and the aggregation methods utilized when multiple sleep periods were detected within the same day.

https://doi.org/10.1371/journal.pone.0319348.t001

Sleep measures were calculated for each detected sleep period, typically resulting in one set per night. However, if multiple periods were detected within the same night, the measures were aggregated by day to allow for one-to-one comparisons across methods (see Table 1 for details). All sleep periods were assigned to the day they ended.

Sleep measures were calculated from detected sleep periods, leading to missing data on days without detected periods. To address this, a complete-case analysis was applied where possible [40]. A supplementary analysis compared TLD and TLO using both complete-case and zero-imputation methods to assess any potential bias (see Section S1 in the Supplementary Materials). No bias was observed resulting from the choice of missing data strategy [40,41].

Two comparative analyses were conducted:

  • Extended Bland-Altman plots: An extension to the original Bland-Altman plots allowing for repeated measures within subjects [42] was used to compare SL (considered the gold standard for this analysis) with sleep periods detected from TL, employing a complete-case strategy when necessary.
  • Wilcoxon Signed-Rank Test: We tested for significant differences in sleep measures between SL and TLD, SL and TLO, and TLD and TLO, respectively, using participants’ mean sleep measures as paired values. Statistical significance was defined at a P value of 0.05 [43].

Finally, visualizations and descriptive statistics are provided, including side-by-side box plots and tables showing means and standard deviations. Missing sleep measures were excluded, with distributions representing all detected sleep periods. A supplementary analysis was performed in which sleep measures were compared among participants stratified by age: ≤ 50 years and > 50 years, with complete details available in Section S6 of the Supplementary Materials.

Results

Participant population

The study included 16 adults with chronic pain. The median participant age was 49.5 (IQR, [33, 56]) and 87.5% were women. All participants identified as “White/Caucasian” and “Not Hispanic or Latino”. The median participant BMI was 29 (IQR, [24, 30.8]), 50% reported an annual household income ≥ $90,000. Among these patients, 81.25% had at least some college education, with 18.75% having obtained a Master’s degree. Participants had a mean duration of pain of 9.99 years (SD =  8.73), mean severity of pain, as measured by pain numeric rating scale (NRS), of 6.38 (SD =  2.03) [45], SF-36 (quality of life measure) for pain of 30.62 (SD =  15.04) [44] and Central Sensitization Score (CSS) of 54.12 (SD =  7.53) [46, 47]. Among medications taken by participants, 31% were prescribed medications specifically for enhancing sleep. Participants average Medication Quantification Scale Score III [48] was 10.74 (SD = 13.43). A complete detailing of participants sociodemographic and clinical characteristics is provided in Table 2.

Tudor-Locke sensitivity analysis

The TLO set for our chronic pain population featured a Bedtime Definition of 5 minutes, a Wake Time Definition of 25 minutes, a Min Sleep Period Length of 160 minutes, and a Minimum Non-Zero Epochs of 5 minutes. Compared to TLD, TLO revised the default Wake Time Definition from 10 to 25 minutes and Minimum Non-Zero Epochs from 0 to 5 minutes. TLD achieved a Percentage of Agreement of 50% with the sleep logs, while TLO achieved 67%. An overview of the sensitivity analysis is provided in Section S2 of the Supplementary Materials along with the S1 Dataset containing results for every parameter set evaluated. On average, Wake Time Definition had the greatest impact on Percentage of Agreement, with lower values of Wake Time Definition decreasing Percentage of Agreement.

ActiGraph’s own sleep period detection algorithm achieved 56% agreement with sleep logs, outperforming the TLD algorithm (50% agreement), yet, was surpassed by the TLO algorithm (67% agreement). Given the superior agreement observed by TLO, we omitted ActiGraph’s custom algorithm from further analysis and focused solely on the TL algorithm.

Comparison between default and optimized Tudor-Locke parameters

Sleep period detection.

The TL algorithm occasionally failed to detect a sleep period entirely, despite a sleep period being recorded in the participant’s sleep log for that night. For the TLD algorithm, 11 days were missed (10.2% of all days), spanning across 6 participants (37.5% of all participants). Among these 6 participants, an average of 1.83 (SD: 0.98) days were missed. For the TLO algorithm, 3 days were missed (2.8% of all days), across 3 participants (18.75% of all participants), with one night missed for each participant.

Sleep Measures.

The first analysis compared sleep measures between SL and TLD, and SL and TLO, using Extended Bland-Altman plots. Summary statistics from these plots are presented in Table 3, with plots for each sleep measure available in Section S3 of the Supplementary Materials. Overall, stronger agreement was seen between SL and TLO compared to SL and TLD. When comparing SL and TLD, proportional biases were observed for Efficiency, Wake After Sleep Onset (WASO), Number of Awakenings and Movement Index. In these instances, the difference between TL and SL increased as the average magnitude increased. However, these biases were not present between SL and TLO. For Average Awakening Length, a similar proportional bias was observed for both the SL and TLD comparison, and the SL and TLO comparison, respectively.

thumbnail
Table 3. Mean Bias and 95% Limits of Agreement derived from Bland-Altman are presented for each sleep measure. Comparisons are made between Tudor-Locke with default parameters and sleep logs, as well as Tudor-Locke with optimized parameters and sleep logs, with sleep logs serving as the “gold-standard” measure.

https://doi.org/10.1371/journal.pone.0319348.t003

In the second analysis, participant-level means were computed for each sleep measure. Wilcoxon Signed-rank tests were used to compare distributions between SL and TLD, SL and TLO, and TLD and TLO, respectively. Results are provided in Fig 1 as boxplots accompanied by the pair-wise comparisons (exact values for the Wilcoxon tests are available in Section S4 of the Supplementary Materials, while deidentified, aggregated sleep measures are available in the S2 Dataset). Statistically significant differences were observed between SL and TLD for all sleep measures, as well as between TLD and TLO. Statistically significant differences were observed between SL and TLO only for Latency (P <  0.001) and Efficiency (P =  0.025).

thumbnail
Fig 1. Boxplots detailing the distribution of participants mean sleep measures, stratified by each sleep period detection method: participant’s sleep logs

(SL), the Tudor-Locke algorithm with default parameters (TLD), and the Tudor-Locke algorithm with optimized parameters (TLO). [49] Results of Wilcoxon Signed-Rank Test comparisons are included with significance values indicated as ns: 0.05 <  P ≤  1.00; * : 0.01 <  P ≤  0.05; **. 0.001 < P 0.01; ***: P 0.001. Note: this test was not performed for TLD vs TLO on the Latency measure as, per the Tudor-Locke algorithm, this measure always results in zero. Therefore, the test cannot be conducted.

https://doi.org/10.1371/journal.pone.0319348.g001

Finally, the means and standard deviations of each sleep measure across each detection method, are provided in Section S5 of the Supplementary Materials. For the supplementary analysis comparing sleep measures when stratified by participants age: ≤ 50 years and > 50 years, no significant differences in sleep measures were observed between these groups. These results were found to be reasonably consistent with observations from large scale studies [50]. A complete detailing of this analysis is provided in Section S6 of the Supplementary Materials.

Discussion

The TL algorithm provides versatility in detecting sleep periods in accelerometry data through its adjustable parameters, however, the default settings may not suit all populations. Initially validated on a cohort of 30 fourth-grade children, its applicability to chronic pain sufferers with disrupted sleep patterns remains unclear [27, 28]. Moreover, the initial validation utilized waist-worn accelerometers [27], raising concerns about its validity for wrist-worn devices, which are generally preferred for sleep detection [51]. This limited understanding of the algorithm’s broader applicability highlights the need to reassess parameter values in different populations to ensure valid results.

Our sensitivity analysis found an optimal parameter set for our chronic pain population, where increasing the Wake Time Definition significantly improved agreement with sleep logs. This more conservative definition may better suit chronic pain patients who experience higher restlessness, preventing false identification of sleep period endings [7].

For Minimum Non-Zero Epochs, our optimized value of 5 epochs offered a negligible 0.01% improvement in agreement over the default of 0 epochs, assuming other parameters were optimized. Despite its limited impact in our setting—where participants consistently wore their devices at night—this parameter is crucial for analyzing 24-hour sleep-wake cycles, particularly in distinguishing sleep from non-wear periods, a known limitation of the Cole-Kripke algorithm [52].

When comparing sleep measures, TLO showed stronger agreement with SL than TLD, which is expected since TLO’s parameters were optimized to agree with SL. Instead, this comparison highlights the discrepancies between TLD and SL, indicating the default parameters are inadequate for this cohort of chronic pain patients.

Comparison with prior work

To contextualize our resulting sleep measures, we have compared them with several prior studies examining similar cohorts and different sleep detection modalities, an overview is provided in Table 4.

thumbnail
Table 4. A comparison of sleep measures derived from Tudor-Locke with optimized parameters (TLO) to three previous studies: an accelerometry study featuring a chronic pain cohort (column ACC, Andrews et al. [22]), a polysomnography (PSG) meta-analysis of chronic pain cohorts (column PSG MA, Bjurstrom et al. [53]), and a nationally representative accelerometry study of older adults (column NSHAP, Kurina et al. [54]). We present the mean sleep measures for our cohort along with standard deviation (SD) and standard error (SE) to facilitate comparisons with the other studies.

https://doi.org/10.1371/journal.pone.0319348.t004

First, we compared our sleep measures with a similar study utilizing accelerometry to measure sleep in chronic pain patients. Andrews, et. al, examined 50 older adults (mean age =  54.22, SD =  10.68) with chronic pain [22]. Sleep measures were derived using GT3X ActiGraph accelerometers and participant’s sleep logs. Referring to Table 4, Total Minutes in Bed and Average Awakening Length were found to be reasonably consistent between the two studies. However, participants in our cohort awoke, on average, 17.85 more times per night. This discrepancy may be due in part to our cohort being predominantly women (87.5%), as Andrews, et. al, reported that their female participants had more awakenings, on average, compared to male participants.

Second, we compared our accelerometry-derived sleep measures to PSG, focusing on a meta-analysis of PSG studies (n =  19) conducted in fibromyalgia and chronic widespread pain populations [53]. Referring to Table 4, TST and Efficiency fell within ranges reported by PSG, however, WASO was higher in our cohort.

Finally, we compared our results to the National Social Life, Health, and Aging Project (NSHAP), a nationally representative cohort of 739 older adults (ages 62-90) monitored using ActiWatch Spectrum accelerometers [54]. This comparison assessed the similarity between our cohort and the general older adult population. As shown in Table 4, our cohort’s sleep measures were reasonably consistent, except for higher WASO.

Overall, these comparisons suggest many of the sleep measures observed in our study are within the range of those reported in similar populations and when gathered using PSG. Metrics representing amount of time spent awake through the sleep session (WASO and Number of Awakenings), however, were higher in our study which may be due to restlessness/limb movement during sleep being misclassified as awake time with actigraphy.

Limitations

In our study, TL parameter optimization was based on self-reported sleep logs, which are susceptible to recall bias [59], and was constrained by a small sample size of 16 participants. Therefore, further sensitivity analyses with larger samples and different platforms are needed to ensure reliable results. Although a revised TL algorithm was released in 2018 [60], we used the original version, as it was the version implemented in ActiLife at the time of writing [31].

Conclusion

Automated sleep detection via accelerometry is inherently difficult. While the TL algorithm provides investigators with a variety of useful sleep measures based on the sleep periods it identifies, the accuracy of the algorithm depends on its parameter settings. Having been validated on healthy children and young adults, the algorithm’s default parameters may not be suitable for populations who experience abnormal or disruptive sleep patterns, such as those with chronic pain. As such, sensitivity analyses are needed to reevaluate these parameters for broader applicability. This manuscript presents a sensitivity analysis that refines the TL parameter set for a cohort of adults with chronic pain. The optimized parameter set provides researchers studying chronic pain populations with a more reliable starting point for identifying sleep periods, thereby enhancing the accuracy of the sleep metrics it derives. This optimization enables more accurate assessments of outcomes and intervention effectiveness pertaining to sleep amongst this population, broadening the algorithms applicability while improving clinical understanding and care.

Supporting information

S1 File. Supplementary materials.

PDF containing supplementary analyses, tables, and figures.

https://doi.org/10.1371/journal.pone.0319348.s001

(PDF)

S1 Dataset. Sensitivity analysis.

Complete results of the sensitivity analysis.

https://doi.org/10.1371/journal.pone.0319348.s002

(CSV)

S2 Dataset. Participant’s deidentified, aggregated sleep measures as generated by the three different sleep detection methods.

https://doi.org/10.1371/journal.pone.0319348.s003

(XLSX)

Acknowledgments

The content is solely the responsibility of the authors and does not necessarily represent the official views of the Mayo Clinic.

References

  1. 1. Finan PH, Goodin BR, Smith MT. The association of sleep and pain: an update and a path forward. J Pain. 2013;14(12):1539–52. pmid:24290442
  2. 2. Smith MT, Edwards RR, McCann UD, Haythornthwaite JA. The effects of sleep deprivation on pain inhibition and spontaneous pain in women. Sleep. 2007;30(4):494–505. pmid:17520794
  3. 3. Staffe AT, Bech MW, Clemmensen SLK, Nielsen HT, Larsen DB, Petersen KK. Total sleep deprivation increases pain sensitivity, impairs conditioned pain modulation and facilitates temporal summation of pain in healthy participants. PLoS One. 2019;14(12):e0225849. pmid:31800612
  4. 4. Boakye P, Olechowski C, Rashiq S, Verrier MJ, Kerr B, Witmans M, et al. A Critical Review of Neurobiological Factors Involved in the Interactions Between Chronic Pain, Depression, and Sleep Disruption. Clin J Pain. 2016;32(4):327–36. pmid:26035521
  5. 5. Haack M, Simpson N, Sethna N, Kaur S, Mullington J. Sleep deficiency and chronic pain: potential underlying mechanisms and clinical implications. Neuropsychopharmacology. 2020;45(1):205–16. pmid:31207606
  6. 6. McCracken LM, Iverson GL. Disrupted sleep patterns and daily functioning in patients with chronic pain. Pain Res Manag. 2002;7(2):75–9. pmid:12185371
  7. 7. Mathias J, Cant M, Burke A. Sleep disturbances and sleep disorders in adults living with chronic pain: a meta-analysis. Sleep medicine. 2018;52198–210.
  8. 8. Sayar K, Arikan M, Yontem T. Sleep quality in chronic pain patients. Can J Psychiatry. 2002;47(9):844–8. pmid:12500754
  9. 9. Alvaro PK, Roberts RM, Harris JK. A Systematic Review Assessing Bidirectionality between Sleep Disturbances, Anxiety, and Depression. Sleep. 2013;36(7):1059–68. pmid:23814343
  10. 10. Burgess HJ, Burns JW, Buvanendran A, Gupta R, Chont M, Kennedy M, et al. Associations Between Sleep Disturbance and Chronic Pain Intensity and Function: A Test of Direct and Indirect Pathways. Clin J Pain. 2019;35(7):569–76. pmid:30913041
  11. 11. Cheatle MD, Foster S, Pinkett A, Lesneski M, Qu D, Dhingra L. Assessing and Managing Sleep Disturbance in Patients with Chronic Pain. Anesthesiol Clin. 2016;34(2):379–93. pmid:27208716
  12. 12. Kushida CA, Chang A, Gadkary C, Guilleminault C, Carrillo O, Dement WC. Comparison of actigraphic, polysomnographic, and subjective assessment of sleep parameters in sleep-disordered patients. Sleep medicine. 2001;2(5):389–96.
  13. 13. Kosmadopoulos A, Sargent C, Darwent D, Zhou X, Roach GD. Alternatives to polysomnography (psg): a validation of wrist actigraphy and a partial-psg system. Behavior research methods. 2014;46(4):1032–1041.
  14. 14. Van de Water AT, Holmes A, Hurley DA. Objective measurements of sleep for non-laboratory settings as alternatives to polysomnography–a systematic review. Journal of Artificial Intelligence Research. 2011;5(2):123–45.
  15. 15. Sánchez-Ortuño MM, Edinger JD, Means MK, Almirall D. Home is where sleep is: an ecological approach to test the validity of actigraphy for the assessment of insomnia. Journal of Clinical Sleep Medicine. 2010;6(1):21–9.
  16. 16. Perez-Pozuelo I, Zhai B, Palotti J, Mall R, Aupetit M, Garcia-Gomez JM, et al. Understanding the Universe. 2023. NPJ Digital Medicine. 2020;3(1):42.
  17. 17. Sadeh A. The role and validity of actigraphy in sleep medicine: an update. Sleep Med Rev. 2011;15(4):259–67. pmid:21237680
  18. 18. Spielmanns M, Bost D, Windisch W, Alter P, Greulich T, Nell C, et al. Measuring Sleep Quality and Efficiency With an Activity Monitoring Device in Comparison to Polysomnography. J Clin Med Res. 2019;11(12):825–33. pmid:31803327
  19. 19. Jean-Louis G, Kripke DF, Cole RJ, Assmus JD, Langer RD. Sleep detection with an accelerometer actigraph: comparisons with polysomnography. Physiology & Behavior. 2001;72(1–2):21–8.
  20. 20. Thurman SM, Wasylyshyn N, Roy H, Lieberman G, Garcia JO, Asturias A, et al. Individual differences in compliance and agreement for sleep logs and wrist actigraphy: A longitudinal study of naturalistic sleep in healthy adults. PLoS One. 2018;13(1):e0191883. pmid:29377925
  21. 21. Smith MT, McCrae CS, Cheung J, Martin JL, Harrod CG, Heald JL, Carden KA. Use of actigraphy for the evaluation of sleep disorders and circadian rhythm sleep-wake disorders: an american academy of sleep medicine clinical practice guideline. Journal of Citation Studies. 2018;12(3):1231–7.
  22. 22. Andrews NE, Strong J, Meredith PJ, D’Arrigo RG. Association between physical activity and sleep in adults with chronic pain: a momentary, within-person perspective. Phys Ther. 2014;94(4):499–510. pmid:24231224
  23. 23. Nahavandi D, Alizadehsani R, Khosravi A, Acharya UR. Application of artificial intelligence in wearable devices: Opportunities and challenges. Comput Methods Programs Biomed. 2022;213106541. pmid:34837860
  24. 24. de Zambotti M, Cellini N, Goldstone A, Colrain IM, Baker FC. Wearable Sleep Technology in Clinical and Research Settings. Med Sci Sports Exerc. 2019;51(7):1538–57. pmid:30789439
  25. 25. Suau Q, Bianchini E, Bellier A, Chardon M, Milane T, Hansen C, et al. Current Knowledge about ActiGraph GT9X Link Activity Monitor Accuracy and Validity in Measuring Steps and Energy Expenditure: A Systematic Review. Sensors (Basel). 2024;24(3):825. pmid:38339541
  26. 26. Haghayegh S, Khoshnevis S, Smolensky MH, Diller KR, Castriotta RJ. Performance comparison of different interpretative algorithms utilized to derive sleep parameters from wrist actigraphy data. Chronobiol Int. 2019;36(12):1752–60. pmid:31658822
  27. 27. Tudor-Locke C, Barreira TV, Schuna JM Jr, Mire EF, Katzmarzyk PT. Fully automated waist-worn accelerometer algorithm for detecting children’s sleep-period time separate from 24-h physical activity or sedentary behaviors. Appl Physiol Nutr Metab. 2014;39(1):53–7. pmid:24383507
  28. 28. Smith MT, Haythornthwaite JA. How do sleep disturbance and chronic pain inter-relate? Insights from the longitudinal and cognitive-behavioral clinical trials literature. Sleep Med Rev. 2004;8(2):119–32. pmid:15033151
  29. 29. Zelaya CE, Dahlhamer JM, Lucas JW, Connor EM. (2020). Chronic pain and high-impact chronic pain among US adults. 2019.
  30. 30. Lau T, Ong JL, Ng BKL, Chan LF, Koek D, Tan CS, et al. Minimum number of nights for reliable estimation of habitual sleep using a consumer sleep tracker. Sleep Adv. 2022;3(1):zpac026. pmid:37193398
  31. 31. What does the “detect sleep periods” button do and how does it work?. 2020.
  32. 32. Cole RJ, Kripke DF, Gruen W, Mullaney DJ, Gillin JC. Automatic sleep/wake identification from wrist activity. Sleep. 1992;15(5):461–9. pmid:1455130
  33. 33. Sadeh A, Sharkey KM, Carskadon MA. Activity-based sleep-wake identification: an empirical test of methodological issues. Sleep. 1994;17(3):201–7. pmid:7939118
  34. 34. Patterson MR, Nunes AAS, Gerstel D, Pilkar R, Guthrie T, Neishabouri A, et al. 40 years of actigraphy in sleep medicine and current state of the art algorithms. NPJ Digit Med. 2023;6(1):51. pmid:36964203
  35. 35. Petkova D. actigraph.sleepr: Detect periods of sleep and non-wear from ActiGraph data. 2022.
  36. 36. Aubert-Tulkens G, Culée C, Harmant-Van Rijckevorsel K, Rodenstein DO. Ambulatory evaluation of sleep disturbance and therapeutic effects in sleep apnea syndrome by wrist activity monitoring. Am Rev Respir Dis. 1987;136(4):851–6. pmid:3662239
  37. 37. ActiGraph. What is sleep fragmentation and how is it calculated? 2023. Accessed: 2024-02-27. http://web.archive.org/web/20240227173105/ https://actigraphcorp.my.site.com/support/s/article/What-is-Sleep-Fragmentation-and-how-is-it-calculated
  38. 38. Loewen A, Siemens A, Hanly P. Sleep disruption in patients with sleep apnea and end-stage renal disease. J Clin Sleep Med. 2009;5(4):324–9. pmid:19968009
  39. 39. Knutson KL, Van Cauter E, Zee P, Liu K, Lauderdale DS. Cross-sectional associations between measures of sleep and markers of glucose metabolism among subjects with and without diabetes: the coronary artery risk development in young adults (cardia) sleep study. Diabetes care. 2011;34(5):1171–6.
  40. 40. Little RJ, Rubin DB. Complete-case and available-case analysis, including weighting methods.
  41. 41. Zhang Z. Missing data imputation: focusing on single imputation. Annals Of Translational Medicine. 2016. 4. p. 1.
  42. 42. Parker RA, Weir CJ, Rubio N, Rabinovich R, Pinnock H, Hanley J, et al. Application of Mixed Effects Limits of Agreement in the Presence of Multiple Sources of Variability: Exemplar from the Comparison of Several Devices to Measure Respiratory Rate in COPD Patients. PLoS One. 2016;11(12):e0168321. pmid:27973556
  43. 43. Woolson RF. Wilcoxon signed-rank test. Wiley encyclopedia of clinical trials. 2007. p. 1–3.
  44. 44. Ware JE Jr. SF-36 health survey update. Spine (Phila Pa 1976). 2000;25(24):3130–9. pmid:11124729
  45. 45. Hawker GA, Mian S, Kendzerska T, French M. Measures of adult pain: Visual Analog Scale for Pain (VAS Pain), Numeric Rating Scale for Pain (NRS Pain), McGill Pain Questionnaire (MPQ), Short-Form McGill Pain Questionnaire (SF-MPQ), Chronic Pain Grade Scale (CPGS), Short Form-36 Bodily Pain Scale (SF-36 BPS), and Measure of Intermittent and Constant Osteoarthritis Pain (ICOAP). Arthritis Care Res (Hoboken). 2011;63 Suppl 11S240-52. pmid:22588748
  46. 46. Neblett R, Cohen H, Choi Y, Hartzell MM, Williams M, Mayer TG, et al. The Central Sensitization Inventory (CSI): establishing clinically significant values for identifying central sensitivity syndromes in an outpatient chronic pain sample. J Pain. 2013;14(5):438–45. pmid:23490634
  47. 47. Mayer TG, Neblett R, Cohen H, Howard KJ, Choi YH, Williams MJ, et al. The development and psychometric validation of the central sensitization inventory. Pain Pract. 2012;12(4):276–85. pmid:21951710
  48. 48. Harden RN, Weinland SR, Remble TA, Houle TT, Colio S, Steedman S, et al. Medication Quantification Scale Version III: update in medication classes and revised detriment weights by survey of American Pain Society Physicians. J Pain. 2005;6(6):364–71. pmid:15943958
  49. 49. Charlier F, Weber M, Izak D, Harkin E, Magnus M, Lalli J, Fresnais L, Chan M, Markov NO. Am- salem, S. Proost, A. Krasoulis, getzze, and S. Repplinger, “Statannotations,” Oct. 2022.
  50. 50. Kocevska D, Lysen TS, Dotinga A, Koopman-Verhoeff ME, Luijk MPCM, Antypa N, et al. Sleep characteristics across the lifespan in 1.1 million people from the Netherlands, United Kingdom and United States: a systematic review and meta-analysis. Nat Hum Behav. 2021;5(1):113–22. pmid:33199855
  51. 51. Slater JA, Botsis T, Walsh J, King S, Straker LM, Eastwood PR. Assessing sleep using hip and wrist actigraphy. Sleep and Biological Rhythms. 2015;13(2):172–80.
  52. 52. Thapa-Chhetry B, Arguello DJ, John D, Intille S. Detecting sleep and non-wear in 24-hour wrist accelerometer data from the national health and nutrition examination survey. Medicine and science in sports and exercise. 2022;54(11):1936.
  53. 53. Bjurstrom MF, Irwin MR. Polysomnographic characteristics in nonmalignant chronic pain populations: A review of controlled studies. Sleep Med Rev. 2016;2674–86. pmid:26140866
  54. 54. Kurina LM, Thisted RA, Chen J-H, McClintock MK, Waite LJ, Lauderdale DS. Actigraphic sleep characteristics among older Americans. Sleep Health. 2015;1(4):285–92. pmid:28815195
  55. 55. Mork PJ, Nilsson J, Lorås HW, Riva R, Lundberg U, Westgaard RH. Heart rate variability in fibromyalgia patients and healthy controls during non-REM and REM sleep: a case-control study. Scand J Rheumatol. 2013;42(6):505–8. pmid:23425526
  56. 56. Horne JA, Shackell BS. Alpha-like EEG activity in non-REM sleep and the fibromyalgia (fibrositis) syndrome. Electroencephalogr Clin Neurophysiol. 1991;79(4):271–6. pmid:1717231
  57. 57. Shaver JLF, Lentz M, Landis CA, Heitkemper MM, Buchwald DS, Woods NF. Sleep, psychological distress, and stress arousal in women with fibromyalgia. Res Nurs Health. 1997;20(3):247–57.
  58. 58. González JLB, Fernández TVS, Rodríguez LA, Muniz J, Giraldez SL, Fernández AA. Sleep architecture in patients with fibromyalgia. Psicothema. 2011;23(3):368–73.
  59. 59. Matthews KA, Patel SR, Pantesco EJ, Buysse DJ, Kamarck TW, Lee L, et al. Similarities and differences in estimates of sleep duration by polysomnography, actigraphy, diary, and self-reported habitual sleep in a community sample. Sleep Health. 2018;4(1):96–103. pmid:29332687
  60. 60. Barreira TV, Redmond JG, Brutsaert TD, Schuna Jr JM, Mire EF, Katzmarzyk PT, et al. Can an automated sleep detection algorithm for waist-worn accelerometry replace sleep logs?. Appl Physiol Nutr Metab. 2018;43(10):1027–32. pmid:29701486