skdh.sleep.WakePowerLawDistribution#

class skdh.sleep.WakePowerLawDistribution#

Compute the scaling factor for a power law distribution over the awake bouts lengths.

Methods

predict(lengths, starts, values)

Notes

Larger alpha values indicate that the total awake time is accumulated with a larger portion of shorter awake bouts.

The power law scaling factor is computer per [1]:

\[1 + \frac{n_{awake}}{\sum_{i}\log{t_i / \left(min(t) - 0.5\right)}}\]

where \(n_{awake}\) is the number of awake bouts, \(t_i\) is the duration of the \(ith\) awake bout, and \(min(t)\) is the length of the shortest awake bout.

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:
alphafloat

Awake bout power law distribution scaling parameter.