mne_connectivity.make_surrogate_evoked_data#

mne_connectivity.make_surrogate_evoked_data(data, n_shuffles=1000, rng_seed=None, return_generator=True)[source]#

Create surrogate evoked data for a null hypothesis of connectivity.

Parameters:
dataEpochs | EpochsTFR

The time-series or Fourier coefficients to create the null hypothesis surrogate data for. Fourier coefficients can be generated from mne.Epochs.compute_tfr() with output='complex'.

n_shufflesint (default 1000)

The number of surrogate datasets to create.

rng_seedint | None (default None)

The seed to use for the random number generator. If None, no seed is specified.

return_generatorbool (default True)

Whether or not to return the surrogate data as a generator object instead of a list. This allows iterating over the surrogates without having to keep them all in memory.

Returns:
surrogate_datalist of EpochsArray or EpochsTFR

The surrogate data for the null hypothesis with n_shuffles entries. Returned as a generator if return_generator=True.

Notes

Suitable for use with evoked or non-evoked data

This approach is suitable for generating surrogate data for a null hypothesis of connectivity from evoked data. This approach can also work with non-evoked data, however make_surrogate_resting_data() is recommended for this.

Surrogate data is generated by cutting the time series at a random point and reversing the cut portion, independently for each epoch and channel. This destroys the covariance of the data, such that connectivity estimates should reflect the null hypothesis of no genuine connectivity between signals (e.g., only interactions due to background noise) [1].

This approach is robust to data containing a temporal structure that is consistent across epochs. Examples of this data include evoked potentials, where a stimulus is presented or an action performed at a set time during each epoch.

Finally, it is important to note that you should always compare true and surrogate connectivity estimates from epochs of the same duration. This will ensure that spectral information is captured with the same accuracy in both sets of connectivity estimates. Ideally, you should also compare true and surrogate connectivity estimates from the same number of epochs to avoid biases from noise (fewer epochs gives noisier estimates) or finite sample sizes (e.g., in coherency, phase-locking value, etc… [2]).

Added in version 0.9.

References

Examples using mne_connectivity.make_surrogate_evoked_data#

Determine the significance of connectivity estimates against baseline connectivity

Determine the significance of connectivity estimates against baseline connectivity