pyhctsa.operations.scaling.higuchi_fd¶
-
pyhctsa.operations.scaling.higuchi_fd(y, kmax=
None, tau=1)¶ Higuchi’s fractal dimension of a time series.
Estimates the fractal dimension of the time series’ waveform (its graph in the (index,value) plane) via Higuchi’s curve-length method: at each scale k, the series is split into k interleaved subsequences, each subsequence’s normalized curve length is measured, and the k lengths are averaged to give L(k). The fractal dimension is (minus) the slope of log(L(k)) against log(1/k).
A scale k at which the curve has no length is left out of the fit: one whose mean absolute k-step increment is at most 1e-9 of the scale of the series (the larger of its standard deviation and mean absolute value), i.e. zero up to rounding, as when the series is periodic with a period that divides k. (The logarithm of a length at the rounding level would be set by rounding noise alone.) Fewer than five remaining scales give NaN.
References
- Parameters:¶
- y : array-like¶
The input time series.
- kmax : int, optional¶
The maximum interleaving scale to include in the fit (default: a small, fixed value – see Notes above for why a large kmax is actively harmful, not just unnecessary).
- tau : int or str, optional¶
The unit of scale, in samples: an integer, or a rule for
get_tau()(e.g.'ac1e'). The scales arek = j * tauforj = 1, ..., kmax, and each curve length is normalized as for a series sampled everytausamples, so the fit is againstlog(1/j). At every scale allkstarting offsets are used, so this pools the curve lengths of thetauphases of the series decimated bytau(rather than using one phase). Default 1 (Higuchi’s method). All outputs are NaN when a rule cannot set the delay.
- Returns:¶
The fitted (Higuchi) log-log slope and diagnostics of the linear fit’s quality.
- Return type:¶
dict