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: Quantity | None = 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 (Deger et al., 2012). Optionally, an 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 (Deger et al., 2012). 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.