Bases: object
RawOutPut is a class which contains raw AER data per channel (Physical addresses).
It decodes the AER data “just in time”
Inputs: raw_data: events with physical addresses id_data: all addresses in given channel decoder_dict: Dictionary of functions for decoding addresses. Key designates the channel t_start: start time of all spikelists in ms t_stop: end time of all spikelists in ms filter_duplicates: If True erases in all channels double events within the a 0.01ms time-frame (buggy hw)
Usage: #In conjunction with pyAex.netClient
>>> client = client.netClient(host='localhost')
>>> raw_out = client.stimulate()
>>> client.stop()
>>> for sl in raw_output: sl.raster_plot()
alias of channelAddressing
addrBuildHashTable(stas) constructs all possible physical addresses of the given address specification and stores it internally in its hash table (stas.addrExtractFast). This function is typically used for real-time monitoring
stas: addrSpec object.
Hash tables are not used anymore
This function does not scale well.
Constructs Logical addresses, i.e. addresses in float format useful for plotting because they keep the neuron - synapse order.
NOTE: Logical addresses do not contain channel information
addr: address (in a form isValidAddress can understand)
Description here
Direct translation from Logical Addresses to Physical addresses using a hash table
Takes logical addresses and fills the logical to physical hash table
Description here
addrPhysicalExtract takes a physical address as argument and returns a numpy array containing the human readable list of addresses. First dimension is the field type, second dimension is the address. Uses hash tables for accelerating look-up.
addrPhysicalExtract takes a physical address as argument and returns a list containing the addresses in human readable form. This is called only the first time the physical address is decoded.
stas: addrSpec object.
addrPhys: an integer or an iterable containing integers representing physical addresses
Direct translation from Physical Addresses to Logical addresses using a hash table
Takes physical addresses and fills the physical to logical hash table
Address specification class # NOTE : Documentation is outdated!!
addrConf: should be a list of dicts. Each dict should contain the following fields:
addrStr: should contain a list of space-separated pins with a number follwing an uppercase character defining the position on the chip. For example: “X0 X1 X2 X3 X4 X5 X6 Y4 Y3 Y2 Y1 Y0”
fe: extraction function. this should be a string like ‘[X,Y*2]’, The letters must correspond to those in addrStr fc: construction function ‘[x,y/2]’, the letters must corrspond to those in addrConf
fe(fc(a)) should be the identity function
IMPORTANT: fe and fc are called vectorally (using numpy arrays), so check that the given functions also work with vectors (otherwise numpy.vstack will complain)
Example:
Iterates over the indexes of addrConf
Iterates over the list addrConf
(Re)Generates the object based on the addrStr, addrConf and addrPinConf
This class contains the information defining the Channel Addressing Scheme for a multichip setup, i.e. definition of which chips are found on which channel
channelAddressing(stasList,nChannelBits)
nChannelBits: Positions of channel bits in the hardware addresses. Default nChannelBits=[15,16]
stasList: list of address specification objects, of the same length as len(channelBits)**2
See also: addrSpec
Constructs Logical addresses, i.e. addresses in float format useful for plotting because they keep the neuron - synapse order.
Returns a float32 numpy array.
NOTE: Logical addresses do not contain channel information
addr: address (in a form isChannelAddrList() can understand), such as {0:[range(15),2]}
See also:
addrLogicalConstruct, addrLogicalExtract
Extracts Logical Address with channel information
addr: address (in a form isChannelAddrList() can understand), such as {0:[1.,2.,3.]}
Constructs Physical addresses to human readable addresses
addr: numpy array of human readable numbers ( the physical addresses )
channel: which channel addressing should be appended.
Extracts Physical addresses to human readable addresses
addr: numpy array of uint32 numbers ( the physical addresses )
Output is channelAddrList, channel where channelEventsList is a list of arrays which contain the addresses and channel is an array of channels.
Extracts Physical addresses to logical addresses (directly)
addr: numpy array of uint32 numbers ( the physical addresses )
Output is channelAddrList, channel where channelEventsList is a list of arrays which contain the addresses and channel is an array of channels.
spikeLists can be a spikeList, a list of spikelists of dimension nChannels, a dictionary i.e.{channel: spikeList}. If a SpikeList is given, it will be equivalent to {0: spikeLists}. format specifies whether timestamps (format=’t’) or addresses (format=’a’) should be on the first column. addr_format and time_format format to be used by np.savetxt
Extracts the channel information from an array of hardware events. Returns a channelEvents object. Use addrPhysicalExtract for decoding the adresses instead.
eventsArray: numpy array of hardware events (uint32)
Extracts events from eventsChannel, using the address specification specified for the given channels, returns a list of SpikeList
returns the channel mask
channel: int between 0 and len(channelBits)**2
Function for extracting, translating events from a numpy array. Output is a channelEvents object.
Inputs: input: if a string, will be treated as a filename and passed to np.loadtxt, if a numpy array, will be considered as events of dimension 2 x number of events. By default, the addresses are on [:,0] format: either ‘t’ or ‘a’ respectively meaning timestamps and addresses on the first column. (‘a’ by default) kwargs: keyword arguments passed to np.loadtxt
Mostly internal function
Check whether addr is a valid channelAddr list/dict
addr: Either list of dimension channelAddressing.nChannels, containing arrays of addresses. The list index is the channel number, or dict whose keys are the channel numbers.
See also:
Stas.isValidAddress
Called before extract to throw away pre-stimulus data
this function acts like generateST, but constructs a RawOutput object which delays the decoding until it is necessary. ch_events is a channelEvents object of type ‘p’ (Physical)
String representation of the channel address specification
Bases: dict
TODO
Add an events object to a channel Remark: Creates a reference to the provided events! In place changes also affect the events!
Modifies, in-place, the encapsulated events acccording to the one-to-many mapping (key is int/float, value is iterable) In this function, a different mapping is used for each channel (useful for address that do not contain channel information, for example)
Modifies, in-place, the encapsulated events acccording to the one-to-many mapping (key is int/float, value is iterable)
Removes (in-place) all channels with are not in channel_list. If channel_list is omitted, the ch_events is left unchanged
Bases: object
Generates a dictionary with addesses as keys and a list of timestamps as values. Used internally for generating SpikeLists
Map the events, given a mapping dictionary like: map[src]=[target1,target2,...,targetn],
Sort events by addresses and timestamps (in this order).
Extracts events from eventsChannel, using the address specification specified for the given channels, returns a list of SpikeList Inputs: stas: STas.addrSpec object events: STas.events object normalize: if True (default), the timestamp of the first event is set to zeros and all the timestamps of the subsequent events are shifted accordingly.
Returns the default Monitoring Channel Addressing Scheme (i.e. AER Output). No arguments
See also: setDefaultMonChannelAddress
Returns the default Monitoring Channel Addressing Scheme (i.e. AER Input). No arguments
See also: setDefaultSeqChannelAddress
This is an internal function which verifies that the given “human readable” address is consistent with the address specification. It also takes care of “filling in” the addresses: for example [range(15),2] is understood as [range(15),[2]*15].
Raises AssertionError if addrList has incorrect data
stas: an address specification object addrSpec addrList: a list of human readable addresses such as [range(15), 5]. It also accepts numpy arrays and transforms it accordingly
Checks if the given list, int, numpy array is a valid physical address and outputs a numpy array
Internal struct used for addrSpec, performing the pin layout permutation (the information contained in addrSr)
This is a reduced version of pyNCS.Chip._readCSV, which reads only the addressing information Inputs: CSVfile - A csv file describing the chip (a “chipfile”).
This function returns addrSpec objects aerIn and aerOut by parsing the NHML file.
Prints the address specification in a human readable format Input: addr_spec, a AddrSpec object
Sets the default Monitoring Channel Addressing scheme (i.e. AER Output) in pyST globals, and used by pyAex. The argument is then returned when getDefaultMonChannelAddress is called
cs: The Channel Addressing Scheme, instance of the channelAddressing class
See also: getDefaultMonChannelAddress
Sets the default Sequencer Channel Addressing scheme (i.e. AER Input) in pyST globals, and used by pyAex. The argument is then returned when getDefaultMonChannelAddress is called
cs: The Channel Addressing Scheme, instance of the channelAddressing class
See also: pyST.getDefaultSeqChannelAddress
Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.
The arguments are identical to STPlotRaster, except for display. display If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.
Same as spikelist.raster_plot() but with pretty plot options
id_color is used to customize colors according to neuron address (for example inhibitory vs. excitatory)
Example: >>> id_color = [{‘ids’:range(124),’color’:’blue’},{‘ids’:range(124,128),’color’:’red’}] >>> plot_raster(chipout[158],id_color=id_color)
Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.
The arguments are identical to STPlotRaster, except for display. display If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.
Make a nice Composite plot superimposing two spike trains, a raster plot combined with a vertical rate plot. st_pre and st_post are two SpikeLists. st_post will be plotted above st_pre colors is a list specifying the respective colors for the bars and spikes for st_pre and st_post kwargs are the keyword arguments for common plot arguments in the raster plots. Default is {‘alpha’:0.7,’marker’:’,’} for st_pre and plot_raster defaults for st_post pre_rate_mult is a float used for plotting the rates of st_pre on a different scale other arguments are the same as in composite_plot
Kuramoto Synchronization Index (KSI) (Kuaramoto 1984) for measuring phase coherency with respect to the strongest freqeuncy of the population activity.
Returns ksi in the range (0,1). 0 meaning no cohrency and 1 meaning entirely coherent
this function maps the addresses of a spike list into another using the given mapping. Useful for logical to physical translation and vice versa SL=original spike list mapping=dictionary containing address mapping, If mapping is None, then the addresses will be mapped onto a linear scale, i.e. range(len(SL.id_list()))
Same as spikelist.raster_plot() but with pretty plot options
id_color is used to customize colors according to neuron address (for example inhibitory vs. excitatory)
Example: >>> id_color = [{‘ids’:range(124),’color’:’blue’},{‘ids’:range(124,128),’color’:’red’}] >>> plot_raster(chipout[158],id_color=id_color)
Bases: object
SpikeList(spikes, id_list, t_start=None, t_stop=None, dims=None)
Return a SpikeList object which will be a dict of SpikeTrain objects.
t_start and t_stop are shared for all SpikeTrains object within the SpikeList
>> sl = SpikeList([(0, 0.1), (1, 0.1), (0, 0.2)], range(2)) >> type( sl[0] )
<type SpikeTrain>
Add a SpikeTrain object to the SpikeList
The SpikeTrain object is sliced according to the t_start and t_stop times of the SpikeLlist object
>> st=SpikeTrain(range(0,100,5),0.1,0,100) >> spklist.append(999, st)
spklist[999]
Complete the SpikeList by adding Sempty SpikeTrain for all the ids present in ids that will not already be in the SpikeList
- Inputs:
- id_list - The id_list that should be completed
>> spklist.complete(arange(5)) >> spklist.id_list()
[0,1,2,3,4]
Make a nice Composite plot, i.e. a raster plot combined with a vertical rate plot.
The arguments are identical to STPlotRaster, except for display. If True is given a new figure is created. If [axS,axR] is given, where axS and axR are pylab.axes objects, then the spike rater and the rate plot are plotted there.
Concatenation of SpikeLists to the current SpikeList.
The concatenated SpikeLists must have similar (t_start, t_stop), and they can’t shared similar cells. All their ids have to be different.
quantized - a boolean to round the spikes_times.
>> spk.convert(“[(time,id)]”) will return a list of tuples (time, id)
Return a copy of the SpikeList object
Return the list of all the CV coefficients for each SpikeTrains object within the SpikeList. Return NaN when not enough spikes are present
Compute the Fano Factor of the population activity.
The Fano Factor is computed as the variance of the averaged activity divided by its mean
Return a list containing the fano factors for each neuron
Generate an array with all the instantaneous firing rates along time (in Hz) of all the SpikeTrains objects within the SpikeList. If average is True, it gives the average firing rate over the whole SpikeList
time_bin - the time bin used to gather the data average - If True, return a single vector of the average firing rate over the whole SpikeList display - if True, a new figure is created. Could also be a subplot. The averaged
spike_histogram over the whole population is then plotted
Get the time of the first real spike in the SpikeList
Create a SpikeList with only one address id which is the sum of all SpikeTrains in the SpikeList Returns a new SpikeList.
Return a position (x,y) from an id if the cells are aranged on a grid of size dims, as defined in the dims attribute of the SpikeList object. This assumes that cells are ordered from left to right, top to bottom, and that dims specifies (height, width), i.e. if dims = (10,12), this is an array with 10 rows and 12 columns, and hence has width 12 units and height 10 units.
The ‘dimensions’ attribute of the SpikeList must be defined
Return the sorted list of all the cells ids contained in the SpikeList object
Add an offset to the whole SpikeList object. All the id are shifted according to an offset value.
>> spklist.id_offset(10) >> spklist.id_list()
[10,11,12,13,14]
Return a new SpikeList obtained by selecting particular ids
The new SpikeList inherits the time parameters (t_start, t_stop)
>> new_spklist = spklist.id_slice(5) >> new_spklist.id_list()
[1011, 729, 1138, 416, 59]
Return the list of all the isi vectors for all the SpikeTrains objects within the SpikeList.
Return the histogram of the ISI.
display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot
function
Get the time of the last real spike in the SpikeList
Return the mean firing rate averaged accross all SpikeTrains between t_start and t_stop.
If t_start or t_stop are not defined, those of the SpikeList are used
Return the covariance of the firing rate along time, if events are binned with a time bin.
Standard deviation of the firing rates accross all SpikeTrains between t_start and t_stop
If t_start or t_stop are not defined, those of the SpikeList are used
Return the standard deviation of the firing rate along time, if events are binned with a time bin.
Returns a vector of the size of id_list giving the mean firing rate for each neuron
If t_start or t_stop are not defined, those of the SpikeList are used
Returns a list of mean rates calculated on the basis of interspike interval.
If t_start or t_stop are not defined, those of the SpikeList are used
For each cell id in spikelist that matches an id in this SpikeList, merge the two SpikeTrains and save the result in this SpikeList. Note that SpikeTrains with ids not in this SpikeList are appended to it.
spikelist - the SpikeList that should be merged to the current one relative - if True, spike times are expressed in a relative
time compared to the previsous one
Return the id of the cell at position (x,y) if the cells are aranged on a grid of size dims, as defined in the dims attribute of the SpikeList object
The ‘dimensions’ attribute of the SpikeList must be defined and have the same shape as the position argument
Generate a raster plot for the SpikeList in a subwindow of interest, defined by id_list, t_start and t_stop.
t_start - in ms. If not defined, the one of the SpikeList object is used t_stop - in ms. If not defined, the one of the SpikeList object is used display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot
function
Flattern SpikeList with flatten(), then plot the raster
Return a vector with all the mean firing rates for all SpikeTrains.
display - if True, a new figure is created. Could also be a subplot kwargs - dictionary contening extra parameters that will be sent to the plot
function
Function to return a N by 2 array of all times and ids.
>> spklist.raw_data() >> array([[ 1.00000000e+00, 1.00000000e+00],
[ 1.00000000e+00, 1.00000000e+00], [ 2.00000000e+00, 2.00000000e+00],
...,[ 2.71530000e+03, 2.76210000e+03]])
Save raw data to user_file
Return the list of all the cells in the SpikeList that will match the criteria expressed with the following syntax.
Return an array with all the ids of the cells in the SpikeList, sorted according to a particular criteria.
descending - if True, then the cells are sorted from max to min.
Generate an array with all the spike_histograms of all the SpikeTrains objects within the SpikeList.
time_bin - the time bin used to gather the data normalized - if True, the histogram are in Hz (spikes/second), otherwise they are
in spikes/bin
Return a time axis between t_start and t_stop according to a time_bin
Add an offset to the whole SpikeList object. t_start and t_stop are shifted from offset, so does all the SpikeTrain.
>> spklist.time_offset(50) >> spklist.t_start
1050
Return the time parameters of the SpikeList (t_start, t_stop)
Return a new SpikeList obtained by slicing between t_start and t_stop
Bases: object
SpikeTrain(spikes_times, t_start=None, t_stop=None) This class defines a spike train as a list of times events.
Event times are given in a list (sparse representation) in milliseconds.
>> s1 = SpikeTrain([0.0, 0.1, 0.2, 0.5]) >> s1.isi()
array([ 0.1, 0.1, 0.3])
Return a copy of the SpikeTrain object
Return the coefficient of variation of the isis.
coefficient of variation of the corresponding inter-spike interval (ISI) distribution normalized by the square of its mean.
In point processes, low values reflect more regular spiking, a
clock-like pattern yields CV2= 0. On the other hand, CV2 = 1 indicates Poisson-type behavior. As a measure for irregularity in the network one can use the average irregularity across all neurons.
http://en.wikipedia.org/wiki/Coefficient_of_variation
Provides a measure for the coefficient of variation to describe the regularity in spiking networks. It is based on the Kullback-Leibler divergence and decribes the difference between a given interspike-interval-distribution and an exponential one (representing poissonian spike trains) with equal mean. It yields 1 for poissonian spike trains and 0 for regular ones.
Returns the van Rossum metric of the two spike trians. dt - time bins to calculate the exponentials. tc - time constant / cost of the exponentials.
Function to calculate the Victor-Purpura distance between two spike trains. See J. D. Victor and K. P. Purpura,
Nature and precision of temporal coding in visual cortex: a metric-space analysis., J Neurophysiol,76(2):1310-1326, 1996
Return the duration of the SpikeTrain
Return the fano factor of this spike trains ISI.
The Fano Factor is defined as the variance of the isi divided by the mean of the isi
http://en.wikipedia.org/wiki/Fano_factor
Return an array with a new representation of the spike times
quantized - a value to divide spike times with before rounding
>> st.spikes_times=[0, 2.1, 3.1, 4.4] >> st.format(relative=True)
[0, 2.1, 1, 1.3]
Return True if the SpikeTrain object is equal to one other SpikeTrain, i.e if they have same time parameters and same spikes_times
Return an array with the inter-spike intervals of the SpikeTrain
>> st.spikes_times=[0, 2.1, 3.1, 4.4] >> st.isi()
[2.1, 1., 1.3]
Returns a new SpikeTrain with spiketimes jittered by a normal distribution.
Returns the mean firing rate between t_start and t_stop, in Hz
Returns the mean rate (Hz) based on the interspike intervals
Add the spike times from a spiketrain to the current SpikeTrain
>> a = SpikeTrain(range(0,100,10),0.1,0,100) >> b = SpikeTrain(range(400,500,10),0.1,400,500) >> a.merge(b) >> a.spike_times
[ 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 400., 410., 420., 430., 440., 450., 460., 470., 480., 490.]
Rescale the spike times to make them relative to t_start.
Note that the SpikeTrain object itself is modified, t_start is substracted to spike_times, t_start and t_stop
Return a time axis between t_start and t_stop according to a time_bin
>> st = SpikeTrain(range(100),0.1,0,100) >> st.time_axis(10)
[ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90n 100]
Bin the spikes with the specified bin width. The first and last bins are calculated from self.t_start and self.t_stop.
time_bin - the bin width for gathering spikes_times normalized - if True, the bin values are scaled to represent firing rates
in spikes/second, otherwise otherwise it’s the number of spikes per bin.
>> st=SpikeTrain(range(0,100,5),0.1,0,100) >> st.time_histogram(10)
[200, 200, 200, 200, 200, 200, 200, 200, 200, 200]
Add an offset to the SpikeTrain object. t_start and t_stop are shifted from offset, so does all the spike times.
>> spktrain = SpikeTrain(arange(0,100,10)) >> spktrain.time_offset(50) >> spklist.spike_times
[ 50., 60., 70., 80., 90., 100., 110., 120., 130., 140.]
Return the time parameters of the SpikeTrain (t_start, t_stop)
Return a new SpikeTrain obtained by slicing between t_start and t_stop. The new t_start and t_stop values of the returned SpikeTrain are the one given as arguments
>> spk = spktrain.time_slice(0,100) >> spk.t_start
0
Bases: pyNCS.pyST.spikes.SpikeTrain
Returns a pylab object with a plot() function to draw the plots.
Load a file saved by SpikeList.save
Merge spike times from a spiketrain
>> a = SpikeTrain(range(0,100,10),0.1,0,100) >> b = SpikeTrain(range(400,500,10),0.1,400,500) >> a = merge(a, b) >> a.spike_times
[ 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 400., 410., 420., 430., 440., 450., 460., 470., 480., 490.]
Merges (soon to be) sequencer objects. These are typically returend by pyNCS.group spiketrain functions and used in setup.run
Defines the axis limits of a plot.
Defines the axis labels of a plot.
A collection of tools for stochastic process generation.
shotnoise_fromspikes - Convolves the provided spike train with shot decaying exponential.
gamma_hazard - Compute the hazard function for a gamma process with parameters a,b.
Generates an Orstein Ulbeck process using the forward euler method. The function returns an AnalogSignal object.
dt - the time resolution in milliseconds of th signal tau - the correlation time in milliseconds sigma - std dev of the process y0 - initial value of the process, at t_start t_start - start time in milliseconds t_stop - end time in milliseconds array - if True, the functions returns the tuple (y,t)
where y and t are the OU signal and the time bins, respectively, and are both numpy arrays.
Generates an Orstein Ulbeck process using the forward euler method. The function returns an AnalogSignal object.
OU_generator_weave1, as opposed to OU_generator, uses scipy.weave and is thus much faster.
dt - the time resolution in milliseconds of th signal tau - the correlation time in milliseconds sigma - std dev of the process y0 - initial value of the process, at t_start t_start - start time in milliseconds t_stop - end time in milliseconds array - if True, the functions returns the tuple (y,t)
where y and t are the OU signal and the time bins, respectively, and are both numpy arrays.
Returns a SpikeList whose spikes are an inhomogeneous realization (dynamic rate) of the so-called 2D adapting markov process (see references). 2D implies the process has two states, an adaptation state, and a refractory state, both of which affect its probability to spike. The implementation uses the thinning method, as presented in the references.
For the 1d implementation, with no relative refractoriness, see the inh_adaptingmarkov_generator.
tau_s - the time constant of adaptation (in milliseconds). tau_r - the time constant of refractoriness (in milliseconds). qrqs - the ratio of refractoriness conductance to adaptation conductance.
typically on the order of 200.
t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeList object.
References:
Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.
Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.
Returns a SpikeList whose spikes are an inhomogeneous realization (dynamic rate) of the so-called adapting markov process (see references). The implementation uses the thinning method, as presented in the references.
This is the 1d implementation, with no relative refractoriness. For the 2d implementation with relative refractoriness, see the inh_2dadaptingmarkov_generator.
tau - the time constant of adaptation (in milliseconds). t - an array specifying the time bins (in milliseconds) at which to
specify the rate
t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeList object.
References:
Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.
Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.
Returns a SpikeList whose spikes are a realization of an inhomogeneous gamma process (dynamic rate). The implementation uses the thinning method, as presented in the references.
t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeList object.
References:
Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.
Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.
Returns a SpikeList whose spikes are a realization of an inhomogeneous poisson process (dynamic rate). The implementation uses the thinning method, as presented in the references.
t_stop - length of time to simulate process (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeList object.
References:
Eilif Muller, Lars Buesing, Johannes Schemmel, and Karlheinz Meier Spike-Frequency Adapting Neural Ensembles: Beyond Mean Adaptation and Renewal Theories Neural Comput. 2007 19: 2958-3010.
Devroye, L. (1986). Non-uniform random variate generation. New York: Springer-Verlag.
Returns a SpikeTrain whose spikes are a realization of a Poisson process with the given rate (Hz) and stopping time t_stop (milliseconds).
Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.
rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) t_stop - the end of the SpikeTrain (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeTrain object.
Returns a SpikeTrain whose spikes are regularly spaced, but jittered according to a Gaussian distribution around the spiking period, with the given rate (Hz) and stopping time t_stop (milliseconds).
Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.
rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) t_stop - the end of the SpikeTrain (in ms) phase - Offset the spiketrain by this number (in ms.) scale - width of the Gaussian distribution placed at the regular
spike times, according to which the spike will be drawn (in ms)
Returns a SpikeTrain whose spikes are regularly spaced with the given rate (Hz) and stopping time t_stop (milliseconds).
Note: t_start is always 0.0, thus all realizations are as if they spiked at t=0.0, though this spike is not included in the SpikeList.
rate - the rate of the discharge (in Hz) t_start - the beginning of the SpikeTrain (in ms) phase - Offset the spiketrain by this number (in ms.) jitter - whether the spiketrain should be jittered by an amount numpy.random.rand()/rate t_stop - the end of the SpikeTrain (in ms) array - if True, a numpy array of sorted spikes is returned,
rather than a SpikeTrain object.
seed the gsl rng with a given seed
Compute the hazard function for a gamma process with parameters a,b where a and b are the parameters of the gamma PDF: y(t) = x^(a-1) exp(-x/b) / (Gamma(a)*b^a)