pyhctsa.operations.correlation.crinkle_statistic

pyhctsa.operations.correlation.crinkle_statistic(y, tau=1)

Crinkle statistic: normalized fourth moment of the second difference.

With \(\tilde{x} = x - \bar{x}\),

\[C = \frac{\langle (\tilde{x}_{t-1} - 2\tilde{x}_t + \tilde{x}_{t+1})^4 \rangle} {\langle \tilde{x}_t^2 \rangle^{2}},\]

where the numerator averages over the \(N - 2\) interior points and the denominator over all \(N\) samples. Statistic as used in D. Kaplan’s code (hctsa DK_crinkle), where it is credited to J. Theiler.

Parameters:
y : array-like

The input time series.

tau : int or str, optional

The step of the second difference, in samples: an integer, or a rule for get_tau() (e.g. 'ac1e'). The numerator then averages \(( ilde{x}_{t- au} - 2 ilde{x}_t + ilde{x}_{t+ au})^4\) over every interior point, which pools the tau phases of the series sampled every tau samples. Default 1. NaN when a rule cannot set the delay.

Returns:

The crinkle statistic (NaN if the series is constant or has fewer than 2 tau + 1 samples, where it is undefined).

Return type:

float

Notes

With \(\Delta^2 \tilde{x}_t = \tilde{x}_{t-1} - 2\tilde{x}_t + \tilde{x}_{t+1}\), C factors exactly as the kurtosis of \(\Delta^2 \tilde{x}\) times \((\langle (\Delta^2 \tilde{x})^2 \rangle / \langle \tilde{x}^2 \rangle)^2\). For a stationary process the ratio tends to \(6 - 8\rho_1 + 2\rho_2\), with \(\rho_k\) the lag-k autocorrelation, so C responds to the lag-1 and lag-2 autocorrelation and to the value distribution, not only to spikes in the curvature. crinkle_statistic_kurtosis() is a variant without these dependences.

No published definition of the statistic is known. Theiler et al. [1] define the companion skewed-difference statistic theiler_q() and name higher moments as a class of discriminating statistic for surrogate-data tests, but not this one. A plausible origin is as a check for the spurious high-frequency “crinkliness” of Fourier surrogates of data whose end points do not match [2], which a fourth moment of the second difference detects.

References