elephant.spike_train_generation.homogeneous_gamma_process

elephant.spike_train_generation.homogeneous_gamma_process(a, b, t_start=array(0.) * ms, t_stop=array(1000.) * ms, as_array=False)[source]

Returns a spike train whose spikes are a realization of a gamma process with the given parameters, starting at time t_start and stopping time t_stop (average rate will be b/a). All numerical values should be given as Quantities, e.g. 100*pq.Hz.

Parameters:
aint or float

The shape parameter of the gamma distribution.

bpq.Quantity

The rate parameter of the gamma distribution.

t_startpq.Quantity, optional

The beginning of the spike train. Default: 0 * pq.ms

t_stoppq.Quantity, optional

The end of the spike train. Default: 1000 * pq.ms

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

Homogeneous Gamma process realization, stored in neo.SpikeTrain if as_array is False (default) and np.ndarray otherwise.

Raises:
ValueError

If t_start and t_stop are not of type pq.Quantity.

Examples

>>> import quantities as pq
>>> spikes = homogeneous_gamma_process(2.0, 50*pq.Hz, 0*pq.ms,
...                                       1000*pq.ms)
>>> spikes = homogeneous_gamma_process(
...        5.0, 20*pq.Hz, 5000*pq.ms, 10000*pq.ms, as_array=True)