pyActigraphy.analysis.Fractal.dfa_parallel

classmethod Fractal.dfa_parallel(ts, n_array, deg=1, overlap=False, exclude_segment_with_nans=False, nan_frac=0, log=False, n_jobs=2, prefer=None, verbose=0)[source]

Detrended Fluctuation Analysis function

Compute, in parallel, the q-th order mean squared fluctuations for different segment lengths.

Parameters:
  • ts (pandas.Series) – Input signal.

  • n_array (array of int) – Time scales (i.e window sizes). In minutes.

  • deg (int, optional) – Degree(s) of the fitting polynomials. Default is 1.

  • overlap (bool, optional) – If set to True, consecutive windows during segmentation overlap by 50%. Default is False.

  • exclude_segment_with_nans (bool, optional) – If set to True, segments containing a NaN fraction equal or greater than nan_frac are excluded. Default is False.

  • nan_frac (float, optional) – Threshold on the maximal fraction of NaN in the returned segments. Default is 0.

  • log (bool, optional) – If set to True, returned values are log-transformed. Default is False.

  • n_jobs (int, optional) – Number of CPU to use for parallel fitting. Default is 2.

  • prefer (str, optional) – Soft hint to choose the default backend. Supported option:’processes’, ‘threads’. See joblib package documentation for more info. Default is None.

  • verbose (int, optional) – Display a progress meter if set to a value > 0. Default is 0.

Returns:

q_th_order_msq_fluc – Array of q-th order mean squared fluctuations.

Return type:

numpy.array