correlation_detector – Device for evaluating cross correlation between two spike sources
========================================================================================
Description
+++++++++++
The ``correlation_detector`` is a device that receives spikes from two pools of
spike inputs and calculates the ``count_histogram`` of inter-spike intervals
(raw cross correlation) binned to bins of duration :math:`\delta_\tau`.
The corresponding parameter ``delta_tau`` defaults to 5 times the simulation
resolution.
The result can be obtained from the node's status dictionary under the key
``count_histogram``.
In parallel it records a weighted histogram, where the connection weights
are used to weight every count. In order to minimize numerical errors, the
`Kahan summation algorithm `_
is used when calculating the weighted histogram.
Both are arrays of :math:`2\cdot\tau_{max}/\delta_{\tau}+1` values containing the
histogram counts in the following way:
Let :math:`t_{1,i}` be the spike times of source 1,
:math:`t_{2,j}` the spike times of source 2.
``histogram[n]`` then contains the sum of products of the weight
:math:`w_{1,i}\cdot w_{2,j}`, count_histogram[n] contains 1 summed over all events
with :math:`t_{2,j}-t_{1,i}` in
.. math::
n\cdot\delta_\tau - \tau_{max} - \delta_\tau/2
n\cdot\delta_\tau - \tau_{max} + \delta_\tau/2
The bins are centered around the time difference they represent, but are
left-closed and right-open. This means that events with time difference
:math:`-\tau_{max}-\delta_\tau/2` are counted in the leftmost bin, but event with
difference :math:`\tau_{max}+\delta_\tau/2` are not counted at all.
The correlation detector has two inputs, which are selected via the
receptor_port of the incoming connection: All incoming connections with
``receptor_port = 0`` will be pooled as the spike source 1, the ones with
``receptor_port = 1`` will be used as spike source 2.
Correlation detectors ignore any connection delays.
See :doc:`../auto_examples/cross_check_mip_corrdet` to learn more
about the usage of the correlation detector.
Parameters
++++++++++
==================== ======== ==================================================
Tstart real Time when to start counting events. This time
should
be set to at least start + tau_max in order to
avoid
edge effects of the correlation counts.
Tstop real Time when to stop counting events. This time
should
be set to at most Tsim - tau_max, where Tsim is
the
duration of simulation, in order to avoid edge
effects of the correlation counts.
delta_tau ms Bin width. This has to be an odd multiple of
the resolution, to allow the symmetry between
positive and negative time-lags. Defaults to 5
times the simulation resolution
tau_max ms One-sided width. In the lower triangular part
events with differences in [0, tau_max+delta_tau/2)
are counted. On the diagonal and in the upper
triangular part events with differences in
(0, tau_max+delta_tau/2]. Defaults to 10 times the
value of delta_tau.
N_channels integer The number of pools. This defines the range of
receptor_type. Default is 1.
Setting N_channels clears count_covariance,
covariance and n_events.
histogram squared read-only - raw, weighted, cross-correlation
counts
synaptic Unit depends on model
weights
histogram_correction list of read-only - Correction factors for Kahan summation
integers algoritm
n_events list of Number of events from source 0 and 1. By setting
integers n_events to [0,0], the histogram is cleared.
==================== ======== ==================================================
Receives
++++++++
SpikeEvent
See also
++++++++
:doc:`Device `, :doc:`Detector `
Examples using this model
+++++++++++++++++++++++++
.. listexamples:: correlation_detector