elephant.spike_train_generation.NonStationaryGammaProcess

class elephant.spike_train_generation.NonStationaryGammaProcess(rate_signal: AnalogSignal, shape_factor: float)[source]

Generates spike trains whose spikes are realizations of a non-stationary Gamma process with the given rate-signal.

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

shape_factorfloat

The shape parameter of the gamma distribution.

Raises:
ValueError

If rate_signal is not a neo AnalogSignal If rate_signal contains a negative value. If rate_signal is empty.

Methods

__init__(rate_signal, shape_factor)
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 t_start quantity; there are no spike times below this value.
t_stop t_stop quantity; there are no spike times above this value.
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.