childmindresearch / wristpy

https://childmindresearch.github.io/wristpy/
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Task: Build SleepDetection algorithm. #40

Closed ReinderVosDeWael closed 1 month ago

ReinderVosDeWael commented 3 months ago

Description

The goal of this task is to build in the main GGIR sleep detection algorithm. The class should be built to allow for the implementation of more algorithms, but those are beyond the scope of this PR.

Tasks

Freeform Notes

Given the complexity of the GGIR algorithm (https://github.com/wadpac/GGIR/blob/master/R/g.part4.R), the exact implementation should be considered flexible.

Asanto32 commented 2 months ago

GGIR sleep detection implements two default algorithms for sleep detection (generally speaking, and simplified, this can be broken down as follows):

  1. The Heuristic algorithm looking at Distribution of Change in Z-Angle (HDCZA) algorithm to find the SPT-window (reference.
    1. Finding SIB (sustained inactivity bouts) within the SPT-window reference.

The sleep onset-wakeup times are defined by the start of the first SIB that overlaps with the SPT window and the end of the last SIB that overlaps with the SPT window.

Asanto32 commented 2 months ago

Some questions for the next meeting (writing as I come across them):