skdh.sleep.SleepGiniIndex#

class skdh.sleep.SleepGiniIndex#

Compute the normalized variability of the sleep bouts, also known as the Gini Index from economics.

Methods

predict(lengths, starts, values)

Notes

Gini Index values are bounded between 0 and 1, with values near 1 indicating the total time accumulating due to a small number of longer bouts, whereas values near 0 indicate all bouts contribute more equally to the total time.

References

[1]

J. Di et al., “Patterns of sedentary and active time accumulation are associated with mortality in US adults: The NHANES study,” bioRxiv, p. 182337, Aug. 2017, doi: 10.1101/182337.

predict(lengths, starts, values)#
Parameters:
lengthsnumpy.ndarray

Lengths of bouts.

startsnumpy.ndarray

Indices of bout starts

valuesnumpy.ndarray

Value of the bout.

Returns:
ginifloat

Sleep normalized variability or Gini Index during total sleep opportunity.