gastropy.coupling_zscore

gastropy.coupling_zscore#

gastropy.coupling_zscore(empirical_plv, surrogate_plv)[source]#

Compute z-scored coupling strength (empirical vs. surrogate).

When surrogate_plv is a scalar or same shape as empirical_plv (from stat="median"), returns the simple difference. When surrogate_plv is a full distribution (from stat="all"), returns a proper z-score.

Parameters:
  • empirical_plv (float or np.ndarray) – Empirical PLV value(s).

  • surrogate_plv (float or np.ndarray) – Surrogate PLV value(s). If 2D with shape (n_surrogates, ...), z-score is computed across the first axis.

Returns:

z – Z-scored coupling strength. Positive values indicate stronger coupling than expected by chance.

Return type:

float or np.ndarray

Examples

>>> coupling_zscore(0.3, 0.15)
0.15