elephant.spike_train_generation.NonStationaryPoissonProcess¶
- class elephant.spike_train_generation.NonStationaryPoissonProcess(rate_signal: AnalogSignal, refractory_period: Quantity | None = None)[source]¶
Generates spike trains whose spikes are realizations of a non-stationary Poisson process with the given rate-signal. Optionally, you can specify a dead time.
- Parameters:
- rate_signalneo.AnalogSignal
A neo.AnalogSignal representing the rate profile evolving over time.Its values have all to be >=0. The generated spike trains will have t_start = rate.t_start and t_stop = rate.t_stop
- 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. Default : None
- Raises:
- ValueError
If rate_signal is not a neo AnalogSignal If rate_signal contains a negative value. If rate_signal is empty. If refractory_period is not of type pq.Quantity nor None.
Methods
__init__(rate_signal[, refractory_period])generate_n_spiketrains(n_spiketrains[, as_array])Generates a list of spike trains.
generate_spiketrain([as_array])Generates a single spike train.
Attributes
t_start quantity; there are no spike times below this value.
t_stop quantity; there are no spike times above this value.
- generate_n_spiketrains(n_spiketrains: int, as_array: bool = False) 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) 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.