dirconn.baseline_normalise#

dirconn.baseline_normalise(estimator: Estimator, active: TimeSeries, baseline: TimeSeries, *, how: str = 'difference', n_boot: int | None = None, seed: int | None = None, block_size: int | None = None, reduce: Callable[[Connectivity], Connectivity] | str | Sequence[float] | None = None) → Connectivity#

Express the connectivity of active relative to that of baseline.

All variants work on magnitudes, so the result is real; undefined cells stay NaN.

Parameters:
  • estimator (Estimator) – Applied to both datasets with the same settings.

  • active (TimeSeries) – Same channels and sampling frequency. The lengths may differ, but note that estimates from windows of different length differ in bias and variance (most visibly for Granger causality), which a baseline correction does not remove.

  • baseline (TimeSeries) – Same channels and sampling frequency. The lengths may differ, but note that estimates from windows of different length differ in bias and variance (most visibly for Granger causality), which a baseline correction does not remove.

  • how ({"difference", "ratio", "zscore"}) – "difference": |active| - |baseline|. "ratio": |active| / |baseline|; cells with a baseline of exactly zero are NaN and a warning says so. "zscore": (|active| - |baseline|) over the standard deviation of |baseline| across a bootstrap of the baseline (dirconn.bootstrap()); cells without spread are NaN.

  • n_boot (int, optional) – Required for "zscore" and refused otherwise, so that an ignored argument never looks like a setting that was used.

  • seed (int, optional) – Required for "zscore" and refused otherwise, so that an ignored argument never looks like a setting that was used.

  • block_size (int, optional) – Block length for a continuous baseline, as in dirconn.bootstrap(); "zscore" only.

  • reduce (callable, str or (float, float), optional) – Applied to both results before normalising.

Returns:

Real-valued, with the axes of the active result. Its provenance is the active result’s, with the normalisation (and the hash of the baseline input) appended to history.

Return type:

Connectivity