elephant.spade.pvalue_spectrum¶
-
elephant.spade.
pvalue_spectrum
(spiketrains, bin_size, winlen, dither, n_surr, min_spikes=2, min_occ=2, max_spikes=None, max_occ=None, min_neu=1, spectrum='#', surr_method='dither_spikes', **surr_kwargs)[source]¶ Compute the p-value spectrum of pattern signatures extracted from surrogates of parallel spike trains, under the null hypothesis of independent spiking.
- n_surr surrogates are obtained from each spike train by spike dithering
- pattern candidates (concepts) are collected from each surrogate data
- the signatures (number of spikes, number of occurrences) of all patterns are computed, and their occurrence probability estimated by their occurrence frequency (p-value spectrum)
Parameters: - spiketrainslist of neo.SpikeTrain
List containing the parallel spike trains to analyze
- bin_sizepq.Quantity
The time precision used to discretize the spiketrains (binning).
- winlenint
The size (number of bins) of the sliding window used for the analysis. The maximal length of a pattern (delay between first and last spike) is then given by winlen*bin_size
- ditherpq.Quantity
Amount of spike time dithering for creating the surrogates for filtering the pattern spectrum. A spike at time t is placed randomly within [t-dither, t+dither] (see also
elephant.spike_train_surrogates.dither_spikes()
). Default: 15*pq.s- n_surrint
Number of surrogates to generate to compute the p-value spectrum. This number should be large (n_surr>=1000 is recommended for 100 spike trains in spiketrains). If n_surr is 0, then the p-value spectrum is not computed. Default: 0
- min_spikesint, optional
Minimum number of spikes of a sequence to be considered a pattern. Default: 2
- min_occint, optional
Minimum number of occurrences of a sequence to be considered as a pattern. Default: 2
- max_spikesint, optional
Maximum number of spikes of a sequence to be considered a pattern. If None no maximal number of spikes is considered. Default: None
- max_occint, optional
Maximum number of occurrences of a sequence to be considered as a pattern. If None, no maximal number of occurrences is considered. Default: None
- min_neuint, optional
Minimum number of neurons in a sequence to considered a pattern. Default: 1
- spectrum{‘#’, ‘3d#’}, optional
Defines the signature of the patterns.
- ‘#’: pattern spectrum using the as signature the pair:
(number of spikes, number of occurrence)
- ‘3d#’: pattern spectrum using the as signature the triplets:
(number of spikes, number of occurrence, difference between last and first spike of the pattern)
Default: ‘#’
- surr_methodstr
Method that is used to generate the surrogates. You can use every method defined in
elephant.spike_train_surrogates.dither_spikes()
. Default: ‘dither_spikes’- surr_kwargs
Keyword arguments that are passed to the surrogate methods.
Returns: - pv_speclist
- if spectrum == ‘#’:
A list of triplets (z,c,p), where (z,c) is a pattern signature and p is the corresponding p-value (fraction of surrogates containing signatures (z*,c*)>=(z,c)).
- if spectrum == ‘3d#’:
A list of triplets (z,c,l,p), where (z,c,l) is a pattern signature and p is the corresponding p-value (fraction of surrogates containing signatures (z*,c*,l*)>=(z,c,l)).
Signatures whose empirical p-value is 0 are not listed.