mne_connectivity.make_surrogate_data#

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

Create surrogate data for a null hypothesis of connectivity.

Parameters:
dataEpochsSpectrum | EpochsTFR

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

Note

Storing Fourier coefficients in mne.time_frequency.EpochsSpectrum objects requires mne >= 1.8.

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 EpochsSpectrum or EpochsTFR

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

Notes

Deprecated since version 0.9: This function was renamed to make_surrogate_resting_data().