pyhctsa.operations.correlation.crinkle_statistic_kurtosis¶
-
pyhctsa.operations.correlation.crinkle_statistic_kurtosis(y, gaussian_rank=
True, tau=1)¶ Excess kurtosis of the second difference: the spikiness of a series’ curvature.
A variant of
crinkle_statistic()[1] that keeps only its kurtosis factor. With \(\Delta^2 x_t = x_{t-1} - 2 x_t + x_{t+1}\), the crinkle statistic factorises as\[C = \frac{\langle (\Delta^2 x)^4 \rangle}{\langle x^2 \rangle^2} = \underbrace{\frac{\langle (\Delta^2 x)^4 \rangle}{\langle (\Delta^2 x)^2 \rangle^2}}_{\mathrm{kurt}(\Delta^2 x)} \times \left(\frac{\langle (\Delta^2 x)^2 \rangle}{\langle x^2 \rangle}\right)^2,\]where the second factor tends to \((6 - 8\rho_1 + 2\rho_2)^2\) for a stationary process with autocorrelations \(\rho_k\), a linear quantity. This feature drops it and returns
\[K = \frac{\langle (\Delta^2 g - \overline{\Delta^2 g})^4 \rangle} {\langle (\Delta^2 g - \overline{\Delta^2 g})^2 \rangle^2} - 3,\]where \(g\) is the series mapped onto Gaussian ranks (each value replaced by \(\Phi^{-1}((r - 1/2)/N)\), \(r\) its rank, then z-scored), or the input series itself if
gaussian_rank=False. For a Gaussian process \(K \to 0\) whatever its autocorrelation; positive values mean that the curvature has heavier tails (rare sharp kinks) than a Gaussian process with the same spectrum. The rank transform removes the contribution of the marginal distribution (without it, iid data with excess kurtosis \(\kappa\) give \(K = \kappa / 2\)). The value also varies with the timescale of the series; a second difference at the series’ own correlation time (tau = 'ac1e') reduces this.The crinkle statistic comes from D. Kaplan’s code for nonlinear time-series analysis [1], where it is credited to J. Theiler; no published definition is known. Theiler et al. [3] define the companion statistic
theiler_q()from the same code and name higher moments as discriminating statistics for surrogate-data tests. Independently, the kurtosis (flatness) of second differences is used in turbulence as a measure of intermittency, computed as a function of lag, where second rather than first differences are needed for a smooth signal [2]. This variant takes that quantity at lag 1 on Gaussian ranks, so that its expectation is zero for any Gaussian process and any strictly increasing transform of one, which makes it a statistic of nonlinear structure in the curvature.- Parameters:¶
- y : array-like¶
The input time series.
- gaussian_rank : bool, optional¶
Compute the statistic on the Gaussian ranks of the series (default True), so that it depends on the data only through their ranks (unchanged by strictly increasing transformations). If False, the input is used as given (mean-removed), and the value also reflects the marginal distribution.
- tau : int or str, optional¶
The step of the second difference, \(g_{t-\tau} - 2 g_t + g_{t+\tau}\) over every interior point: an integer, or a rule for
get_tau()(e.g.'ac1e') applied to the analysed series (the Gaussian ranks, withgaussian_rank), so that the result stays rank-invariant. Default 1. NaN when a rule cannot set the delay.
- Returns:¶
The excess kurtosis of the second difference (NaN for fewer than five samples, where the kurtosis of the two or fewer second differences takes a single value, and for a constant series or one whose second difference is constant).
- Return type:¶
float
References