In neuroscience one often wants to evaluate, how similar or dissimilar pairs or even large sets of spiketrains are. For this purpose various different spike train dissimilarity measures were introduced in the literature. They differ, e.g., by the properties of having the mathematical properties of a metric or by being time-scale dependent or not. Well known representatives of spike train dissimilarity measures are the Victor-Purpura distance and the Van Rossum distance implemented in this module, which both are metrics in the mathematical sense and time-scale dependent.
elephant.spike_train_dissimilarity.
van_rossum_dist
(trains, tau=array(1.) * s, sort=True)[source]¶Calculates the van Rossum distance.
It is defined as Euclidean distance of the spike trains convolved with a causal decaying exponential smoothing filter. A detailed description can be found in Rossum, M. C. W. (2001). A novel spike distance. Neural Computation, 13(4), 751-763. This implementation is normalized to yield a distance of 1.0 for the distance between an empty spike train and a spike train with a single spike. Divide the result by sqrt(2.0) to get the normalization used in the cited paper.
Given spike trains with
spikes on average the run-time
complexity of this function is
.
Parameters: | trains : Sequence of
tau : Quantity scalar
sort : bool
|
---|---|
Returns: | 2-D array
|
elephant.spike_train_dissimilarity.
victor_purpura_dist
(trains, q=array(1.) * Hz, kernel=None, sort=True, algorithm='fast')[source]¶Calculates the Victor-Purpura’s (VP) distance. It is often denoted as
.
It is defined as the minimal cost of transforming spike train a into spike train b by using the following operations:
- Inserting or deleting a spike (cost 1.0).
- Shifting a spike from
to
(cost
).
A detailed description can be found in Victor, J. D., & Purpura, K. P. (1996). Nature and precision of temporal coding in visual cortex: a metric-space analysis. Journal of Neurophysiology.
Given the average number of spikes in a spike train and
spike trains the run-time complexity of this function is
and
memory will be needed.
Parameters: | trains : Sequence of
q: Quantity scalar
kernel: :class:`.kernels.Kernel`
sort: bool
algorithm: string
|
---|---|
Returns: | 2-D array
|