Dear GGIR community,
I recently updated my GGIR code, and in doing so changed the sleep detection algorithm to HDCZA. I had previously been using L5+/-12 (LEGACY ALGORITHM) by specifying def.noc.sleep = c(), but decided to change to HDCZA because the GIGR sleep page says "Disclaimer: This legacy algorithm was used in publications and therefore kept inside GGIR. As performance is expected to be less than other available algorithm, we do not recommend using it."
However, I noticed that my sleep outputs using the HDCZA algorithm are completely off! I then reran everything all over again using my newly written code, but changing only the HDCZA algorithm back to legacy algorithm, and sleep outputs look totally fine, so I do know the difference was caused by the HDCZA algorithm.
The sleep outputs using the HDCZA algorithm are odd in that the sleep period time windows are extremely small in many cases (less than 3 hours, even some nights less than 1 hour). In some cases, the SleepDurationinSpt is longer than the SPT window, resulting in sleep efficiency larger than 1. My participants are older adults, and it makes no sense to me why there are so many nights where they would sleep so little. Moreover, very obvious correlations that should exist between circadian variables (intradaily variability) and sleep (efficiency) were not significant, so this does lead me to believe that the sleep outputs are off.
For now I have reverted back to using the legacy algorithm, but if the HDCZA algorithm is better, I would like to move towards using it. I am not sure if I am implementing the code wrong?
Attached is my GGIR code with the HDZCA algorithm, and the part 4 person and night summaries. Please let me know if you have any insights on if I implemented the HDCZA algorithm wrong, or why the sleep outputs may look as they do. When you sort by SptDuration, you can see how small some of the windows are.
R version 4.4.2 (2024-10-31)
GGIR version 3.1-5
Thank you in advance for your help!
All my best,
Joanna