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

The input time series.

q : Union[float, int], optional

The parameter in the fluctuation function. q = 2 (default) 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]

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

k : int, optional

polynomial order of detrending (for ‘dfa’ & ‘rsrangefit’)

lag : int or None, optional

optional time-lag, as in Alvarez-Ramirez [3]

log_inc : bool, optional

whether to use logarithmic increments in tau (it should be logarithmic)

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