elephant.functional_connectivity.total_spiking_probability_edges

elephant.functional_connectivity.total_spiking_probability_edges(spike_trains: BinnedSpikeTrain, surrounding_window_sizes: List[int] | None = None, observed_window_sizes: List[int] | None = None, crossover_window_sizes: List[int] | None = None, max_delay: int = 25, normalize: bool = False)[source]

Estimate the functional connectivity and delay times of a neural network using Total Spiking Probability Edges (TSPE).

This algorithm uses a normalized cross correlation between pairs of spike trains at different delay times to get a cross-correlogram. Afterwards, a series of convolutions with multiple edge filters on the cross-correlogram are performed, in order to estimate the connectivity between neurons and thus allowing the discrimination between inhibitory and excitatory effects.

The default window sizes and maximum delay were optimized using in-silico generated spike trains.

Background:

  • On an excitatory connection the spike rate increases and decreases again due to the refractory period which results in local maxima in the cross-correlogram followed by downwards slope.

  • On an inhibitory connection the spike rate decreases and after refractory period, increases again which results in local minima surrounded by high values in the cross-correlogram.

  • An edge filter can be used to interpret the cross-correlogram and accentuate the local maxima and minima

Procedure:

  1. Compute normalized cross-correlation \(NCC\) of spike trains of all neuron pairs.

  2. Convolve \(NCC\) with edge filter \(g_{i}\) to compute \(SPE\).

  3. Convolve \(SPE\) with corresponding running total filter \(h_{i}\) to account for different lengths after convolution with edge filter.

  4. Compute \(TSPE\) using the sum of all \(SPE\) for all different filter pairs.

  5. Compute the connectivity matrix by using the index of the TSPE values with the highest absolute values.

Normalized Cross-Correlation:

\[NCC_{XY}(d) = \frac{1}{N} \sum_{i=-\infty}^{\infty}{ \frac{ (y_{(i)} - \bar{y}) \cdot (x_{(i-d)} - \bar{x}) }{ \sigma_x \cdot \sigma_y }}\]

Edge Filter

\[g_{(i)} = \begin{cases} - \frac{1}{a} & 0 \lt i \leq a \ \ \frac{2}{b} & a+c \lt i \leq a + b + c \ \ - \frac{1}{a} & a+b+2c \lt i \leq 2a + b + 2c \ \ 0 & \mathrm{otherwise} \end{cases}\]

where \(a\) is the parameter surrounding_window_size, \(b\) observed_window_size, and \(c\) is the parameter crossover_window_size.

Spiking Probability Edges

\[SPE_{X \rightarrow Y(d)} = NCC_{XY}(d) * g(i)\]

Total Spiking Probability Edges:

\[TSPE_{X \rightarrow Y}(d) = \sum_{n=1}^{N_a \cdot N_b \cdot N_c} {SPE_{X \rightarrow Y}^{(n)}(d) * h(i)^{(n)} }\]

(De Blasi et al., 2019)

Parameters:
spike_trains(N, ) elephant.conversion.BinnedSpikeTrain

A binned spike train containing all neurons for connectivity estimation

surrounding_window_sizesList[int]

Array of window sizes for the surrounding area of the point of interest. This corresponds to parameter a of the edge filter in (De Blasi et al., 2019). Value is given in units of the number of bins according to the binned spike trains spike_trains. Default: [3, 4, 5, 6, 7, 8]

observed_window_sizesList[int]

Array of window sizes for the observed area. This corresponds to parameter b of the edge filter and the length of the running filter as defined in (De Blasi et al., 2019). Value is given in units of the number of bins according to the binned spike trains spike_trains. Default: [2, 3, 4, 5, 6]

crossover_window_sizesList[int]

Array of window sizes for the crossover between surrounding and observed window. This corresponds to parameter c of the edge filter in (De Blasi et al., 2019). Value is given in units of the number of bins according to the binned spike trains spike_trains. Default: [0]

max_delayint

Defines the max delay when performing the normalized cross-correlations. Value is given in units of the number of bins according to the binned spike trains spike_trains. Default: 25

normalizebool, optional

Normalize the output [experimental]. Default: False.

Returns:
connectivity_matrix(N, N) np.ndarray

Square matrix of the connectivity estimation between neurons. Positive values describe an excitatory connection while negative values describe an inhibitory connection.

delay_matrix(N, N) np.ndarray

Square matrix of the estimated delay times between neuron activities.