Estimating sleep parameters using an accelerometer without sleep diary

Wrist worn raw-data accelerometers are used increasingly in large-scale population research. We examined whether sleep parameters can be estimated from these data in the absence of sleep diaries. Our heuristic algorithm uses the variance in estimated z-axis angle and makes basic assumptions about sleep interruptions. Detected sleep period time window (SPT-window) was compared against sleep diary in 3752 participants (range = 60–82 years) and polysomnography in sleep clinic patients (N = 28) and in healthy good sleepers (N = 22). The SPT-window derived from the algorithm was 10.9 and 2.9 minutes longer compared with sleep diary in men and women, respectively. Mean C-statistic to detect the SPT-window compared to polysomnography was 0.86 and 0.83 in clinic-based and healthy sleepers, respectively. We demonstrated the accuracy of our algorithm to detect the SPT-window. The value of this algorithm lies in studies such as UK Biobank where a sleep diary was not used.


Sensitivity analysis Methods
In this supplement we present the findings from our sensitivity analysis on the HDCZA algorithm parameter configuration. To evaluate the performance of a parameter configuration we used mean absolute error (MAE) of the onset and waking up time, because it is a single number that captures both bias and variance in error. The sensitivity analysis was run on the four main parameters in the algorithm, being the 10th percentile (step 6), the factor 15 (step 6), the 30 minutes (step 7), and the 60 minutes (step 8). Considering the large search space, any choice of alternative parameters would seem arbitrary.
In machine learning a random search is considered an acceptable way to optimize parameter configurations if there is little knowledge about the shape of the search space. Therefore, we created thirty random parameter configurations sampled uniformly from plausible value ranges that include the existing values. The search space we explored is: • Percentile: uniform distribution between 5th and 15th percentile.
• Short time block: uniform distribution between 15 minutes and 45 minutes.
• Long time block: uniform distribution between 30 and 90 minutes.
The sensitivity analysis was replicated in each of the four full datasets: Sleep diary (Whitehall II Study), sleep clinic PSG left wrist (Newcastle), sleep clinic PSG right wrist (Newcastle), and the healthy good sleepers PSG (Pennsylvanian).

Results
The default algorithm configuration ranked 5 th , 10 th , 13 th , and 16 th in respectively the study with sleep diary, -sleep clinic PSG left wrist, sleep clinic PSG right wrist, and healthy good sleepers PSG, see Figures S1-S4. The average and standard deviation of the MAE estimates across the four study conditions are shown in Figure S5. For parameter configurations #8, one of the few configurations that outperformed the default configuration for the HDCZA algorithm we replicated the tables as represented in the main manuscript, see table S2-S5. Parameter configuration #8 entails: percentile = 0.12, threshold = 12; short block =31 minutes, and long block = 73 minutes.

Discussion/Conclusion
The sensitivty analysis indicates that improvement of the configuration within specific study conditions is possible. However, across the four study conditions the current default parameter configuration provides a relatively low (good) average and variation (robust) in MAE compared with other parameter configurations. The best configuration for the sleep clinic PSG study rigth wrist (#20 in Figure S3) is the one-but worst configuration when compared with sleep diaries (#20 in Figure S1), demonstrating the risk of overfitting. When inspecting one of the few parameter configurations (#8) that outperforms the default configuration based on average MAE in figure S5 we observed a few things: The configuration #8 provides similar associations with sleep diary (tables S2 and S3) and polysomnography in healthy good sleepers (table S5), but MAE are lower compared polysomnography in sleep clinic patients (table S4).
Further, it can be observed that the C-statistic, the accuracy and the sensitivity have wider inter quartile ranges in the sleep clinic data (compare table S4 with table 4 in manuscript), indicating that better average MAE can come at the cost of less robust performance on other performance metrics. Figure S1: MAE of the HDCZA algorithm against sleep diary per parameter configuration (default configuration encircled with red) The figure represents MAE of HDCZA algorithm against sleep diary (Whitehall II Study) based on 30 random parameter settings sorted based on their MAE. The parameter setting numbered 0 corresponds to the default configuration (encircled with red).

Figure S2: MAE of the HDCZA algorithm against sleep clinic PSG left wrist per parameter configuration (default configuration encircled with red)
The figure represents MAE of HDCZA algorithm against sleep clinic PSG left wrist (Newcastle) based on 30 random parameter settings sorted based on their MAE. The parameter setting numbered 0 corresponds to the default configuration (encircled with red). Figure S4: MAE of the HDCZA algorithm against PSG non-dominant wrist in healthy good sleepers per parameter configuration (default configuration encircled with red) Deviation; AIC = Akaike information coefficient, * P < .005, ** P < .0005]