Deconvolution improves the detection and quantification of spike transmission gain from spike trains

Accurate detection and quantification of spike transmission between neurons is essential for determining neural network mechanisms that govern cognitive functions. Using point process and conductance-based simulations, we found that existing methods for determining neuronal connectivity from spike times are highly affected by burst spiking activity, resulting in over- or underestimation of spike transmission. To improve performance, we developed a mathematical framework for decomposing the cross-correlation between two spike trains. We then devised a deconvolution-based algorithm for removing effects of second-order spike train statistics. Deconvolution removed the effect of burst spiking, improving the estimation of neuronal connectivity yielded by state-of-the-art methods. Application of deconvolution to neuronal data recorded from hippocampal region CA1 of freely-moving mice produced higher estimates of spike transmission, in particular when spike trains exhibited bursts. Deconvolution facilitates the precise construction of complex connectivity maps, opening the door to enhanced understanding of the neural mechanisms underlying brain function.

N eurons in the brain act as information gates, each receiving inputs from thousands of different sources and deciding which to pass on to other neurons. The capability of transmitting relevant inputs to other cells is at the very core of sensory processing, action, and cognition. One way for investigating how information is transmitted between two neurons is to measure the postsynaptic potential (PSP) in one cell following a spike of a presynaptic cell [1][2][3] . When excitatory PSP (EPSP) magnitude is larger, the probability that the postsynaptic neuron will fire following a presynaptic spike is higher 2 . However, EPSP magnitude is affected not only by synaptic strength, but also by the instantaneous membrane potential of the postsynaptic neuron 4 . Moreover, even constant EPSP magnitude cannot predict whether a postsynaptic neuron will fire after a presynaptic spike. When an EPSP is generated at lower membrane potentials, cells are less likely to fire 5 . Thus, EPSP magnitude alone is insufficient for determining whether a postsynaptic neuron will fire following a presynaptic spike, thereby allowing information to pass on to other cells.
An alternative approach for determining connectivity between two neurons is to directly quantify whether presynaptic spikes generate spikes in the postsynaptic neuron. The spike-to-spike cross-correlation histogram (CCH) [6][7][8] has been used for measuring the transmission of spikes between two neurons [9][10][11] . However, most CCH applications employ spontaneous spiking, and are therefore correlative measurements which cannot differentiate causal transmission from non-causal spike patterns. For example, firing of two cells may be co-modulated by another source such as visual input or a third neuron, causing the two cells to fire in synchrony 12 . Thus, the CCH is influenced not only by spike transmission properties but also by co-modulation of the pre-and postsynaptic trains [13][14][15] .
To differentiate between direct spike transmission due to interneuronal coupling and other indirect sources, several methods have been proposed [16][17][18][19][20] . An underlying assumption in these approaches is that while direct connections exhibit fast transients in the CCH, indirect sources produce slower fluctuations. Based on this assumption, timescale separation can be used to detect and estimate synaptic connectivity, differentiating between fast transients (which are presumably due to direct connectivity), and slower fluctuations (which are presumably due to other sources). Indeed, when timescale separation methods are employed, spike transmission measurements derived from casual methods are consistent with measures derived from spontaneous spiking CCHs 21 . However, it is still unclear to what extent timescale separation methods can differentiate between transmitted spikes and third-party, synchronous spiking. Moreover, the CCH is influenced not only by the interaction between the pre-and postsynaptic spike trains, but also by the spiking activity pattern of each neuron 8 . When one of two connected neurons exhibits high-frequency periodicity or burst spiking, fast features appear in the CCH 22,23 . These features cannot be differentiated from transmitted spikes by timescale separation. Thus, even when timescale separation methods are used, transmitted spikes cannot be fully differentiated from non-transmission patterns such as burst spiking activity.
To remove non-transmission features from the CCH and improve the estimation of functional connectivity from spike trains, we formulated a mathematical framework for CCH composition. We found that the CCH can be expressed as a sum of three distinct elements. Based on this finding, we developed a deconvolution-based algorithm for removing second-order spike train statistics from the CCH. Using deconvolution in concert with timescale separation methods removed the effect of burst spiking, improving the accuracy of both detection and quantification of neuronal connectivity in synthetic data. Consistent with simulation results, application to neuronal data recorded from CA1 of freely-moving mice showed that deconvolution increased estimates of spike transmission, in particular when the spike trains exhibited bursts.

Results
Spike transmission gain between two neurons can be accurately estimated from spike-to-spike cross-correlation. Neurons can transmit spiking information to other neurons via different connections including chemical synapses (e.g., AMPA, GABA, NMDA, or other receptors) 24,25 , electrical synapses (gap junctions) 26 , or ephaptic coupling (electromagnetic fields) 27 . Whether spiking information will propagate in the brain depends on the effective connectivity between neurons. When membrane potentials are accessible, connectivity between two neurons can be quantified by the magnitude of the EPSP in the postsynaptic neuron following a single presynaptic spike [1][2][3] . However, EPSP magnitude does not indicate whether the postsynaptic neuron will pass information onward to other neurons in the form of spikes. Alternatively, the spike trains themselves may be used for estimating the effective connectivity between two neurons, defined here as spike transmission.
To determine the relations between EPSP-based estimates and spike transmission, we simulated a two-cell network in which coupling strength was varied (Fig. 1). The presynaptic neuron exhibited Poisson spiking modified by a 2 ms refractory period (λ 1 = 5 spk/s). The postsynaptic neuron was modeled as a conductance-based leaky integrate and fire (LIF) neuron. In the lack of connectivity, the postsynaptic neuron did not emit any spikes when membrane potential variability, quantified using σ, was low (Fig. 1a). When σ was increased, spontaneous spike rate increased monotonically (Fig. 1a). Specifically, in the range of noise observed in intact preparations (σ < 4 mV) 5,28 , spike rate was in the range observed in freely-moving animals (<25 spk/s) 29 .
Next, we connected the pre-and postsynaptic neurons via a synaptic conductance. Conductance magnitude was calibrated to produce unitary EPSPs (uEPSPs) in the range of 0-2 mV, as observed in vivo 2,28,30,31 . When membrane potential variability was low (σ < 2 mV), even the stronger uEPSPs failed to generate postsynaptic spiking. However, when σ was higher (2-4 mV), uEPSPs of the same magnitude induced postsynaptic spikes in addition to the spontaneous noise-induced spikes (Fig. 1b, red curve). To quantify effective connectivity, we defined "real spike transmission gain" (rSTG) as the number of extra postsynaptic spikes generated following every presynaptic spike. In the range of biologically-relevant noise, rSTG increased monotonically with σ. Furthermore, for every σ, rSTG increased monotonically with uEPSP magnitude (Fig. 1b, top inset). While even relatively-large EPSPs fail to produce postsynaptic spikes in the lack of membrane potential variability, weaker EPSPs (0.2-1 mV) could induce consistent spiking when noise was sufficiently high. Moreover, the uEPSP magnitude required to generate a fixed rSTG decreased monotonically with σ (Fig. 1b, bottom inset). Thus, EPSP magnitude alone does not suffice for estimating spike transmission.
To determine whether effective connectivity associated with weak EPSPs can be detected from spike timing alone, we constructed CCHs for pre-and postsynaptic spike train pairs (Fig. 1c). We defined the "spike transmission curve" (STC) as the impulse response of spike transmission between the pre-and postsynaptic neurons. Empirically, an estimated STC (eSTC) can be determined by the difference between the CCH and the baseline. Here, we defined the baseline using the "tails" predictor, namely the CCH count at longer time lags (|τ| ≥ 11 ms). We then defined the estimated STG (eSTG) as the area under the STC peak in a temporal region of interest (ROI; defined here as 0 < τ ≤ 5 ms 32 ; Fig. 1c, gray bins), divided by the number of presynaptic spikes. For an STC below baseline, the STG is a negative quantity. Previous studies have referred to the STG using various other names: "effectiveness" 33 , "asynchronous gain" 34 , "synaptic efficacy" 11 , and "spike transmission probability" 21,32 . For the CCH in Fig. 1c, generated using relatively weak EPSPs (0.6 mV; σ = 3.4 mV), the eSTG (0.032) was of the same order of magnitude as the rSTG (0.028, 116%; Fig. 1c). Considering all non-zero rSTG values, the mean eSTG error (eSTG-rSTG)/rSTG, was 2.5% (456 spike train pairs with non-zero rSTG; smaller than 5%, p < 0.05, one-tailed Wilcoxon's signed-rank test; Fig. 1d). Thus, the STG estimated from the CCH between spike trains closely matches the real spike transmission gain.  Fig. 1 Spike transmission between two neurons can be estimated from spike times. a Increased membrane potential variability increases spontaneous spiking. A leaky integrate and fire (LIF) model neuron was simulated with different levels of membrane potential variability, quantified by the noise SD, σ (n = 6 repetitions for each of n = 11 σ values, from 0 to 5 mV with 0.5 mV increments; each 180 min). The firing rate (λ 2 ) of the simulated neuron is shown for each σ value; here and in (b), error bands indicate SEM. The trace next to the cartoon shows 300 ms of simulated membrane potential, and the histograms show the distribution of membrane potentials (σ = 3 mV). b Even small-magnitude EPSPs induce observable spike transmission gain in the presence of noise. The simulated LIF neuron (2) was driven via an excitatory synapse by a presynaptic neuron (1) with Poisson spiking (λ 1 = 5 spk/s) modified by refractoriness. Synaptic conductance was modified to yield n = 11 different unitary EPSP (uEPSP) magnitudes (from 0 to 2 mV with 0.2 mV increments), and the real spike transmission gain (rSTG) was computed for every σ and uEPSP combination (n = 121). Both uEPSP magnitude and membrane potential variability control spike transmission. c A cross-correlation histogram (CCH; bins size: 1 ms) was computed from a pair of simulated spike trains as in (b); σ = 3.4 mV, uEPSP magnitude = 0.6 mV. For deriving an estimated STG (eSTG) from the CCH, the level of baseline joint counts (blue line) was first estimated using the "tails" predictor, averaging CCH values at time lags |τ| ≥ 11 ms. The spike transmission curve (STC; black line) was estimated as the above-baseline curve with a peak in the temporal region of interest (ROI; defined here as 0 < τ ≤ 5 ms; gray bins), with zeros in all other bins. The eSTG is the area under the estimated STC. d Spike transmission gain estimated from the CCH is an accurate estimate of the real STG. For every simulation run (n = 6 repetitions for each of 121 σ and uEPSP combinations), rSTGs and eSTGs were computed. Different colors correspond to different uEPSP magnitudes as in (b), and the black circle corresponds to the example in (c). Spearman's correlation coefficient between eSTG and rSTG is ρ = 0.94 (n = 726 random samples, p < 0.001, permutation test). The cross-correlation between two spike trains can be expressed as a sum of three elements. The foregoing discussion (and Fig. 1) focused on a specific configuration in which the presynaptic spike train was generated via a homogenous Poisson process modified by refractoriness. Furthermore, all statistical dependencies between the two spike trains were captured by a single modeled synapse. In general, dependencies within and between spike trains may be richer (Fig. 2a). Individual spike trains typically deviate from Poisson processes, conforming to higher-order gamma processes or exhibiting spike bursts 35,36 . Connectivity between neurons is often not purely feedforward, exhibiting reciprocal excitation 1 or feedback inhibition 37,38 . Furthermore, dependencies between two spike trains may result from covariance of other inputs to the two neurons 6,8,14,39 rather than from synaptic connections between the neurons. These and other possible sources of complexity give rise to the observed spike trains (Fig. 2b) from which the CCH is derived (Fig. 2c). Therefore, the STC estimated from a pair of spike trains is generally not identical to the real STC. As a direct consequence, the eSTG is not identical to the rSTG.
In general, the STC is not necessarily identical to the difference between the CCH and the baseline. However, if the STC is fixed (more precisely, if the system is linear time-invariant), there is an exact mathematical dependency between the STC and the CCH. In the absence of external input to the postsynaptic neuron, all postsynaptic spikes (s 2 ) are due to spontaneous presynaptic spikes (s 0 1 ). In that case, the CCH is identical to the convolution (*) between the spike-to-spike auto-correlation histogram (ACH) of neuron 1 spikes, and the STC from neuron 1 to neuron 2 ( Fig. 2d): When external input is added to the postsynaptic neuron (s 0 2 ), the CCH is equal to the sum of the above convolution and the Other inputs STC12 b c a Fig. 2 The cross-correlation between two spike trains can be expressed as a sum of three elements. a Cartoon of two neurons, driven by external sources and coupled by reciprocal excitatory and inhibitory monosynaptic connections. In the example, both neurons exhibit spiking activity which deviates from a Poisson process: the excitatory neuron exhibits burst spiking, and the inhibitory neuron exhibits second-order gamma spiking activity. b The spike trains of the two neurons result from all of these (and possibly other) sources. c An example CCH created from the synthetic spike trains described in (a, b). The rSTG is 0.04, whereas the eSTG provides an inaccurate estimate (0.054; 135%). The example demonstrates that in the presence of complex dynamics, the STG cannot be estimated accurately by the "tails" method. d The CCH between two coupled spike trains, s 1 and s 2 , can be expressed as a sum of three elements. The first element is the convolution of the auto-correlation histogram of the first train (ACH 1 ) with the STC from neuron 1 to neuron 2 (STC 21 ). The second element, denoted as "other inputs", is equal to the cross-correlation between the uncoupled spike trains. The third element is the convolution of ACH 2 with STC 12 . e Based on the composition (d), a decomposition procedure may recover the other inputs and the two STCs from the CCH. cross-correlation (⋆) between the spike trains which are not due to the direct connectivity: When the connectivity between the neurons is bidirectional, and external (possibly correlated) inputs are added to both neurons, the CCH can be approximated as a sum of three elements: The approximation is valid as long as the product of the two STGs (i.e., the loop gain) is small. Thus, a CCH can be described as a sum of three elements: (1) the convolution between the ACH of neuron 1 and the impulse response from neuron 1 to neuron 2; (2) the convolution between the ACH of neuron 2 and the impulse response from neuron 2 to neuron 1; and (3) the crosscorrelation between the background spike trains, those not due to direct connectivity between the two neurons. The last expression has the conceptual benefit of opening the loop, effectively describing a feedback system (Fig. 2a) as a feedforward system using an arithmetic decomposition (Fig. 2e). Moreover, understanding that the CCH is a sum of three elements allows reconstructing hidden elements, namely the STCs, from the CCH using numerical methods.
Deconvolution eliminates burst spiking effects and enables accurate STG and PSP estimation. To estimate inter-neuronal effective connectivity from spike trains, several methods have been proposed 20,32,[40][41][42] . These and other procedures rely on the concept of timescale separation, in which processes that occur at fast timescales (e.g., monosynaptic spike transmission) are distinguished from processes occurring at slower timescales (e.g., comodulated other inputs, such as external inputs or network oscillations). However, in addition to other inputs, the CCH is comprised of the convolution products of each ACH with the corresponding STC (Fig. 2d), which occur at fast timescales. Hence, even if an optimal estimate of the other inputs is removed, a CCH between two synaptically-connected neurons will still contain contributions from the ACHs of each neuron.
To demonstrate the effect of second-order spike train statistics on connectivity estimation, we simulated two spike trains coupled by an excitatory monosynaptic connection (rSTG = 0.04; 833 min; Fig. 3a-c). The spike train of the presynaptic neuron was initially simulated as a Poisson process modified by an absolute refractory period (ARP; ARP 1 = 2 ms; λ 1 = 2 spk/s), and exhibited bursting activity (Fig. 3b). The extent of bursting was controlled by a "burst fraction" (BR) parameter, defined as the probability of each spike to be followed by another spike within a short inter-spike interval (3-7 ms). BR was set to 0.4. The spike train of the postsynaptic neuron realized a second-order gamma process modified by refractoriness (λ 2 = 8 spk/s; ARP 2 = 2 ms; Fig. 3a). Consistent with the construction, the CCH between the coupled spike trains exhibited a peak within the causal ROI (Fig. 3c). In addition, the CCH exhibited side lobes: secondary peaks with increased counts on both sides of the causal peak, which are due to the bursting activity of the presynaptic neuron. Similar patterns were previously reported in real datasets 22 .
To quantify the effect of the ACH on the estimation of effective connectivity, we used five different methods: tails, jitter, median, GLMCC 40 , and CoNNECT 41 . While the tails, jitter, and median filtering methods yield estimates of effective connectivity measured as gain (STG; Fig. 1), the GLMCC and CoNNECT methods produce estimates in units of mV (PSP). The estimates yielded by the PSP-based methods cannot be gauged directly in the case of the synthetic CCH depicted in Fig. 3c, since no ground truth for PSP exists in the point process simulations. The tails predictor overestimated the rSTG (eSTG = 0.053, 133%; Fig. 3d), and the jitter and median predictors underestimated the rSTG (jitter: 0.023, 58%; median filtering: 0.028, 70%). Thus, when burst spiking activity is present, the tails, jitter, and median methods fail to produce an accurate eSTG.
For accurate estimation of effective connectivity from the CCH in the presence of arbitrary second-order spike train statistics (e.g., bursting or periodicity), we developed a deconvolution algorithm that takes advantage of the CCH mathematical properties described in Fig. 2d, e. In a nutshell, the algorithm mitigates the effect of bursting activity by deconvolving the ACHs from the CCH, resulting in a CCH which does not exhibit ACHinduced side lobes (Fig. 3f). The outcome is a "deconvolved CCH" (dcCCH). The dcCCH still includes the additive effect of other inputs (Fig. 2d). However, the other inputs element can be estimated using timescale separation methods and removed by subtraction. Thus, deconvolving the ACHs from the CCH before applying timescale separation removes ACH artifacts, and may improve connectivity estimates.
To test whether deconvolution indeed improves STG/PSP estimation, we first applied the algorithm to the CCH and ACHs of Fig. 3a-c and re-estimated the STG and PSP from the resulting dcCCH (Fig. 3g). Compared to the estimates derived from the CCH (Fig. 3d, e), all STG estimates based on the dcCCH were improved (Fig. 3h), and both PSP estimates were higher (Fig. 3i). Specifically, the tails predictor yielded an eSTG of 0.0408 (102% of the rSTG); the jitter predictor underestimated the rSTG (0.0276, 69%); and median filtering yielded an eSTG of 0.0392 (98%; Fig. 3h). We then carried out simulations in which the presynaptic burst fraction was varied in an orderly manner (from 0 to 0.4 with 0.05 increments; rSTG = 0.04; 30 repetitions each; other parameters were kept the same as in Fig. 3a-c). For each simulation, estimated STGs and PSPs were computed from the CCH and dcCCH using all five methods (Fig. 3j, k). For the tails, jitter, and median predictors, eSTGs derived from the dcCCH were more accurate than the eSTGs derived from the CCH when burst fractions were above 0.15 (p < 0.001, Mann-Whitney Utest). For the GLMCC method, only the PSP estimations derived from the raw CCH depended on the burst fraction (GLMCC without deconvolution: p < 0.001; with deconvolution: p = 0.13; permutation test). For comparing STG and PSP-based estimates, we used the normalized slope of the best linear fit, after dividing all values by the mean estimates at zero burst fraction. With the exception of CoNNECT, deconvolution reduced the effect of bursting for all methods (p < 0.001, bootstrap test; Fig. 3l). Thus, in the presence of burst spiking activity, deconvolution improves STG and PSP estimation of excitatory monosynaptic connections.
Second, to test whether deconvolution also improves the estimation of inhibitory monosynaptic connections, we repeated the simulations of Fig. 3g-l with inhibitory connections (rSTG = −0.02; Fig. 3m-r). The spike train of the presynaptic neuron realized a second-order gamma process modified by refractoriness (λ 1 = 8 spk/s; ARP 1 = 2 ms). The spike train of the postsynaptic neuron was simulated as a Poisson process modified by refractoriness (λ 2 = 2 spk/s; ARP 2 = 2 ms) which also exhibited bursting activity, varied in an orderly manner. For the tails, jitter, and median predictors, eSTGs derived from the dcCCH were more accurate than the eSTGs derived from the CCH when burst fractions were above 0.15 ( Fig. 3p; p < 0.001, U-test). We then computed the normalized slope of the best linear fits (Fig. 3r). For all methods except CoNNECT, deconvolution reduced the effect of bursting (tails, jitter, median: p < 0.001; GLMCC: p = 0.015; bootstrap test). Thus, in the presence of burst spiking activity, deconvolution improves STG and PSP estimation for inhibitory monosynaptic connections.
Third, to test whether deconvolution improves the estimation in the case of two directly-connected neurons which both exhibit bursty behavior, we simulated two bursting neurons coupled by a monosynaptic excitatory connection (rSTG = 0.04; Fig. 3s-u). The burst fraction of the postsynaptic neuron was 0.1 (Fig. 3s), and the burst fraction of the presynaptic neuron was varied from 0 to 0.4 with 0.05 increments. For every simulation, we estimated STGs and PSPs from the CCH and dcCCH using all five methods ( Fig. 3u-x). We found that for the tails, jitter, and median predictors, eSTGs derived from the dcCCH were more accurate than eSTGs derived from the CCH for burst fractions above 0.1 (p < 0.001, U-test). For the CoNNECT method, only the ePSPs Fig. 3 In the presence of spike bursts, deconvolution enables accurate recovery of spike transmission gain. a-e Simulated spike trains of two neurons coupled by an excitatory monosynaptic connection. a ACH of the postsynaptic neuron. b ACH of the presynaptic neuron, exhibiting bursting activity. "Burst fraction" (BR; the probability of each spike to be first in a burst) is 0.4. c CCH between the two neurons. In addition to a peak within the causal ROI (0< τ ≤5 ms), the CCH exhibits side lobes which are due to the burst spiking of the presynaptic neuron. d Conditional rate histograms, derived from the CCH in (b). e CCH with slow (black) and fast GLM coupling filters (pink and gray). f Burst spiking affects the ACH (b) and the CCH (c) and causes inaccurate STG estimates (d). The scheme illustrates the deconvolution process for removing ACH artifacts from the raw CCH. g A deconvolved CCH (dcCCH; green) is derived from the ACHs (a, b) and CCH (c). The dcCCH is free from the effect of spike bursts, recovering the unidirectional spike transmission curve STC 21 used in the simulation. h Conditional rate histograms. i dcCCH with PSPs estimated by the CoNNECT and GLMCC methods. j, k CCH deconvolution improves STG estimation in the presence of burst spiking. Spike trains coupled by an excitatory monosynaptic connection were simulated while modifying BR (n = 30 repetitions at n = 9 BR values, from 0 to 0.4 with 0.05 increments). j eSTG-to-rSTG ratio as a function of BR for the three STG estimation methods using CCHs (solid lines) and using dcCCHs (dashed lines). In the presence of bursting, deconvolution improves STG estimation. k Estimated PSP as a function of burstiness for the CoNNECT and GLMCC methods using CCHs and dcCCHs. l Normalized slope of the best linear fit of the curves in (j, k). Error bars, SEM. With the exception of CoNNECT, deconvolution reduces the effect of bursting for all methods (n = 270 random samples; n.s./***p > 0.05/p < 0.001, bootstrap test, n = 300 iterations). m-o Spike trains were coupled by an inhibitory monosynaptic connection. m Example CCH. n dcCCH for the same example. o dcCCH with slow GLM (black) and fast GLM coupling filters (pink and gray). p, q Same as (j, k), for simulated inhibitory connections (n = 30 repetitions at every BR value). r Same as (l), for inhibitory connections (n = 270 random samples; n = 300 bootstrap iterations). s-v Two spike trains with bursts were coupled by an excitatory monosynaptic connection. s ACH of the postsynaptic neuron (BR = 0.1). t ACH of postsynaptic neuron (BR = 0.4). u CCH of the two neurons. v dcCCH for the CCH in (u). w, x Same as (j, k), for two spike trains with bursts (n = 30 repetitions at every BR value). y Same as (l), for two spike trains with bursts (n = 270 random samples; n = 300 bootstrap iterations). ARTICLE COMMUNICATIONS BIOLOGY | https://doi.org/10.1038/s42003-022-03450-5 derived from the raw CCH depended on the burst fraction (without deconvolution: p = 0.01; with deconvolution: p = 0.053; permutation test). For comparing STG and PSP-based estimates, we used the normalized slope of the best linear fit, after dividing all values by the mean estimates at zero burst fraction. Deconvolution reduced the effect of bursting for all methods (CoNNECT: p = 0.025; all other methods: p < 0.001, bootstrap test; Fig. 3y). Thus, when both neurons exhibit burst spiking activity, the deconvolution improves STG and PSP estimation.
Deconvolution improves effective connectivity estimation and detection. To evaluate the contribution of deconvolution to the performance of the various methods in a more realistic, noisy scenario, we generated 1250 individual neuronal pairs. Connectivity strengths, burst fractions, co-modulation, and recording durations were varied widely between pairs (Fig. 4a). A thousand pairs were generated with either an excitatory or inhibitory connection, and 250 pairs were unconnected. For the excitatory and inhibitory pairs, connection strengths were drawn randomly from a log-normal distribution [43][44][45] (mean ± SD excitatory rSTG: 0.019 ± 0.01; inhibitory: −0.014 ± 0.007; Fig. 4b). Burst fractions were drawn randomly from a uniform distribution in the [0 0.4] range. Recording duration was set randomly between 90 min and five hours.
First, we compared estimation performance with and without deconvolution by computing the mean square error (MSE) for the STG-based methods, for which a ground truth exists ( Fig. 4c-e). We found that deconvolution reduced the MSE for all STG-based methods (p < 0.001; Wilcoxon's paired signed-rank test; Fig. 4h). Of the three STG-based methods, median filtering with Connectivity strengths (rSTG), burst fractions, co-modulation, and recording durations were varied between pairs. a Example CCHs from the noisy point process simulations, sorted by rSTG values. BR, burst fraction. b Empirical distribution of the n = 500 excitatory (red) and n = 500 inhibitory (blue) rSTGs of the pairs used in the simulations. c-g STGs or PSPs are plotted against the ground truth (rSTG) for dcCCHs (n = 1000 connected pairs), estimated using the tails (c), jitter (d), median (e), GLMCC (f), and CoNNECT (g) methods. Colored (or gray) dots depict estimated STGs or PSPs which were (or were not) detected as connections. In all methods (except CoNNECT), the significance threshold used was α = 0.001. In (c-e), solid black lines represent perfect estimation (i.e., eSTG = rSTG). h Mean square errors (MSE) for the STG-based methods, in which the ground truth and the estimates have the same units. Error bars, SEM. Deconvolution reduces the MSE for all STG-based methods (n = 1000 connected pairs; ***p < 0.001, Wilcoxon's paired signed-rank test). The smallest errors are obtained for median filtering with deconvolution. i-m STG (i-k; or PSP, l, m) ratio as a function of burst fraction. STG ratio is defined as the STG estimated from the CCH, divided by the STG estimated from the dcCCH. The PSP ratio is defined in an analogous manner. For all methods except CoNNECT, deconvolution reduces the effect of burstiness. n Slope of best linear fit, computed for (i-m) (n = 1000 connected pairs; n.s./***p > 0.05/p < 0.001, bootstrap test, n = 300 iterations). o-t Effect of deconvolution on detection. . Median without deconvolution and jitter with deconvolution had the second and third lowest MSEs, respectively (median: 2.73 × 10 −5 ; jitter with deconvolution: 3.48 × 10 −5 ; jitter: 5.34 × 10 −5 ). Thus, deconvolution reduced the errors approximately two-fold. To evaluate the effect of deconvolution for all five methods, we computed the estimated STG (or PSP) ratio for both excitatory and inhibitory connections. For the "tails" method, the eSTG ratio increased with burst fraction (ρ = 0.297, p < 0.001, permutation test; Fig. 4i). For the jitter, median, and GLMCC methods, the estimated STG (or PSP) ratio decreased as burst fraction increased (p < 0.001, permutation test; Fig. 4j-l). For all methods (except CoNNECT), the slope of the estimated STG (or PSP) ratio was different from zero (p < 0.001, bootstrap test; Fig. 4n). Together, the reduction of the MSE (Fig. 4h) and the correlation between estimated STG (or PSP) ratio and burst fraction (Fig. 4n) show that deconvolution reduces the effect of burst spiking and improves connectivity estimation.
Second, we compared detection performance for all methods ( Fig. 4o-t). We used an f 1 score that combines the effect of falsepositive (FP) and false-negative (FN) rates across multiple populations (excitatory and inhibitory connections; Fig. 4t). Both the median and GLMCC, when employed with α = 0.001, yielded low FP rates for excitatory and inhibitory connections. For median filtering, the FP rate for excitatory connections with/ without deconvolution was 0.002/0.0012; for inhibitory connections, the FP rates (with and without deconvolution) were 0.0004 (Fig. 4q). For the GLMCC method, the FP rates for the excitatory connections with and without deconvolution were zero; for inhibitory connections, deconvolution improved the FP rate from 0.0004 to zero (Fig. 4r). Overall, deconvolution improved detection performance for the tails, median, and GLMCC methods (p < 0.001, bootstrap test; Fig. 4t). Of all methods, GLMCC with deconvolution yielded the highest f 1 score Deconvolution improves connection quantification and detection in networks of conductance-based CA1 model neurons. The noisy point process simulations (Fig. 4) contained welldefined ground truth rSTGs, and generated CCHs that exhibited complex features and multiple types of spike-to-spike interactions. However, the point process simulations were limited to two-neuron "networks" with feedforward connectivity and may not exhibit other features, produced in larger-scale networks with reciprocally-connected neurons. To examine the contribution of deconvolution in such settings, we conducted simulations of noisy networks of conductance-based CA1 model neurons. In these simulations, the excitatory neurons (E-cells) were modeled using spiking models that allow incorporating graded bursting behavior (Fig. 5a). Bursting was controlled by a "burst factor" (BF) parameter, set to be between −42 mV (lower bursting activity) and −35 mV (higher bursting activity). Inhibitory neurons (I-cells) did not exhibit spontaneous bursting. In each simulation, a hundred-neuron network was constructed by connecting 80 E-cells and 20 I-cells. Connectivity patterns were implemented as often assumed for CA1, with E-to-I, I-to-E, and I-to-I connections, but without E-to-E connections 46 . The E-and I-cell ACHs produced under these conditions (Fig. 5b, c) are similar to those observed for pyramidal cells (PYR) and interneurons (INT) in real CA1 data (Fig. 6).
To focus on the contribution of deconvolution, we chose to use a single timescale separation method from this point onward. Of the STG-based methods, median filtering yielded the best performance, with respect to both quantification (Fig. 4h) and detection (Fig. 4t). Run times were tested on synthetic spike trains with firing rates of 2 and 8 spk/s, recorded over 5 h. . These runtimes and performance made median filtering our method of choice for evaluating the contribution of deconvolution in biophysical simulations (Fig. 5) and in real data (Fig. 6).
To investigate how burst spiking activity affects STG estimation of pairs embedded in a neuronal network and whether deconvolution can improve STG estimation, we first conducted fixed-strength simulations. Every E-cell was connected randomly to one I-cell with a fixed excitatory synaptic conductance (Gie = 0.055 mS/cm 2 ), and every I-cell was connected randomly to one E-cell and to one other I-cell with a fixed inhibitory conductance (Gei = 0.25 mS/cm 2 ; Fig. 5d). Burstiness was randomized. Although E-to-I connection strengths were the same for all pairs, median filtering without deconvolution yielded eSTGs which were highly affected by the BF (ρ = −0.68, p < 0.001, permutation test; Fig. 5e). In contrast, median filtering with deconvolution produced eSTGs that were not correlated with burstiness (ρ = −0.18, p = 0.11, permutation test; Fig. 5f). The ratio between eSTGs without and eSTGs with deconvolution was close to one when BF was low (−42 mV) and gradually decreased as BF increased (ρ = 0.891, p < 0.001, permutation test, Fig. 5g). The eSTG ratio for the I-to-E connections showed a similar trend, in which the eSTG ratio was negatively correlated with the BF (ρ = −0.835, p < 0.001, permutation test; Fig. 5h). Thus, even when connections have fixed strengths, the eSTGs depend on burst spiking activity. However, dependency is minimized using deconvolution.
To evaluate the contribution of deconvolution in a more heterogenous setting, we generated networks of conductancebased CA1 model neurons with varied connectivity strengths (drawn randomly from log-normal distributions; Fig. 5i). Other parameters were the same as in Fig. 5d-h. Over six hundredneuron networks, the mean [SEM] f 1 score obtained with deconvolution was 0.89 [0.008], higher than f 1 without deconvolution (0.84 [0.009]; p < 0.001, bootstrap test; Fig. 5j-m). In addition to improved detection, deconvolution yielded eSTG estimates which were higher than eSTG estimates without deconvolution, especially when bursting was prevalent (Fig. 5n-s). eSTG ratios for the E-to-I and I-to-E connections were negatively correlated with BF (E-to-I: ρ = −0.88, p < 0.001, permutation test, Fig. 5p; I-to-E: ρ = −0.837, p < 0.001; Fig. 5s). Thus, in synthetic neuronal networks, deconvolution improves both the detection and quantification of inter-neuronal connectivity.
In real neuronal data, deconvolution-based estimates of spike transmission gain are especially higher when burst spiking is prevalent. To test the contribution of deconvolution to the analysis of real neuronal data, we obtained data from freely-moving mice. The dataset consisted of 1041 PYR and 215 INT recorded using high-density silicon probes implanted in hippocampal region CA1 of three mice (Fig. 6a) (Fig. 6c). In contrast to simulations, rSTGs are of course unknown for the real neuronal data. Therefore, we tested the contribution of deconvolution by measuring the eSTG ratio (without and with deconvolution) as a function of the burst index. Only PYR-to-INT pairs with a consistent monosynaptic CCH peak (p < 0.001, Poisson test), in which the PYR exhibited a non-negative burst index, were analyzed (1274/7991 pairs). For the analysis pairs, firing rates of PYR and INT were 0.96 [0.23 1.7] spk/s and 13.05 [5.27 20.91] spk/s, respectively (Fig. 6b) (Fig. 6c). For the analysis pairs only, deconvolution-based eSTGs were consistently higher than eSTGs without deconvolution (medians: 0.019 and 0.017, respectively; p < 0.001, Wilcoxon's paired signed-rank; Fig. 6d).
Thus, in pairs of real neurons with putative monosynaptic connections, deconvolution yields higher eSTGs than eSTGs estimated without deconvolution.
The higher eSTGs yielded by median filtering with deconvolution may result from a fixed DC shift or be burst-dependent. To differentiate between these possibilities, we measured eSTG ratios as a function of PYR burst index. To visualize the effect of deconvolution, we chose several pairs of units (Fig. 6e, f) in which the PYR exhibited burst spiking activity (Fig. 6e, insets). The CCHs between the units exhibited prominent peaks within the causal ROI (0 < τ ≤ 5 ms), consistent with monosynaptic connectivity. In addition, the CCHs exhibited side lobes on both sides of the main peak, consistent with PYR bursts (Fig. 6e). In contrast, the dcCCHs did not exhibit side lobes (Fig. 6f), and deconvolution-based eSTGs were higher than eSTGs estimated from the CCHs. Over 1274 pairs, eSTG ratios exhibited a negative correlation with burst indices (ρ = −0.348; p < 0.001, permutation test; Fig. 6g). Furthermore, most eSTG ratios were smaller than one (median: 0.88; p < 0.001, Wilcoxon's signed-rank test; Fig. 6g). The negative correlation between eSTG ratio and burst index in real neuronal data, and the fact that most eSTG ratios are smaller than one, are consistent with the controlled simulations (Figs. 3-5). Together, these observations suggest that deconvolution improves both the quantification and the detection of interneuronal connections.

Discussion
We showed that the CCH between two neurons can be decomposed into a sum of three elements. Based on the mathematical formulation, we developed a deconvolution-based algorithm that removes second-order spike train statistics from the CCH, improving connectivity quantification and detection. Using pairwise point process and conductance-based network simulations, we showed that burst spiking activity modifies the CCH, impairing connectivity estimates yielded by several distinct methods. Deconvolution removed the effect of burst spiking from the CCH and recovered the constructed connectivity. In noisy point process simulations with known STGs, deconvolution reduced the errors of all STG-based methods, and improved detection performance for the tails, median, and GLMCC methods. In networks of conductance-based CA1 model neurons, the eSTGs yielded by median filtering depended on burst spiking activity, and this dependency was removed by deconvolution. In real neuronal data recorded from CA1 region of freely-moving mice, deconvolution-based eSTGs were consistently higher than eSTGs without deconvolution, in particular when bursting was prevalent. Together, the results imply increased accuracy upon using deconvolution when analyzing real neuronal data.
Estimates of STG/PSP yielded by all methods employed (tails, jitter, median, GLMCC, and CoNNECT) were averaged over time and spike patterns. The underlying assumption was that the ACHs and connectivity strengths are fixed over time. However, previous studies have shown that the postsynaptic effect of a presynaptic spike may depend on the presynaptic inter-spike interval 3,10,11 and on other parameters 32,47 . In vitro work showed that synaptic transmission can exhibit short-term plasticity, where the EPSP magnitude in a postsynaptic neuron is modified according to the order and timing of presynaptic spikes 48 . In some cases, EPSP magnitude decreased over consecutive spikes, and in other cases consecutive spikes caused facilitation of EPSP magnitude 3,49 . Consistent with the in vitro work, spike transmission estimates derived from the CCH in vivo were distinct when CCHs were computed using the first, second, or third spike in a presynaptic burst 21,32,50,51 . Other in vivo studies used trial-  (d, e). c Distributions of burst indices of the same four neuronal groups. d In PYR-to-INT pairs with putative monosynaptic connections, STG estimates based on deconvolution are higher than estimates that employ only median filtering. Scatter plot shows eSTG dc-median vs. eSTG median for all n = 7991 PYR-to-INT pairs in which both eSTGs were positive. PYR-to-INT pairs with a consistent monosynaptic CCH peak, in which the PYR also exhibits a non-negative burst index, are denoted as "analysis pairs" (pink dots; n = 1274 pairs). For the analysis pairs, the eSTG dc-median is higher than the eSTG median (p < 0.001, Wilcoxon's paired signed-rank test). e Four example CCHs with the median predictor. Insets: The ACHs of the putative presynaptic neurons, which exhibit burst spiking. f dcCCHs for the pairs in (e). Insets: Conditional rate (CR) histograms based on the CCHs (purple) and the dcCCH (green). In all examples, the deconvolution-based eSTG is higher than the eSTG estimated without deconvolution. g eSTG ratios for the full dataset (n = 1274 pairs), shown as a function of the presynaptic burst index. Deconvolution-based estimates are consistently higher than estimates without deconvolution (p < 0.001, Wilcoxon's signed-rank test). Estimates are particularly higher when spike bursting is more prevalent (p < 0.001, permutation test).
averaging and time-resolved cross-correlation measures, showing that spike-to-spike correlations depend on the time lag relative to a stimulus or an action 32,47,52 . As is, the deconvolution approach presented here (as well as the timescale separation methods employed) does not take into account time-dependent changes in the auto-correlation (e.g., of bursting activity) and cannot estimate time-dependent changes of spike transmission. However, deconvolution together with a timescale separation method can be applied to segmented data to track time-dependent changes in spike transmission (as done in refs. 21,32,47,51,52 ), yielding estimates differentiated from synchronous firing and burst spiking activity.
We showed that deconvolution improves connectivity estimates for bursting activity, but deconvolution can remove other effects of second-order spike train statistics on the CCH. While bursting is a relatively common deviation from Poisson spiking in real spike trains, other deviations are clearly possible. For instance, in some brain regions, strong periodicity is encountered, for instance at the ripple 53 or gamma 54 range. When individual neurons exhibit phase locking to field oscillations, the ACH may exhibit periodicity 54,55 . Then, the CCH between connected neurons will be affected by ACH periodicity. Deconvolution can be used to differentiate between the effect of transmitted spikes and the firing patterns of the presynaptic neuron. Thus, deconvolution can minimize the distortion of connectivity estimates and improve the analysis of slower CCH features.
Following multiple technological advances, the capability to record data from many neuronal pairs has drastically increased. The temporal resolution of calcium imaging techniques has gradually improved [56][57][58][59][60] . Furthermore, voltage imaging now allows recording the activity of multiple neurons at sub-millisecond temporal resolutions 61,62 . Large-scale electrophysiological techniques have evolved to enable recording hundreds of spike trains from the same or different brain areas simultaneously over prolonged durations [63][64][65] . Analyzing neural circuit dynamics based on massively parallel spike timing data requires adequate quantification of synaptic connectivity. In recent years, several analysis methods have been introduced, producing increasingly more accurate circuit maps based on multiple spike train recordings. Deconvolution can improve the outcome of those methods, and has the potential to improve the performance of any CCH-based method. The accuracy and sensitivity improved by deconvolution enables the construction of more accurate neuronal connectivity maps which may include weaker or otherwise hidden connections. Detailed maps, which take into account overlooked connectivity motifs, may enhance our understanding of the neural mechanisms underlying brain function.

Methods
Conductance-based model of a leaky integrate and fire (LIF) neuron driven by a Poisson train. To quantify the interplay between spike transmission gain (STG), unitary EPSP (uEPSP) amplitude, and background activity we constructed a simple conductance-based, leaky integrate and fire (LIF) model neuron with membrane potential V 2 driven by a Poisson spike train via a single excitatory synapse (LIF-syn model). The model was governed by two differential equations and a single condition: We used C = 1 μF/cm 2 , g L = 0.5 mS/cm 2 , E L = −60 mV, g S ∈ [0 0.032] mS/cm 2 , E S = 0 mV, g N = 1 mS/cm 2 , V th = −50 mV, V reset = −70 mV, τ r = 0.1 ms, and τ d = 3 ms. Membrane potential variability of the postsynaptic neuron, which may stem from many unknown sources, was quantified in the LIF model by additive Gaussian noise η(t)~G(0,σ), with an SD that was varied between runs, σ ∈ [0 5] mV. Whenever a LIF spike occurred, V 2 was held at V peak = 50 mV for T spike = 1 ms before being reset to V reset for another ARP 2 − T spike = 1 ms.
Explicit external inputs to the model were a fixed bias current, I(t) = 1 μA/cm 2 ∀t, and a presynaptic spike train. The presynaptic spike train was generated as a homogeneous Poisson process with λ 1 = 5 spk/s, and then spikes were decimated to maintain a minimal inter-spike interval of 4 ms. Whenever a presynaptic spike occurred, V 1 = V peak = 50 mV for T spike = 1 ms; otherwise V 1 = E L = −60 mV. For incorporating the presynaptic spike train in the synaptic differential equation, we used H(V) = (1 + tanh(V/4))/2. Thus, whenever an isolated presynaptic spike occurred, the synaptic variable S rose exponentially (with τ r ) toward one over 1 ms, and then relaxed back to zero (with τ d ). Short-term synaptic plasticity (facilitation and/or depression) was not included. The model was implemented using explicit second-order Runge-Kutta endpoint numerical integration method with a time step of Δt = 0.1 ms and total duration of T sim = 180 min.
Quantification of spike transmission gain in the LIF-syn model. The firing rate of the LIF, λ 2 , was determined by counting all spikes and dividing by T sim . Denoting the firing rate of the Poisson input by λ 1 , the "real" spike transmission gain (rSTG) in the stationary scenario may be intuitively defined as the number of spikes added due to the presence of a synapse, divided by the number of presynaptic spikes, namely 4λ 2 =λ 1 ¼ λ syn 2 À λ noÀsyn 2 À Á =λ 1 . However, such computation is flawed since the addition of transmitted spikes occasionally decimates spontaneous (noise-induced) spikes. In the case of a LIF model with an absolute refractory period ARP 2 and time step Δt, the exact rSTG is obtained by multiplying the naive ratio by a correction factor that scales the firing rate difference by the fraction of non-occupied bins: Spike cross-correlation histograms. Denote two spike trains by s 1 and s 2 . Each train is a sum of delta functions recorded over a duration T and can be expressed as respectively. Then, the cross-correlation between the two trains at any time lag τ is CC τ ð Þ ¼ Equivalently, the spike trains can be expressed as ordered lists: Then, the cross-correlation can be expressed as CC τ ð Þ ¼ ∑ where the indicator function is defined as #{true} = 1 and #{false} = 0. In practice, two spikes rarely occur at the exact same instant, and the cross-correlation is expressed as a histogram with a finite bin size B and a total of 2M + 1 bins, spanning the time range from −MB to MB. Then, the CCH count at the mth bin (m 2 ÀM; ÀM þ 1; 0; ; M À 1; M ½ ) sums the cross-correlation over the time range m À 1=2 Unless mentioned otherwise, we used a bin size of B = 1 ms and histogram range of 2M + 1 = 61 ms. We used a bin size of 1 ms to minimize the probability that two spikes of the same train will occur in the same bin, keeping the counting process Poisson. A 1 ms bin size has used in multiple extracellular 22 , intracellular 2 , and across species 66 studies. Furthermore, the CoNNECT method can operate only on CCH with bin size of 1 ms.
"Other inputs" predictor. In this work we used four methods to estimate the "other inputs" element of the CCH: the tails predictor, the jitter predictor, the median filter predictor, and the slow part of a generalized linear model for crosscorrelations (GLMCC). The tails predictor is computed by averaging over all CCH bins that are far from the zero-lag bin, both causal and anti-causal bins: The sum is over all K bins for which |k| ≥ M 0 ; we used M 0 = 11 ms. Therefore, the tails predictor has the same value for all 2M + 1 CCH bins (a straight line). The jitter predictor is computed by convolving the CCH with a partially hollowed Gaussian kernel: The Gaussian kernel, denoted as w[k], has a unity sum, standard deviation δ, support of 6δ, and the central bin is partially hollowed (0.6). Unless noted otherwise, we used δ = 5 ms. Jittering every spike within a rectangular ±δ window centered around the spike ("spike time jitter") many times and computing an average jittered CCH converges exactly to the convolution of the CCH with a triangular window that has a width of 4δ + 1 20 . Convolution with a partially hollowed Gaussian window with an SD of δ reduces the false-negative rate and increases detection power 20 . The hollowed median filter predictor is computed by applying a median filter of order 2δ over the CCH, while ignoring the value in the central bin: The GLMCC predictor is given by the slow part, a(t), of the GLM defined by refs. 40,41 .
Conditional rate CCH and spike transmission curve. To estimate the spike transmission curve (STC) from the CCH, we first compute the conditional rate CCH (crCCH). The crCCH is derived by subtracting, for every time lag, the predictor from the CCH, and scaling by the number of trigger spikes and the bin size: Thus, the crCCH has units of spikes per second (spk/s). Second, we find the extremum value of the crCCH within the casual temporal region of interest (ROI: 0 < m ≤ 5 ms). The two zero-crossing points, to the left and to the right of the extremum value, are defined as bounds, B L and B R . To preserve causality, if B L falls at the zero or a negative time lag, the first bin after the zero-lag bin is used instead. However, B R may be outside (to the right of) the ROI. The STC is then defined as equal to the crCCH for all bins within the [B L ,B R ] interval, and zero otherwise (Fig. 1c).
The ROI can be modified according to the expected form of the STC, based on two parameters: the delay and the jitter of spike transmission. When the transmission delay is short and the STC is narrow, a short ROI near-zero lag is suitable. Here, an ROI of (0,5] was chosen to ensure including at least part of the monosynaptic STC, consistent with previous results in neocortex 32 and hippocampus exhibiting a transmission delay in the 0-3 ms range 21,22,67,68 . Computation of spike transmission gain. The estimated spike transmission gain (eSTG) is the integral over the STC, computed numerically as the sum of all estimated STC values multiplied by the bin size: Mathematical framework for deconvolved CCH. The deconvolution approach is based on the realization that the CCH between two spike trains can be expressed as an exact sum of four elements and approximated by a sum of three elements. The decomposition (Eq. 17) is mathematically exact when the system is assumed to be linear time invariant (LTI). "Linear" implies that the spike transmission process is linear, but does not imply linearity of spike generation, which is a highly nonlinear process. Linearity of spike transmission means that the process of transmitting spikes is additive and does not depend on the history of spike transmission. Linearity is incompatible with neuronal refractoriness, and is assumed for mathematical simplicity. "Time invariant" implies that the impulse responses of spike transmission-and in this specific case, also the ACHs-are constant over the duration of the recording. These assumptions are implicit in the computation of any CCH and in most CCH applications (see "Discussion").
Within the LTI framework, we proceed as follows. The specific system studied is a pair of reciprocally-coupled neurons, each of which also receives external input (Fig. 2a). Formally, the observed spike train of neuron 1, s 1 , is a sum of delta functions and thus has the form N 1 is the total number of spikes in s 1 , t i is the instant at which the ith spike occurred, and T is the total recording duration. The spike train of neuron 2, s 2 , is defined in an analogous manner by We denote the finite impulse response of spike transmission from neuron 1 to neuron 2 by The impulse response between neuron 2 and neuron 1, h 2 , is denoted in an analogous manner by Specifically, h 1 and h 2 are non-zero only for positive time lags, which is the standard definition of causality. Using these definitions, the spike train of neuron 2, s 2 , is the superposition of spikes from two sources: (i) transmitted spikes, due to s 1 filtered by the synaptic connection between the two neurons, h 1 ; and (ii) background spikes, denoted by s 0 2 , which are due to other sources: The spike train of neuron 1, s 1 , can be expressed in an analogous manner. To facilitate the analysis, we take the Fourier transform of all quantities, and obtain the frequency domain representation of Eq. (11): S 2 (f) is the Fourier transform of s 2 (t), S 2 ðf Þ ¼ R 1 À1 s 2 ðtÞexpðÀ2πiftÞdt. In an analogous manner, we obtain the Fourier transform of s 1 : consists of a pair of coupled equations, for which the solution is: 1Þ To link the CCH with the impulse response, the cross-correlation between the two spike trains is written in the frequency domain as where S 1 f À Á denotes complex conjugation, due the fact that when computing convolutions-but not cross-correlations-one of the signals is time reversed. Plugging Eq. (13) into Eq. (14.2) we obtain The elements in the numerator of Eq. (15) can be rewritten in terms of correlation functions of the latent (background) spike trains as follows: This completes the exact decomposition of the CCH into four additive elements in the frequency domain. When the overall gain of the feedback loop is small, i.e., when H 1 (f)H 2 (f) → 0, the last element and the denominator of Eq. (17) vanish, and the Fourier transform of the CCH simplifies to Which is represented in the time domain as In Eq. (18.2), ⋆ denotes cross-correlation and * denotes convolution. We have reached an important conclusion. When the overall gain of the feedback loop is small, the cross-correlation between two spike trains can be expressed as a sum of three elements: (1) the cross-correlation between the uncoupled spike trains; (2) the convolution of the auto-correlation of one uncoupled spike train with the impulse response of the coupling to the second train; and (3) the convolution of the autocorrelation of the second uncoupled train with time-reversed coupling to the first train.
The exact same derivation applies to inhibitory connections, the difference being that the plus signs in Eq. (11) and Eq. (12) are replaced by minus signs. In the absence of connectivity, Eq. (17) simplifies to CCH ¼ CCH 0 12 . Alternatively, in the presence of purely feedforward connectivity, e.g., when H 2 f À Á ! 0, Eq. (17) simplifies to Which is represented in the time domain as In some systems, e.g., when neurons are strongly coupled 69,70 , the approximation H 1 (f)H 2 (f) → 0 cannot be made. In general, the approximation H 1 (f)H 2 (f) → 0 can be made when the loop gain (rSTG 12 times rSTG 21 ) is lower than a minimal unidirectional STG, which can be detected with finite data. The detection of a connection depends on multiple variables including recording duration, firing rates, and the method employed. Therefore, an exact number for a minimal detectable unidirectional STG cannot be obtained. However, in the specific case of unidirectional connection with an impulse response spanning a single bin and Poisson firing pattern of both neurons, the minimal detectable unidirectional STG can be computed exactly using the tails predictor. Under these conditions, the CCH baseline is 20 λ = F 1 F 2 TB, where F 1 and F 2 are the firing rates of the pre-and postsynaptic neurons in spk/s, T is the effective recording duration, and B is the CCH bin width (both measured in seconds) For a given λ and alpha (detection threshold) level, the inverse Poisson distribution can be used to obtain the minimal number of transmitted spikes required for detection. The minimal STG is then calculated as the minimal number of transmitted spikes, divided by F 1 T. For example, the minimal STG which can be detected for F 1 = 1 spk/s, F 2 = 10 spk/s, at T ¼ 50; 000 s using B ¼ 0:001 s, and an alpha level of 0.001 is 0.00142.
Algorithm for deconvolving ACHs from the CCH. In general, we do not have access to the latent variables s 0 1 and s 0 2 . In other words, we cannot determine which spikes in a train, e.g., s 2 , are background spikes (e.g., s 0 2 ), and which are transmitted from s 1 (Eq. 11). Thus, in general, ACH 0 1 and ACH 0 2 are unknown and Eq. 18 cannot be evaluated. However, if the number of transmitted spikes is small, compared to background spikes, then the ACHs of the background trains can be estimated from the measured spike trains: Where the lower integration bound is 0 rather than −∞ due to the non-negativity of the time axis. The CCH is estimated directly from the spike trains as in Eq. (14.1), with the time axis modified in the same manner: Finally, we define Using these measurements (Eq. 20) and definitions (Eq. 21) in Eq. (18.1) and rearranging, we obtain Where the r.h.s. is derived from the observed spike trains. Taking the inverse Fourier transform and defining the "other inputs" element as We obtain the basis of the deconvolution algorithm: Due to causality (Eq. 10), h 1 and h 2 (−τ) reside on opposite sides of the zero lag. The r.h.s. of Eq. (24.1) is denoted the "deconvolved CCH" (dcCCH): When unidirectional deconvolution is applied, Eqs. (24.1-2) can be replaced by: Once the dcCCH is determined numerically (see below), the "other inputs" element can be determined using timescale separation (a predictor; Eq. 6).
The first step in the actual deconvolution algorithm is to compute the two count ACHs and the CCH from the spike trains. The second step is to scale the ACHs, such that each of the ACHs will have a sum of one. To scale the count ACH, the zero-lag bin is first set to zero. Then, the mean is subtracted, every bin in the zeromean ACH is divided by the total number of spikes, and the zero-lag bin is set to complement the sum to one. Scaling ensures that deconvolution will be affected only by the shape of the ACHs, and not by the number of spikes in each train. If the count ACH is exactly flat, the normalization yields a delta-like histogram (one at zero-lag and zero everywhere else), and deconvolution does not modify the CCH. Third, the r.h.s. of Eq. (24) is evaluated.
The deconvolution algorithm as derived above (Eq. 20-24) is based on Eq. 18, but makes two key simplifying assumptions. First, that the shape of the ACH is not considerably distorted by the transmitted spikes (Eq. 20). Second, the impulse response is not considerably distorted by the divisive scaling factor inherent in the derivation (Eq. 21).
With respect to Eq. 20, using point process simulations, we found that even when the presynaptic neuron spikes at a relatively high rate (10 spk/s) with strong bursting activity (BR = 0.4), and the postsynaptic neuron spikes at a lower rate (3 spk/s), the estimates of connectivity are not distorted as long as the rSTG is below 0.25. Notably, strong connections and high firing rates are not characteristic of local cortical networks. However, different settings may appear in different systems, e.g., thalamocortical feedforward connections 28 . When connectivity is very strong and presynaptic firing rates are high, prior knowledge about connectivity can be used to employ unidirectional deconvolution (Eq. 24.3-4) instead of the "standard" deconvolution (Eqs. 24.1-2).
While ACHs effects are eliminated by the deconvolution algorithm, a divisive scaling factor (the denominator of Eq. 21) is introduced which can distort the recovered impulse responses. If connectivity is unidirectional and the postsynaptic train is Poisson, the scaled ACH 2 is a delta function, the divisive factor in Eq. (21.1) is unity, and e h 1 ¼ h 1 . Furthermore, if connectivity is unidirectional, then even if the presynaptic train is non-Poisson, the numerator of the r.h.s. of Eq. (21.2) is zero and thus h 2 = 0. When connectivity is bidirectional and one of the trains is non-Poisson, or when connectivity is unidirectional and the postsynaptic train is non-Poisson, the divisive factor may become consequential. Then, prior knowledge about connectivity can be used to employ unidirectional deconvolution (Eq. 24.3-4).
Point process spike train simulations. For investigating different STG estimation methods, we devised a point process simulation that generates two spike trains of a two-neuron network with precisely defined STGs. Each of the synthetic spike trains, s 1 (t) and s 2 (t), was initially generated by random sampling from a distinct rate function, λ 1 (t) and λ 2 (t), respectively, and then spikes were added or removed according to predetermined STCs. Thus, simulations consisted of three sequential steps: (1) generation of a rate function for each neuron; (2) stochastic sampling of spike trains, independently from each rate function; (3) modification of each spike train according to the other spike train and the corresponding STC. All simulations were generated over N = T/Δt samples, where Δt = 0.001 s is the time step and T is the duration of the simulation.
To generate a rate function for one neuron, we first set a desired mean firing rate λ d which was then modified based on the desired gamma order γ and burst fraction BR according to λ m = λ d • γ/(1 + BR). For instance, for generating a spike train with gamma order γ = 2 the firing rate is doubled, and for a spike train in which half of the spikes are first spikes in a two-spike burst the firing rate is halved. For generating a fixed rate function, we set λ(t) = λ m ∀t ∈ [1 N], separately for each neuron. To create co-modulated spike trains, we generated correlated rate functions for the two neurons. For that, the rate function of each neuron was time dependent, defined as: The co-modulation rate function λ c is a clipped pink noise signal, generated by filtering Gaussian white noise sampled at Δt intervals, η(t)~G(0,σ c ), with a decaying exponential e À1=τ c , where τ c = 20 ms. The pink noise was then clipped to the [−1 1] range, yielding the zero-mean λ c (t). The same comodulation function was used for generating the two rate functions, λ 1 (t) and λ 2 (t).
In the second step, each spike train was generated by stochastic sampling from the corresponding rate function. For each sample, we determined whether a spike did or did not occur, according to random sampling from a Binomial distribution with parameters B(n,p) = (1,λ(t)Δt). When λ(t) is time-varying or constant, the resulting spike trains correspond to non-homogenous or homogenous Poisson processes, respectively. After generating a spike train, three modifications were made. First, spikes were removed according to the gamma order γ: to realize an nth-order gamma process, every nth spike was retained, and all other spikes were decimated. Retaining all spikes corresponds to a first-order gamma (i.e., Poisson) process. Second, burst spiking activity was added by inserting spikes based on the burst fraction (BR) parameter. For a non-zero BR, each spike was defined to be a "first in burst" randomly with probability BR 1 . The precise timing of the "second in burst" spike was determined by random (uniform) sampling from a 5-element symmetric triangular window that lagged the first spike in the burst by two samples. A "third in burst" spike was added with probability BR 2 ; then, the overall BR is BR 1 + BR 1 •BR 2 , and the timing of the third spike was drawn from a threesample lagged window. In actual simulations, BR 1 was varied in the [0 0.4] range, whereas BR 2 = 0.4 was held constant. Third, ARP considerations were imposed by removing all spikes that occurred shortly (ARP = 2 ms) after another spike.
In the third step, connectivity was added between the two spike trains. The same STC waveform was used in all simulations: a 5-element asymmetric triangular window that lagged the presynaptic spike by one sample. However, the STC integral (the STG) was varied in sign and value, mimicking excitatory and inhibitory connectivity of various gains. For each spike of the presynaptic neuron, the occurrence and timing of the added (or decimated, for inhibitory connections) spike was determined by random (uniform) sampling from the STC. For excitatory transmission, this procedure can generate more than one postsynaptic spike, as required since the STG is not limited to the [0 1] range. Connectivity was implemented independently in every direction. After applying connectivity between the two trains, ARP considerations were imposed once more.
For creating noisy point process simulations (Fig. 4), we simulated 1250 spike train pairs. In 60% of the pairs, co-modulation dynamics were added. For the simulations with co-modulation, the co-modulation parameter σ c was drawn randomly from a uniform distribution between 1 and 15 spk/s, with a fixed comodulation time constant (τ c = 20 ms). The firing rates of the pre-and postsynaptic neurons were 2 and 8 spk/s, respectively. The burst fraction of the presynaptic neuron was varied uniformly between 0 and 0.4. Recording duration was set randomly between 90 min and 5 h. Of the 1250 simulated pairs, 500 pairs were simulated with monosynaptic excitatory connections; 500 pairs were simulated with monosynaptic inhibitory connections; and the other 250 pairs were simulated without connectivity. Connectivity strengths (rSTG) were drawn randomly from a log-normal distribution [43][44][45]  Conductance-based model of CA1 network. To model synaptic connectivity within a network of neurons with ACHs and CCHs resembling those observed in real neuronal data (Fig. 6), we generated a network of conductance-based E-and I-cells. The E-cell model, derived from the "simple model" of Izhikevich 71 , included dynamics on the membrane potential (V), and a slower, phenomenological recovery variable (u). In addition, the model included synaptic input and noise. The model equations are: Membrane potential variability, which may stem from many unknown sources (e.g., unrecorded neurons), was modeled by an additive noise term, generated by random sampling from a zero-mean Gaussian distribution η(t)~N(0,σ) independently for every cell. In this model, spike waveforms were modeled explicitly by the quadratic in Eq. 25. Whenever a spike occurred (i.e., V peak was crossed), the membrane potential V was reset to V reset , and the recovery variable u was incremented by U step . By modifying these two parameters, a given E-cell model was tuned to fire predominantly single spikes, spike bursts, or mixes thereof (Fig. 5a). The specific parameters values used for the E-cell model are detailed in Table 1.
For the I-cells, we used the Wang-Buzsáki model 72 , describing the dynamics of the membrane potential (V), sodium inactivation (h), and delayed-rectifier potassium (n). The full model also included synaptic currents and noise, and reads ð26:1Þ The gating variables for the I-cell (x = h,m,n) had voltage-dependent time constants (τ x ) and steady-state values (x ∞ ) as follows: Other parameters values used for the I-cell model are detailed in Table 2. Synaptic connections were modeled as in ref. 73 . For the e'th E-cell, the total synaptic current was I synaptic;e ¼ ∑ N e j¼1 g ej S ej V e À E se;j þ ∑ N i k¼1 g ek S ek V e À E si;k ð27:1Þ Where N e (N i ) is the number of E-cells (I-cells). The notation g ej indicates the maximal synaptic conductance from presynaptic E-cell j to postsynaptic E-cell e.
All excitatory-to-excitatory (E-to-E) synapses had the same reversal potential, regardless of the presynaptic neuron (E se,j = E se , ∀j), but the maximal excitatory conductance value g ej could vary between presynaptic neurons. In practice, we set all g ej = g ee = 0. All inhibitory-to-excitatory (I-to-E) synapses had the same reversal potential, regardless of the presynaptic neuron (E si,k = E si , ∀k). The maximal inhibitory conductance g ek was either fixed for all I-cells (g ek = g ei ; Fig. 5d) or varied between neurons (Fig. 5i). All synaptic activation variables corresponding to the same presynaptic neuron had the same dynamics, regardless of the postsynaptic neuron (S ej = S j , S ek = S k , ∀e). For the i'th I-cell, the total synaptic current was modeled by All excitatory-to-inhibitory (E-to-I) synapses had the same reversal potential (E se,j = E se , ∀j), but the maximal conductance values, g ij , could be varied between E-cells. All inhibitory-to-inhibitory (I-to-I) synapses had the same reversal potential (E si,k = E si , ∀k), but the maximal conductance values g ik could be varied between I-cells. All synaptic activation variables corresponding to the same presynaptic neuron had the same dynamics (S ij = S j , S ik = S k , ∀i).
For an excitatory/inhibitory presynaptic neuron, the dynamics of the corresponding synaptic variable (S e /S i ) depended on the presynaptic membrane potential (V e /V i ) and the synaptic rise and decay time constants, following: All synaptic parameters values used are detailed in Table 3. Numerical integration was done using the explicit second-order Runge-Kutta endpoint (modified Euler) method with integration time step of Δt = 0.025 ms and simulation duration of T sim = 240 min.  Probes and surgery. Each animal was implanted with a multi-shank silicon probe (Diagnostic Biochips) attached to a movable micro-drive. The probes used were Stark64 (two mice) and Dual-sided64 (one mouse). The Stark64 probe consists of six shanks, spaced horizontally 200 µm apart, with each shank consisting of 10-11 recording sites, spaced vertically 15 µm apart. The Dual-sided64 probe consists of two dual-sided shanks, spaced horizontally 250 µm apart, with each shank consisting of 16 channels on each side (front and back), spaced vertically 20 µm apart. In all mice, probes were implanted in the neocortex above the hippocampus (PA/LM, 1.6/ 1.1 mm) under isoflurane (1%) anesthesia 38,74 . After every recording session, the probe was translated vertically downward by up to 70 µm. The recorded data included only recordings from the CA1 pyramidal cell layer, recognized by the appearance of multiple high-amplitude spiking units and iso-potential spontaneous ripple events.
Recording procedures. Neuronal activity was recorded in 4.4-h sessions (median of 27 sessions; range, 3-12 h). Every session started with a baseline neural recording of at least 15 min, while the animal was in the home cage or in a 0.8 m diameter open field. After the baseline recordings, the animal ran on a linear track, received optogenetic stimuli, or both, for a period of at least 60 min. Sessions ended with another baseline period of at least 30 min. Only data recorded during spontaneous activity, in the lack of any optogenetic stimuli, were used in this work.
Quantifying burst spiking activity. For quantifying burst spiking activity of real spike trains, we used a "burst index" 80 . The precise definition employed was burst index ¼ headÀtail headþtail , where head is the sum of all ACH counts in the 2 < τ ≤ 10 ms range, and tail is the sum of all ACH counts in the 35 < τ ≤ 50 ms range.
Selection of a subset of data. For evaluating the contribution of deconvolution to the analysis of real neuronal data, we used spike trains of units recorded from CA1 of three freely-moving mice during spontaneous activity. We denote PYR-to-INT pairs for which both eSTG median and eSTG dc-median were positive as the "All pairs" group (7991/9030 simultaneously-recorded PYR-INT pairs; Fig. 6d, blue dots). For eSTG comparisons, we focused on a subset of pairs (the "Analysis pairs" group; 1274/7991 pairs; Fig. 6d, pink dots) composed of pairs which met four criteria. (1) The trigger unit (PYR) exhibited a non-negative burst index (Fig. 6c). (2) An excitatory connection was detected by the median filter with and without deconvolution. (3) The ratio between eSTG median and eSTG dc-median was between 0.5 and 2 (28 pairs were excluded due to this criterion). (4) The total number of counts in the count CCH (at the −30 < τ ≤ 30 range) was above 400 (5 pairs were excluded due to this criterion).
Detection analysis. For quantifying detection performance of each method, we first computed false-positive (FP) and false-negative (FN) rates for each type of connection. For excitatory connections, the FP rate was defined as the number of times in which the method detected an excitatory connection when no connection was simulated, divided by the total number of tested connections (N conn ). The excitatory FN rate was defined as the number of times in which an excitatory connection was simulated but was not detected by the method, divided by N conn . For inhibitory connections, the FP rate was defined as the number of times in which the method detected an inhibitory connection when no connection was simulated, divided by N conn . The inhibitory FN rate was defined as the number of times in which an inhibitory connection was simulated but was not detected by the method, divided by N conn . Next, we computed the f 1 score, defined as: Where TP is the true positive rate, which is defined as the number of times in which a simulated connection (excitatory or inhibitory) was correctly detected by the method, divided by N conn . The FP and FN used in Eq. (29) are the sum of the excitation and inhibition FP and FN rates: FP = FP exc + FP inh and FN = FN exc + FN inh , respectively.
To determine whether the f 1 score of one group (group 1 ) is consistently larger than the f 1 score of another group (group 2 ), we devised a resampling with replacement (bootstrap) test. For each resampled dataset, we first computed the f 1 score for each group, and then compared the two f 1 scores. We repeated the process 3500 times. We then counted the fraction of times for which group 1 f 1 score was smaller than group 2 f 1 score. Based on the resampled scores, we computed the mean and SEM.
Slope comparison. To determine whether the linear slope of one group (group 1 ) is consistently larger than the slope of another group (group 2 ) we devised another, more conservative bootstrap test. For each resampled dataset, we fitted a slope for each group. We repeated the process 300 times, resulting in 300 different slopes for each group and 90,000 slope pairs. We then counted the fraction of pairs for which group 1 slope was smaller than group 2 slope. Pairing slopes from different resampling iterations provides a more conservative test than only pairing slopes from the same iteration.
Statistics and reproducibility. In all statistical tests used in this study, a significance threshold of α = 0.05 was used. Two exceptions were the threshold used for determining whether two units exhibit monosynaptic connectivity, and the classifier used to determine whether a unit is a PYR or an INT (α = 0.001). For Fig. 5m, reproducibility was carried out across networks (Fig. 5m); for Fig. 6g, reproducibility was carried out across animals (Table 4). All descriptive statistics (n, mean, median, range, IQR, SEM) can be found in the results and figure legends. To examine whether a group median is larger or smaller than an expected value, we used Wilcoxon's signed-rank test (onetailed). Differences between two group medians were tested with Mann-Whitney's U- a At the time of implantation. b "All PYR" and "All INT" refer to the total numbers of well-isolated units recorded during the listed sessions. c "Analysis PYR", "Analysis INT", and "Analysis pairs" refer to the subsets used for actual analyses (cf. Fig. 6b-d). d "Rank CC" refers to Spearman's rank correction coefficient between eSTG ratios and burst indices. e "P-value" refers to permutation test comparing the rank CC to a zero null.

Data availability
The source data behind the graphs in the paper are available in Supplementary Data 1.
The data used in this study are available from the corresponding author upon reasonable request.

Code availability
Code for implementing deconvolution and median filtering, along with example spike data, are hosted publicly on GitHub, accessible via https://github.com/EranStarkLab/ CCH-deconvolution.