pyhctsa.operations.correlation.trev_studentized¶
-
pyhctsa.operations.correlation.trev_studentized(y, tau=
'ac')¶ Studentised time-reversal asymmetry: the trev numerator divided by its HAC standard error.
A variant of
trev()[1] whose value is a signal-to-noise ratio. On reversible data the magnitude outputs oftrev()measure the noise of a zero-mean estimator, which depends on the marginal distribution and the autocorrelation; dividing by a heteroscedasticity- and autocorrelation-consistent (HAC) standard error [3] removes that dependence:\[T = \frac{\bar{s}}{\sqrt{\hat{\sigma}^2_{\mathrm{LR}} / n}}, \qquad \hat{\sigma}^2_{\mathrm{LR}} = \hat{\gamma}_0 + 2 \sum_{k=1}^{2M} w(k/M)\, \hat{\gamma}_k, \qquad w(u) = \min(1, \max(0, 2 - u)),\]where \(s_t = d_t^3\) with \(d_t = x_{t+\tau} - x_t\) (\(n\) values), \(\bar{s}\) is their mean and \(\hat{\gamma}_k = \frac{1}{n}\sum_t (s_t - \bar{s})(s_{t+k} - \bar{s})\) their sample autocovariances. The weights are the flat-top (trapezoidal) kernel of Politis and Romano [2], which keeps the autocovariances at lags up to \(M\) unshrunk (a Bartlett kernel leaves the statistic undersized by a factor that depends on the process). The bandwidth is \(M = \max(\tau, \lfloor L_{NW}/2 \rfloor + 1, 2\tau_{1/e})\), with \(L_{NW} = \lfloor 4 (n/100)^{2/9} \rfloor\) the usual Newey-West rule and \(\tau_{1/e}\) the series’ ‘ac1e’ delay (
get_tau()), since overlapping increments are correlated up to lag \(\tau - 1\) and the cubed increments of a persistent series stay correlated over about twice its correlation time. \(M\) is capped at \((n - 1)/2\), and the long-run variance is floored at 0.05 times the (always non-negative) Bartlett estimate with \(2M\) lags, since the flat-top estimate can be near zero or negative.For a reversible process \(T\) is approximately standard normal. Its sign is that of the asymmetry, as in
trev()(positive when increases are sharper than decreases). \(T\) is invariant to the scale of the data and changes sign when the series is reversed in time.For a stationary series the numerator of
trev()is three times the difference of bicovariances \(\langle x_t^2 x_{t+\tau} \rangle - \langle x_t x_{t+\tau}^2 \rangle\), which Ramsey and Rothman [4] standardise into a test of time reversibility; this variant standardises the cubed-increment form with a HAC standard error.- Parameters:¶
- Returns:¶
The studentised statistic \(T\) (NaN if the delay cannot be set, if there are fewer than three lag-tau increments, or if the cubed increments are constant).
- Return type:¶
float
References