pyActigraphy.io.BaseRaw.CK

BaseRaw.CK(settings='30sec_max_non_overlap', threshold=1.0, rescoring=True)

Cole&Kripke algorithm for sleep-wake identification.

Algorithm for automatic sleep scoring based on wrist activity, developped by Cole, Kripke et al [1].

Parameters:
  • settings (str, optional) –

    Data reduction settings for which the optimal parameters have been derived. Available settings are:

    • ”mean”: mean activity per minute

    • ”10sec_max_overlap”: maximum 10-second overlapping epoch per minute

    • ”10sec_max_non_overlap”: maximum 10-second nonoverlapping epoch per minute

    • ”30sec_max_non_overlap”: maximum 30-second nonoverlapping epoch per minute

    Default is “30sec_max_non_overlap”.

  • threshold (float, optional) – Threshold value for scoring sleep/wake. Default is 1.0.

  • rescoring (bool, optional) – If set to True, Webster’s rescoring rules are applied [2]. Default is True.

Returns:

ck – Time series containing the D scores (0: sleep, 1: wake) for each epoch.

Return type:

pandas.core.Series

Notes

The output variable D of the CK algorithm is defined in [1] as:

\[D = P*( [W_{-4},\dots,W_{0},\dots,W_{+2}] \cdot [A_{-4},\dots,A_{0},\dots,A_{+2}])\]

with:

  • D < 1 == sleep, D >= 1 == wake;

  • P, scale factor;

  • \(W_{0},W_{-1},W_{+1},\dots\), weighting factors for the present minute, the previous minute, the following minute, etc.;

  • \(A_{0},A_{-1},A_{+1},\dots\), activity scores for the present minute, the previous minute, the following minute, etc.

Warning

This algorithm yields scores with a period of 1 minute. Therefore, the time series returned by the CK function has a 1-min period. In the original paper, this algorithm is validated for devices configured in “zero-crossing mode”.

Webster’s rescoring rules [2]:

  1. After at least 4 minutes scored as wake, the next 1 minute scored as sleep is rescored as wake

  2. After at least 10 minutes scored as wake, the next 3 minutes scored as sleep are rescored as wake;

  3. After at least 15 minutes scored as wake, the next 4 minutes scored as sleep are rescored as wake;

  4. If a period of 6 minutes or less that is scored as sleep is surrounded by at least 15 minutes scored as wake, then rescore to wake;

  5. If a period of 10 minutes or less that is scored as sleep is surrounded by at least 20 minutes scored as wake, then rescore to wake.

References

[1] (1,2)

Cole, R. J., Kripke, D. F., Gruen, W., Mullaney, D. J., & Gillin, J. C. (1992). Automatic Sleep/Wake Identification From Wrist Activity. Sleep, 15(5), 461–469. http://doi.org/10.1093/sleep/15.5.461

[2] (1,2)

Webster, J. B., Kripke, D. F., Messin, S., Mullaney, D. J., & Wyborney, G. (1982). An Activity-Based Sleep Monitor System for Ambulatory Use. Sleep, 5(4), 389–399. https://doi.org/10.1093/sleep/5.4.389

Examples