pyActigraphy.analysis.Fractal.fluctuations¶
- classmethod Fractal.fluctuations(X, n, deg, overlap=False, exclude_segment_with_nans=False, nan_frac=0)[source]¶
Fluctuation function
The fluctuations are defined as the mean squared residuals of the least squares fit in each non-overlapping window.
- Parameters:
X (numpy.array) – Array of activity counts.
n (int) – Window size.
deg (int) – Degree(s) of the fitting polynomials.
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.
- Returns:
F – Array of mean squared residuals in each segment.
- Return type:
numpy.array