HomogeneousCorrelatedSpikeTrains
inputs.SpikeTrains.HomogeneousCorrelatedSpikeTrains(
self,
geometry,
rates,
corr,
tau,
schedule=None,
period=-1.0,
name=None,
refractory=None,
copied=False,
)
Population of spiking neurons following a homogeneous distribution with correlated spike trains.
The method describing the generation of homogeneous correlated spike trains is described in:
Brette, R. (2009). Generation of correlated spike trains. Neural Computation 21(1). http://romainbrette.fr/WordPress3/wp-content/uploads/2014/06/Brette2008NC.pdf
The implementation is based on the one provided by Brian http://briansimulator.org.
To generate correlated spike trains, the population rate of the group of Poisson-like spiking neurons varies following a stochastic differential equation:
\frac{dx}{dt} = \frac{\mu - x}{\tau} + \sigma \, \frac{\xi}{\sqrt{\tau}}
where \xi is a random sample from the standard normal distribution. In short, x will randomly vary around \mu over time, with an amplitude determined by \sigma and a speed determined by \tau.
This doubly stochastic process is called a Cox process or Ornstein-Uhlenbeck process.
To avoid that x becomes negative, the values of mu and sigma are computed from a rectified Gaussian distribution, parameterized by the desired population rate rates, the desired correlation strength corr and the time constant tau. See Brette’s paper for details.
In short, you should only define the parameters rates
, corr
and tau
, and let the class compute mu and sigma for you. Changing rates
, corr
or tau
after initialization automatically recomputes mu and sigma.
Example:
import ANNarchy as ann
ann.setup(dt=0.1)
pop_corr = ann.HomogeneousCorrelatedSpikeTrains(200, rates=10., corr=0.3, tau=10.)
ann.compile()
ann.simulate(1000.)
pop_corr.rates=30.
ann.simulate(1000.)
Alternatively, a schedule can be provided to change automatically the value of rates
and corr
(but not tau
) at the required times (as in TimedArray or TimedPoissonPopulation):
pop_corr = ann.HomogeneousCorrelatedSpikeTrains(
geometry=200,
rates= [10., 30.],
corr=[0.3, 0.5],
tau=10.,
schedule=[0., 1000.]
)
ann.compile()
ann.simulate(2000.)
Even when using a schedule, corr
accepts a single constant value. The first value of schedule
must be 0. period
specifies when the schedule “loops” back to its initial value.
Parameters
Name | Type | Description | Default |
---|---|---|---|
geometry | int | tuple[int] | population geometry as tuple. | required |
rates | float | list[float] | rate in Hz of the population (must be a positive float or a list) | required |
corr | float | list[float] | total correlation strength (float in [0, 1], or a list) | required |
tau | float | correlation time constant in ms. | required |
schedule | list[float] | list of times where new values of rates and corr will be used to computre mu and sigma. |
None |
period | float | time when the array will be reset and start again, allowing cycling over the schedule. Default: no cycling (-1.) | -1.0 |
name | str | unique name of the population (optional). | None |
refractory | float | refractory period in ms (careful: may break the correlation) | None |