elephant.spike_train_surrogates.bin_shuffling(spiketrain, max_displacement, bin_size=None, n_surrogates=1, sliding=False)[source]

Bin shuffling surrogate generation.

The function shuffles the entries of a binned spike train entries inside windows with a fixed maximal displacement. The windows are either exclusive or sliding.

spiketrainconv.BinnedSpikeTrain or neo.SpikeTrain

The binned spike train or a continuous time spike train to create surrogates of.


Number of bins that a single spike can be displaced.

bin_sizepq.Quantity or None

the bin size needs to be specified only if a not-binned spike train is passed to the method

n_surrogatesint, optional

Number of surrogates to create. Default: 1

slidingbool, optional

If True, the window is slided bin by bin (only implemented for binned spike trains). Default: False

binned_surrogateslist of conv.BinnedSpikeTrain or list of neo.SpikeTrain

Each entry of the list is a surrogate spike train either binned or in continuous time.