Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue1134 relyonguider #1135

Closed
wants to merge 3 commits into from
Closed

Issue1134 relyonguider #1135

wants to merge 3 commits into from

Conversation

jhmigueles
Copy link
Collaborator

@jhmigueles jhmigueles commented May 29, 2024

Fixes #1134

This includes a revision of the SPT definition when relyonguider is set to TRUE.

In the original approach, SIB start and end time for the first and last SIB being part of the SPT was modified so that it matched the guider definition. It did not work well at finding the first and last SIB of the SPT. Additionally, this has the challenge that SIB times are modified without keeping track of that, I thought it would be good to leave SIB as they are detected to facilitate methodological research on SPT and SIBs.

In this proposal, when relyonguider = TRUE, it does only affect the SPT definition without modifying the times of the SIBs.

@vincentvanhees
Copy link
Member

Thanks Jairo, I am now also investigating and remember again how I intended relyonguider to work. I think the code is in line with how I intended it. The main problem is that the documentation is not very clear.

If:

  • guider is 11pm - 7am
  • relyonguider = TRUE
  • First sib in the night is at 10:55pm - 11:10pm

then my intention was and is that the final estimate of sleep onset is 11pm and that the sib to be shortened to start at 11pm because only then it correctly contributes to the total sleep duration. We are not only interest in sleep onset and wakeup time, all sleep variables need to align with the definition of sleep onset and wake up time.

If:

  • guider is 11pm - 7am
  • relyonguider = TRUE
  • First sib in the night is at 2:00am - 2:10am

then my intention was and is that the final estimate of sleep onset is 2am, because we still trust the accelerometer more than the guider to tell us the exact timing of sleep onset.

So, the relyonguider parameter is specific to handle sib windows that overlap with the edges of the guider window.

I think it is best not to suddenly change this functionality, but to first improve the documentation. I will open a new PR for this shortly. In that PR I will then also revise the many object names that refer to SPT such as SptWake and SptOnset in g.part4, which should be guider.

@jhmigueles
Copy link
Collaborator Author

Hi Vincent, thanks, so this was a misunderstanding on the functionality of relyonguider. Then, I think the functionality I'm looking for is not facilitated at the moment, correct me if I'm wrong. I got some accelerometer files in which participants wore parallely two accelerometers (wrist + hip). I planned to use the SPT estimates from wrist and apply those exact times to the hip data. As the SIBs are probably less meaningful in hip, I was planning to build a sleeplog with the wrist estimates and apply those to the hip data ignoring completely the SIBs. Can you think of any way for doing this?

@vincentvanhees
Copy link
Member

Can you think of any way for doing this?

You can still do what you plannend but then choose a SIB detection that is too sensitive for hip, e.g. hip HASIB.algo = "vanHees2015" possibly with higher anglethreshold and timethreshold settings, and combine this with relyonguider = TRUE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

relyonguider does not produce expected output
2 participants