MAD is the mean absolute deviation of the tri-axial acceleration vector
magnitude about its (per-epoch) mean (Vaha-Ypya et al. 2015): for each epoch,
\({\rm MAD} = \frac{1}{n}\sum_i |r_i - \bar r|\), where
\(r_i = \sqrt{x_i^2 + y_i^2 + z_i^2}\) is the sample vector magnitude and
\(\bar r\) its epoch mean. It is a gravity-robust movement-intensity metric
complementary to computeENMO: MAD captures the amount of
variation in the magnitude within an epoch (so it is insensitive to a
static orientation offset), whereas ENMO captures its elevation above
1 g. When an epoch length is given, per-epoch MAD is returned; otherwise a
single whole-signal MAD.
Usage
computeMAD(accel, sampling_rate = NULL, epoch_sec = NULL, unit = c("g", "mg"))