Q&A regarding z-angle usage for sleep detection

63 views
Skip to first unread message

Vincent van Hees

unread,
Sep 16, 2020, 4:14:16 AM9/16/20
to R package GGIR
Here is a Q&A I recently had, which I forgot to re-direct to the this GGIR google group. If you have questions about GGIR, please continue using the Google Group. Thanks.

Question:
I'm reaching out because I'm trying to better understand the ANGLE-Z metric that you describe in your 2015's Plos One paper. Specifically, I've seen that the atan() function returns values in half-degrees (from -90 to 90) and I'm a bit confused on how to interpret those with regards to the arm angle. Would it be possible here to use the atan2 function which returns values in the full circle? Related to that, when calculating the 5-sec average arm angles, would it make sense to use a circular mean instead of a standard arithmetic mean? Lastly, is there any value in also looking at the x and y angles for sleep detection?

Answer:
The rolling median of the acceleration signal gives a value between -1 and 1, which indicates the direction of gravity when the sensor, providing that the sensor is not moving vigorously.
A rotation clockwise or counter clockwise from downward to upward orientation will be picked up identically because the angle change relative to gravity is the same. In other words, it measure angle only relative to the direction of gravity and not in a global 360 degree reference frame. Anglez is the angle of the z-axis relative to the horizontal, with 90 and -90 the maximum deviation that can be achieved, corresponding to up or down. Note that all three acceleration axes are used in this equation because that is known to be more accurate, but that does not affect what I just said about the sensitivity. 

Motivation for only using z-angle:
- When I checked I did not see a major difference between x, y, and z angle. From a body movement perspective it is also unlikely that a person keeps one axis perfectly still for a long time while rotating around the other axis.
- One instead of 3 axis is less computations to do for the software.
- Less derived data that needs to be stored inside GGIR.
- Classification is easier to interpret with less variables and less steps.
- Not all accelerometer brands have x and y pointing in the same direction, so using the z-axis only makes the method more re-usable across accelerometer brands.
Thanks,
Vincent

Nishat Akhtar

unread,
Oct 8, 2020, 8:08:48 AM10/8/20
to R package GGIR

Hi,

Is there a way to get activity count from GGIR?
I am using version '2.1.2'.

Vincent van Hees

unread,
Oct 8, 2020, 3:17:17 PM10/8/20
to Nishat Akhtar, R package GGIR
I recommend switching to raw data metrics, a variety of which are available in GGIR. 

However, if your research depends on reproducing Actigraph counts then check out our vignette where we show how you can embed the ActivityCounts package in GGIR: https://cran.r-project.org/web/packages/GGIR/vignettes/ExternalFunction.pdf.

Vincent



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
You received this message because you are subscribed to the Google Groups "R package GGIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.

Nishat Akhtar

unread,
Oct 19, 2020, 6:38:58 AM10/19/20
to R package GGIR
Hi Vincent,

Thanks a million for your help.
You resolved my problem.
Thanks a lot for GGIR too, it is an awesome package.

Kind regards,
Nishat Akhtar
Reply all
Reply to author
Forward
0 new messages