pyActigraphy.metrics.MetricsMixin.ISp

MetricsMixin.ISp(period='7D', freq='1H', binarize=True, threshold=4, verbose=False)[source]

Interdaily stability per period

The IS is calculated for each consecutive period found in the actigraphy recording.

Parameters
  • period (str, optional) – Time period for the calculation of IS Default is ‘7D’.

  • freq (str, optional) – Data resampling frequency string. Default is ‘1H’.

  • binarize (bool, optional) – If set to True, the data are binarized. Default is True.

  • threshold (int, optional) – If binarize is set to True, data above this threshold are set to 1 and to 0 otherwise. Default is 4.

  • verbose (bool, optional) – If set to True, display the number of periods found in the activity recording, as well as the time not accounted for. Default is False.

Returns

isp

Return type

list of float

Notes

Periods are consecutive and all of the required duration. If the last consecutive period is shorter than required, the IS is not calculated for that period.

Examples

>>> import pyActigraphy
>>> rawAWD = pyActigraphy.io.read_raw_awd(fpath + 'SUBJECT_01.AWD')
>>> rawAWD.duration()
Timedelta('12 days 18:41:00')
>>> rawAWD.ISp(period='5D',verbose=True)
Number of periods: 2
Time unaccounted for: 2 days, 19h, 0m, 0s
[0.7565263007902066, 0.866544730769211]