pyhctsa.operations.correlation.autocorr_x2_shape

pyhctsa.operations.correlation.autocorr_x2_shape(y, max_lag='double_drown')

Shape of the time-reversibility profile of a time series.

autocorr_x2() computes two asymmetric, ‘leverage’-type lag-profiles:

\[ \begin{align}\begin{aligned}\text{forward}(\tau) = \langle x_t\, x_{t+\tau}^2 \rangle \quad\text{(signed value now, energy later)}\\\text{backward}(\tau) = \langle x_t^2\, x_{t+\tau} \rangle \quad\text{(energy now, signed value later)}\end{aligned}\end{align} \]

For a time-reversible process these coincide at every lag (any shared linear correlation structure contributes equally to both); a systematic difference, \(\text{diff}(\tau) = \text{forward}(\tau) - \text{backward}(\tau)\), is therefore a lag-resolved time-irreversibility statistic, generalizing the single-lag trev/tc3-style statistics to a full profile, cf. the leverage-effect correlation function of [1].

This function characterizes the shape of \(\text{diff}(\tau)\) across lags – its decay, persistence, and extrema – mirroring how autocorr_shape() characterizes the shape of the ordinary ACF.

References

Parameters:
y : array-like

The input time series (should be z-scored: zero mean, unit variance).

max_lag : int or str, optional

The maximum lag to compute the profile up to.

  • If an int, a positive maximum lag.

  • If "double_drown", uses twice the first zero-crossing of the ordinary (linear) autocorrelation function (cf. the 'double_drown' option of autocorr_shape()), bounded to lie in [10, floor(N/4)].

Default is 'double_drown'.

Returns:

Statistics on the shape of the forward-minus-backward difference profile, including its lag-1 value, basic summaries, centroid decay timescale, self-autocorrelation, local extrema, first sign change, the correlation between the forward and backward profiles, and the maximum lag used. All fields are NaN if the profile is too short or ill-defined.

Return type:

dict