elephant.spike_train_generation.StationaryPoissonProcess¶
-
class
elephant.spike_train_generation.
StationaryPoissonProcess
(rate: Quantity, t_stop: Quantity = array(1.) * s, t_start: Quantity = array(0.) * s, refractory_period: Optional[Quantity] = None, equilibrium: bool = True)[source]¶ Generates spike trains whose spikes are realizations of a stationary Poisson process with the given rate, starting at time t_start and stopping at time t_stop. Optionally, a absolute refractory period / dead time can be specified.
Parameters: - ratepq.Quantity
The constant firing rate.
- t_startpq.Quantity, optional
The start of the spike train. Default: 0.*pq.s
- t_stoppq.Quantity, optional
The end of the spike train. Default: 1.*pq.s
- refractory_periodpq.Quantity, optional
The time period after one spike in which no other spike is emitted. This can be called an absolute refractory period or a dead time as used in [gen1]. Default : None
- equilibriumbool, optional
Generate an equilibrium or an ordinary renewal process. Default: True
Raises: - ValueError
If one of rate, t_start and t_stop is not of type pq.Quantity.
If refractory_period is not of type pq.Quantity nor None.
If the period between two successive spikes (1 / rate) is smaller or equal than the refractory_period.
Examples
>>> import quantities as pq >>> spiketrain = StationaryPoissonProcess(rate=50.*pq.Hz, t_start=0*pq.ms, ... t_stop=1000*pq.ms).generate_spiketrain() >>> spiketrain_array = StationaryPoissonProcess( ... rate=20*pq.Hz, t_start=5000*pq.ms, t_stop=10000*pq.ms ... ).generate_spiketrain(as_array=True) >>> spiketrain = StationaryPoissonProcess( ... rate=50*pq.Hz, ... t_start=0*pq.ms, t_stop=1000*pq.ms, ... refractory_period = 3*pq.ms).generate_spiketrain()
Methods
__init__
(rate[, t_stop, t_start, ...])generate_n_spiketrains
(n_spiketrains[, as_array])Generates a list of spike trains. generate_spiketrain
([as_array])Generates a single spike train. Attributes
expected_cv
The expected coefficient of variation given the ISI distribution. t_start
t_start quantity; there are no spike times below this value. t_stop
t_stop quantity; there are no spike times above this value. -
property
expected_cv
¶ The expected coefficient of variation given the ISI distribution.
-
generate_n_spiketrains
(n_spiketrains: int, as_array: bool = False) Union[List[SpikeTrain], List[ndarray]] ¶ Generates a list of spike trains.
Parameters: - n_spiketrainsint
The number of spike trains to generate.
- as_arraybool, optional
If True, a NumPy array of sorted spikes is returned, rather than a neo.SpikeTrain object. Default: False
Returns: - list_of_spiketrainlist of neo.SpikeTrain or list of np.ndarray
A list generated spike trains in the specified format.
-
generate_spiketrain
(as_array: bool = False) Union[SpikeTrain, ndarray] ¶ Generates a single spike train.
Parameters: - as_arraybool, optional
If True, a NumPy array of sorted spikes is returned, rather than a neo.SpikeTrain object. Default: False
Returns: - spiketrainneo.SpikeTrain or np.ndarray
The generated spike train in the specified format.
-
property
t_start
¶ t_start quantity; there are no spike times below this value.
-
property
t_stop
¶ t_stop quantity; there are no spike times above this value.