pyhctsa.operations.scaling.fluctuation_analysis¶
-
pyhctsa.operations.scaling.fluctuation_analysis(x, q=
2, wtf='rsrange', tau_step=1, k=1, lag=None, log_inc=True)¶ Implements fluctuation analysis by a variety of methods.
Much of our implementation is based on the well-explained discussion of scaling methods [1].
The main difference between algorithms for estimating scaling exponents amount to differences in how fluctuations, F, are quantified in time-series segments. Many alternatives are implemented in this function.
References
- Parameters:¶
- x : array-like¶
The input time series.
- q : Union[float, int], optional¶
The parameter in the fluctuation function. The default is q = 2 which gives RMS fluctuations.
- wtf : str, optional¶
What to fluctuate. Options are:
’endptdiff’: Calculates the differences in end points in each segment
’range’: Calculates the range in each segment
’std’: Takes the standard deviation in each segment [1]
’iqr’: Takes the interquartile range in each segment
’dfa’: Removes a polynomial trend of order k in each segment
’rsrange’: Returns the range after removing a straight line fit [2]
’rsrangefit’: Fits a polynomial of order k and returns the range [2]
Default is
'rsrange'.For ‘rsrangefit’, an optional timelag can be applied for computing the cumulative sum (integrated profile) [3].
- tau_step : int, optional¶
Number of tau (locInc true), or increments in tau for linear range. Default is 1.
- k : int, optional¶
Polynomial order of detrending (for ‘dfa’ & ‘rsrangefit’). Default is 1.
- lag : int or None, optional¶
Optional time-lag, as in Alvarez-Ramirez [3]. Default is None.
- log_inc : bool, optional¶
Whether to use logarithmic increments in tau (it should be logarithmic). Default is True.
- Returns:¶
Statistics of fitting a linear function to a plot of log(F) as a function of log(tau), and for fitting two straight lines to the same data, choosing the split point at tau = tau_{split} as that which minimizes the combined fitting errors.
- Return type:¶
dict