pyhctsa.operations.correlation.reversibility_scan¶
-
pyhctsa.operations.correlation.reversibility_scan(y, i=
2, j=1, max_lag=20)¶ Time-reversal asymmetry of a generalised lagged moment, scanned over lags.
For a time-reversible process the joint law of \((x_t, x_{t-k})\) is symmetric under exchange of its two arguments, so every symmetric bicovariance difference
\[\gamma_{i,j}(k) = E[x_t^i\, x_{t-k}^j] - E[x_t^j\, x_{t-k}^i]\]is zero. Ramsey and Rothman [1] define \(\gamma_{i,j}\) for general \((i, j)\) and base a test of time reversibility on \((i, j) = (2, 1)\); for a stationary series \(-3\gamma_{2,1}(k)\) is the numerator of
trev()at lag \(k\). Higher orders detect asymmetries that are invisible at third order: \((3, 1)\) responds to a lag-\(k\) joint law whose moments up to third order are all symmetric. Chen, Chou and Kuan [2] give a related test based on the characteristic function.The statistic is computed on the Gaussian ranks of the series (each value replaced by the standard-normal quantile of its rank; see
crinkle_statistic_kurtosis()), so that it does not depend on the marginal distribution and the higher moments are not dominated by the tails. At each lag \(k = 1, ..., K\), with \(K = \min(\)max_lag\(, \lfloor N/4 \rfloor)\), the sample mean of \(s_t = g_t^i g_{t-k}^j - g_t^j g_{t-k}^i\) is divided by its heteroscedasticity- and autocorrelation-consistent standard error (the flat-top estimator oftrev_studentized(), with bandwidth at least \(k\)) [3], [4], giving a statistic \(T_k\) that is approximately standard normal for a reversible process. The outputs summarise \(T_k\) over the lags.- Parameters:¶
- y : array-like¶
Input time series.
- i : int, optional¶
The powers of the two factors, positive and distinct. Default is (2, 1).
- j : int, optional¶
The powers of the two factors, positive and distinct. Default is (2, 1).
- max_lag : int, optional¶
Largest lag scanned, further limited to a quarter of the series length. Default is 20.
- Returns:¶
‘max_abs_z’: the largest \(|T_k|\).
’peak_z’: \(T_k\) at that lag, signed: it changes sign when the series is reversed in time; for (2, 1) it has the opposite sign to
trev()(negative when increases are sharper than decreases).’peak_lag’: the lag at which it occurs.
’sumsq_z’: \((\sum_k T_k^2 - K)/\sqrt{2K}\), an approximate z-score of the asymmetry over all lags (approximate because the \(T_k\) at nearby lags are correlated).
All NaN if the series has fewer than four samples or all its values are tied.
- Return type:¶
dict
References