New guider algorithm specifically for ActivPAL data - #1534
Conversation
…re_thigh_based_guider
jhmigueles
left a comment
There was a problem hiding this comment.
I don't have an ActivPAL dataset available to test this functionality myself, so it would be useful to have a test for this new guider to ensure consistency and test the functioning of the guider over real or simulated data. Other than this, I only have some minor comments, mainly related to documentation.
| This algorithm was developed for ActivPAL data where night/sleep behaviour is represented by an accelerometer that falls asleep. As a result, the sleep periods are characterised by the zero acceleration as imputed whereas the acceleration during waking hours is represented by sensor noise. | ||
|
|
||
| The guider detects this by first deriving a 5 minute rolling average of the acceleration values and then detecting when the resulting acceleration is less than a threshold as specified with parameter \code{LowAcc_threshold}. | ||
|
|
There was a problem hiding this comment.
Should the documentation motivate the default value of LowAcc? Since this is based on acceleration and not on angle variability, I assume the threshold would depend heavily on the metric chosen. Is this 0.014 supported for ENMO and should this be changed if a different metric is being used?
Also here, it would be convenient commenting that this threshold is applied over the metric selected with parameter acc.metric.
There was a problem hiding this comment.
Agree, it needs to be clear that the expected metric is MAD, and the threshold was empirically chosen based on example data from ActivPAL.
ENMO is not informative when working with ActivPAL's that fall asleep during the night, because the autocalibration does not work well in such recordings. This is why I would recommend MAD as acceleration metric.
|
|
||
| ### Guider: LowAcc (EXPERIMENTAL) | ||
|
|
||
| This algorithm was developed for ActivPAL data where night/sleep behaviour is represented by an accelerometer that falls asleep. As a result, the sleep periods are characterised by the zero acceleration as imputed whereas the acceleration during waking hours is represented by sensor noise. |
There was a problem hiding this comment.
Just reading at the rationale for this guider, if the ActivPAL falls aslee during night, I would expect that this period is captured as non-wear and then, the NotWorn algorithm would do a good job at identifying the guider window. Should it be motivated why the NotWorn algorithm is not useful in this case and there is a need of this new guider algorithm?
There was a problem hiding this comment.
I prefer this to be discussed in a paper and not in the documentation, because that is the most logical place to justify added value. This is also the reason why we have EXPERIMENTAL in the header of each guider that has not been described in the literature yet.
There was a problem hiding this comment.
On second thought, it may help to already provide a little bit of motivation: I have now added "The reason we consider LowAcc instead of NonWorn for thigh-worn ActivPAL data is that non-wear is more difficult to detect in this setting: The high moves less while being awake compare with the wrist and ActivPAL sensors we found to come with a higher level of noise, complicating an accurate distinction between non-wear and inactivity."
| | guider_cor_meme_min_hrs | 3 | params_sleep | | ||
| | guider_cor_do | 3 | params_sleep | | ||
| | guider_cor_meme_min_dys | 3 | params_sleep | | ||
| | HDCZA_roll_windowsize | 3 | params_sleep | |
There was a problem hiding this comment.
Is there a reason for making this parameter configurable? I don't have anything against it, just thinking if the motivation for this change should be documented anywhere.
There was a problem hiding this comment.
Actually not, I added it as part of exploring possible ways to optimise the algorithm, but in the end did not use it.
I agree that it may be good to keep it anyway. It was already documented as a parameter and I have now also updated the changelog to highlight this as a new parameter.
…loading this file.
…ent as it depends on ability to download
The ActivPAL files I have been working with are just csv, read with read.myacc.csv. I have now added a simple test inside test_HASPT.R. The rest of the pipeline is already covered by tests for read.myacc.csv. |
…tions or on CRAN.
Add new guider specifically designed for ActivPAL data.
The ActivPALs used in my clients dataset tend to fall asleep when the person is sleeping, by which timegaps can be used to inference sleep.
Skip movisens tests on CRAN and GitHub Actions, because they depend on downloading test data which is no longer facilitated.
Fixes #1287
Checklist before merging:
inst/NEWS.Rdwith a user-readable summary. Please, include references to relevant issues or PR discussions.DESCRIPTION,zenodo.json, andinst/CITATIONfiles.If NEW GGIR parameter(s) were added then these NEW parameter(s) are:
man/GGIR.RdR/load_params.RR/check_params.Rvignettes/GGIRParameters.Rmdwith references to the GGIR parts the parameter is used in.If GGIR parameter(s) were deprecated these parameter(s) are:
man/GGIR.RdR/load_params.RR/check_params.Rvignettes/GGIRParameters.RmdR/extract_params.Rwith deprecated parameters such that these do not produce warnings when found in old config.csv files.