Skip to main content
PLOS Computational Biology logoLink to PLOS Computational Biology
. 2026 Sep 30;22(9):e1014820. doi: 10.1371/journal.pcbi.1014820

Granger sensori-behavioral functional taxonomy of neuronal ensemble activity from two-photon calcium imaging data

Sahar Khosravi 1,2, Nikolas A Francis 3,4, Patrick O Kanold 5,6, Behtash Babadi 1,2,*
Editor: Alain Nogaret7
PMCID: PMC13660992  PMID: 42814770

Abstract

Understanding how neuronal populations interact to encode and transform sensory information is a fundamental challenge in computational neuroscience. Most existing studies, however, study neural encoding, behavioral readout, and functional connectivity as disjoint problems. Two-photon calcium imaging enables simultaneous recording of large neuronal ensembles in vivo, driven by diverse stimuli and eliciting distinct behaviors. However, extracting directional functional connectivity metrics as well as encoding and readout properties of neurons from such data remains difficult due to indirect and noisy observations of spiking activity, slow temporal dynamics, and the latent interplay between external stimuli and endogenous neural processes. Here, we introduce a unified conceptual and operational modeling and inference framework for directly extracting functional Granger causal (GC) effects between neurons, from external stimuli to neurons, and from neurons to behavior, from two-photon imaging data, in the sense of Granger’s temporal predictability. Inspired by the intersection information framework, we also identify neurons that encode features of sensory stimuli that inform behavioral readout. The resulting GC networks together with the taxonomy of functional sensori-behavioral relevance, which we call G-taxonomy, provides a powerful statistical analysis framework, enabled by the integration of several techniques including state-space modeling and inference, variational inference, and point processes. We applied the proposed framework to simulated and experimentally-recorded two-photon imaging from the mouse auditory cortex (A1) during both passive listening and active tone discrimination. Our simulation studies reveal significant improvement of our proposed methodology over existing techniques. Analysis of experimental data from the mouse A1 identifies distinct groups of cells with diverse sensori-behavioral relevance, as well as changes in functional connectivity associated with correct vs. incorrect behavior. In summary, this work provides a principled and data-driven methodology for uncovering directional interactions among the neurons, sensory stimuli, and behavior, all within the same statistical framework, offering new insights into how distributed cortical populations transform sensory inputs into behaviorally relevant representations.

Author summary

The brain processes sensory inputs through the coordinated activity of large networks of neurons and produces readouts that elicit behavior. Understanding how information flows and is processed through these networks is a central goal of neuroscience. In this study, we present a new computational framework that identifies directional interactions among neurons in an ensemble as well as from sensory stimuli to neurons and from neurons to behavior. Utilizing the Granger formalism to identify directional effects, as opposed to common correlational measures, our framework extracts said effects directly from two-photon calcium imaging data. We tested our proposed method on both simulated data and recordings from the auditory cortex of mice during passive listening and active tone discrimination tasks. Our method revealed diverse groups of neurons in the auditory cortex with distinct functional roles and relevance to sensori-behavioral integration. Our framework provides a new way to study the flow of information in the brain and can be broadly applied to uncover neural computations across sensory and cognitive systems.

Introduction

It is widely accepted that the brain extracts features of sensory stimuli by generating distinct patterns of activity known as neural representations [1–5]. The process by which the sensory information is mapped to neural representations is often referred to as neural encoding. These neural representations are also read out by downstream cortical areas that mediate behavioral outcomes. This process is often referred to as behavioral readout or neural decoding [6–13]. Most existing studies of brain function consider neural encoding and behavioral readout as independent problems: they either focus on understanding how the brain encodes sensory information (e.g., receptive fields), or aim at predicting the behavior given the neural representations (e.g., choice probability models). As such, the interaction between the brain and behavior is obscured, which significantly limits our understanding of brain function. In order to tap into higher-level functional processes such as learning and attention, it is crucial to develop models designed to simultaneously account for both.

In recent work, a new framework known as Intersection Information (II) has been proposed, which aims at extracting the information in the neural representation that intersects with that relevant to behavior [14–16]. This framework uses partial information decomposition [17–21] to capture the mutual information between the behavioral choice and the pair of stimulus and neural activity, while subtracting the portion that is common between the neural activity and behavior independent of the stimulus. This framework has shown great promise in shedding light into the mechanisms by which neural encoding and behavioral readout intersect [22–26].

Despite the promising nature of this approach, it has so far been limited to small populations of neurons due to challenges in nonparametric estimation. In addition, the behavioral space has so far been limited to simple binary decision-making tasks [14]. Extending this framework to study sophisticated sensori-behavioral interactions in a scalable fashion requires addressing several challenges. First, inferring II from ensemble neural data requires nonparametric estimation of partial information measures and their bias correction, which scales poorly with the network size due to its combinatorial nature. Second, each neuron is considered in isolation, which undermines the network-level effects relevant to behavior. Third, the relevant features of neural activity are required to be fixed a priori (e.g., average spiking rate).

Apart from the foregoing challenges, in application to data modalities that indirectly measure neuronal spiking, such as two-photon calcium imaging, the spike trains are not readily available for computing information measures. In the case of two-photon imaging, the fluorescence observations are noisy and temporally blurred surrogates of spiking activity. Existing approaches carry out the inference of information measures in a two-stage fashion: first, infer spikes using a deconvolution technique, and then compute firing rates and evaluate information measures [22–24]. These two-stage estimates are highly sensitive to the accuracy of spike deconvolution, and require high temporal resolution and signal-to-noise ratios [27,28]. Furthermore, these deconvolution techniques are biased toward obtaining accurate first-order statistics (i.e., spike timings) via spatiotemporal priors, which may be detrimental to recovering higher-order statistics that are crucial for computing information measures.

We propose to cast this problem within the so-called Granger formalism [29–31], in order to address these shortcomings. Our approach is first and foremost inspired by the elegant machinery of II and partial information decomposition [14–16], by the known equivalences between Granger causality (GC) and directed information inference in certain statistical models [30,32–34], and finally by the fact that the parametric nature of GC inference allows its integration with multivariate point process models [35,36]. The essence of GC can be understood by considering two processes, Xt and Yt, and asking whether knowledge of process Xt significantly enhances our ability to predict Yt+1. If it does, a GC link from X to Y is established. This notion of directed connectivity has been widely used in the analysis of neuroimaging data as well as spiking neuronal ensembles [29,35–38].

Utilizing several recent theoretical and algorithmic advances for GC inference [36,37,39] as well as direct network estimation from two-photon imaging data [40,41], we propose a Granger Sensori-Behavioral Taxonomy, namely G-taxonomy, to characterize the relevance of neuronal activity to stimulus, behavior, and their intersection. The key idea is to include the stimulus and behavior within the network of N neurons and consider an augmented network of size N + 2. Then, the notion of GC link between two neurons can be extended to GC links from stimulus to neurons (i.e., stimulus encoding), from the neurons to behavior (i.e., behavior decoding), and the interaction of stimulus and behavior conditioned on neuronal activity (i.e., intersection). As such, we will label the neurons in an ensemble as Granger Stimulus encoding (GS), Granger Behavior decoding (GB), Granger Intersection (GI), or none of the above.

The key technical challenge in establishing the G-taxonomy is devising a precise statistical framework, with controlled false discovery rate, that takes noisy and blurred two-photon recordings from a limited number of trials and outputs the aforementioned labeling. To achieve this, we propose a dynamic Bayesian network model that integrates point processes [35,42] with multivariate autoregressive models [31] to jointly capture the effect of stimuli on neuronal activity as well as behavioral responses, directly from two-photon fluorescence data without requiring intermediate spike deconvolution. Model inference is efficiently carried out through an integration of Pólya-Gamma augmentation, Iteratively Reweighted Least Squares (IRLS), Fixed Interval Smoothing, Kalman Filtering, and Expectation- Maximization [40,43–48]. Finally, a hypothesis testing framework using the deviance difference statistics is used to quantify each detected effect via the Youden’s J-statistic [36,49], followed by the Benjamini-Yekutielli procedure [50] to control the false discovery rate in ascribing the foregoing G-taxonomy to a neuronal ensemble.

We demonstrate the utility of our proposed G-taxonomy using simulated datasets as well as experimentally-recorded two-photon imaging data from the mouse auditory cortex during passive stimulus presentation and tone discrimination tasks. Our simulation results corroborate the robustness of the proposed statistical testing framework in revealing the GC links between neurons, arising from non-stimulus driven activity, as well as identifying GS, GB, and GI neurons. Application to experimental data reveals the utility of the proposed G-taxonomy in identifying neurons with distinct contributions to correct vs. incorrect behavioral outcomes, in terms of sensory encoding, behavioral readout, their intersection, or none. While consistent with existing results, this new taxonomy provides a unified, scalable, and statistically principled framework for bridging sensory encoding and behavioral readout and for probing how directed neuronal interactions support task performance.

In summary, the main contributions of our work include: 1) leveraging the Granger formalism to assess the sensori-behavioral relevance of neurons within a network, as opposed to doing so in isolation, thanks to advances in scalable GC inference; 2) learning the relevant features of spiking activity in a data-driven fashion via efficient parameter estimation, as opposed to restricting them a priori; and 3) precise characterization of the statistical confidence in ascribing the GS, GB, and GI labels via J-statistics.

Results

In this section, we demonstrate the utility of our proposed estimation framework through both simulation and experimental studies of neuronal activity in the mouse auditory cortex. We begin with a controlled simulation to validate recovery of directed links and neuron classes under known network structure. We then apply the framework to two experimental datasets from mouse auditory cortex: one recorded during spontaneous and stimulus-driven activity, and one during active tone discrimination behavior. Together these analyses test the framework’s ability to detect stimulus and choice-related interactions under increasingly realistic conditions.

Overview of the proposed granger sensori-behavioral functional taxonomy

Consider a canonical experimental setting in which an external stimulus, denoted by 𝐬t,l, is chosen at trial l and presented independently for a total of L trials, while the spiking activity of a population of N neurons is indirectly measured using two-photon calcium fluorescence imaging. Fig 1 (forward arrow) shows the generative model that is used to quantify this procedure. The fluorescence observation in the lth trial from the ith neuron at time frame t, denoted by yt,l(i), is a noisy surrogate of the intracellular calcium concentrations. The calcium concentrations in turn are temporally blurred surrogates of the underlying spiking activity nt,l(i), as shown in Fig 1.

Fig 1. Schematic depiction of the generative model and proposed Granger sensori-behavioral functional taxonomy.

Fig 1

Top: In the proposed model for estimating GC links directly from two-photon calcium fluorescence observations, observed variables (black), latent endogenous processes (red), and an exogenous stimulus (blue) relevant to the ith and jth neurons are shown. The spiking activity of networked neurons is influenced by latent endogenous processes (red traces) and an exogenous stimulus (blue traces), with black arrows indicating GC connectivity between neurons. The blue and green arrows, respectively, show the effects of the stimulus on neurons and neurons on behavior, in the sense of Granger’s temporal predictability. Bottom: our proposed inverse solution and G-taxonomy; following network parameter estimation, statistical testing, and false discovery rate control, we define three categories of neurons, namely Granger Stimulus, Granger Intersection, and Granger Behavior.

In modeling the spiking activity, we consider two main contributions: (1) the common known stimulus 𝐬t,l affects the activity of the ith neuron via an unknown kernel 𝐝i, akin to the receptive field. We refer to this effect as the latent exogenous component; (2) the trial-to-trial variability and other intrinsic/extrinsic neural covariates that are not time-locked to the stimulus 𝐬t,l are captured by a trial-dependent latent process xt,l(i). We refer to this effect as the latent endogenous component. Then, we use a Generalized Linear Model to link these underlying neural covariates to spiking activity [51].

To model the temporal coupling between the neurons, we assume that the N-dimensional latent endogenous process {xt,l(i)}i=1N is governed by a vector autoregressive (VAR) model of order P with unknown parameters and process noise covariance. The binary behavioral outcome bl at trial l is also modeled using a GLM, in which the neuronal activity within a “readout window” during or following stimulus presentation forms the set of relevant covariates.

Given this generative model, the objective of the inverse problem in Fig 1 (backward arrow) is two-fold: using the observed data {yt,l(i)}t,l,i=1T,L,N and {bl}l=1L, we seek to simultaneously (1) estimate the functional connectivity between the neurons in the sense of Granger’s temporal predictability, often referred to as Granger causality (GC), and (2) attribute a G-taxonomy to all the N neurons, in the sense of Granger’s temporal predictability, to quantify their role in the network function. The advantage of solving these two inverse problems simultaneously is also two-fold: (1) in detecting the GC links between neurons, the effect of external stimuli as a confound would be controlled. For instance, if neurons i and j are being driven by the stimulus with different latencies, by explicitly modeling the receptive fields 𝐝i and 𝐝j and quantifying the stimulus effect, the detected GC links would only be resulting from the VAR coupling of the endogenous latent process; (2) in attributing the G-taxonomy to each neuron, the network effects arising from endogenous interactions between the neurons as a confound would be ruled out. For instance, we can rule out if heightened activity of neuron j corresponding to bl=1 behavioral category is due to having a relevant effect to behavior, or is just due to receiving an endogenous coupling from a neuron i that directly contributes to behavior.

The proposed G-taxonomy is inspired by elegant machinery of intersection information and partial information decomposition [14–16], but is here carried out in the sense of Granger’s temporal predictability: an effect between two nodes in the network (including sensory stimulus and behavior), namely source and target, is quantified by assessing whether temporal forecasting of the target variable can be significantly improved by including the source variable and its time lags as covariates. Whereas in the partial information decomposition, an effect between two nodes is quantified by assessing whether the mutual information between their activity is significantly above chance level or not.

Using the Granger formalism, we perform network parameter estimation, followed by statistical testing and false discovery rate control to quantify the foregoing effects. Each effect or “link” is then statistically quantified by the Youden’s J-statistic, a popular summary statistic that includes both type-I and type-II error rates [36,37]. That is, a J-statistic of 0 indicates a non-significant effect, and a J-statistic close to 1 implies a significant effect with small type-I and type-II error probabilities. As such, we can define three categories of neurons (Fig 1, bottom panel):

  • Granger Stimulus (GS) Neuron: as shown in the leftmost panel, neuron j is labeled as a GS neuron if there is a significant effect from the stimulus node to neuron j, i.e., JS↦j is non-zero.

  • Granger Behavior (GB) Neuron: as shown in the rightmost panel, neuron j is labeled as a GB neuron if it exhibits a significant effect to the behavior, i.e., Jj↦B is non-zero.

  • Granger Intersection (GI) Neuron: as shown in the middle panel, neuron j is labeled as a GI neuron if it is both GS and GB, and in addition in regressing the stimulus to the activity of neuron j during readout, including the behavior as an additional regressor does not significantly improve the regression accuracy, i.e., J(B↦/S|j):=1−J(B↦S|j) is non-zero.

Note that by virtue of the last definition, a neuron that is both GS and GB is not necessarily a GI neuron, as it may encode parts of the sensory information that are not informing the behavior, yet its activity could contribute to behavior. This is in fact the main rationale for defining intersection information [15]: the shared information between the behavior and the pair of {stimulus, neuronal activity} may contain a portion that pertains to features of the stimulus that are encoded in neuronal activity but do not inform behavior. Through a refinement of the partial information decomposition framework, this irrelevant portion is removed from the shared information to form II [15].

Here, we control for this irrelevant portion through quantifying J(B↦/S|j): if a neuron is encoding features of the stimulus that inform behavior, then regressing the stimulus to the neuronal activity during the readout window would not benefit from including the behavior as an additional covariate. Conversely, if a neuron is encoding features of the stimulus that do not inform behavior, yet its activity during the readout window affects behavior, then its activity during the readout window is only a poor regressor of the stimulus, and including the behavior as an additional covariate is expected to improve the regression accuracy.

Through a combination of JS↦j, Jj↦B, and J(B↦/ S|j), we will account for both type-I and type-II errors in attributing a GI label to a neuron. Finally, a neuron that fails to fall into any of these categories will remain unlabeled. The resulting G-taxonomy forms a novel labeling of the neurons in the network, as shown in Fig 1 (top left network schematic).

An illustrative simulation study

To highlight the advantages and performance of the proposed G-taxonomy, we consider an illustrative simulation setting as shown in Fig 2A corresponding to a detection task. The network consists of N = 10 neurons observed over T = 10 s, with frame interval of 25 ms. The activity of the network is simulated for a total of L = 50 repeated trials, driven by a combination of exogenous stimuli and an endogenous VAR process of order P = 2, which is assumed to vary slower than the frame rate and hence piecewise-constant over W = 20 frames.

Fig 2. Results of the illustrative simulation study.

Fig 2

A) Example of a simulated 10-neuron network. The time courses of the primary and secondary stimuli, as well as the behavioral readout window are shown as inset plots. The receptive fields of neurons 1, 7, and 10, which are influenced by the stimuli, are shown as 2-by-2 matrices. B) Sample simulated trials with the primary stimulus on (left) and off (right). Rows (top to bottom) show the latent AR process (red), spiking activity (black), and resulting two-photon calcium traces (black). The shaded area show the primary stimulus interval. Red circles overlaid on the calcium traces in the bottom panel indicate spikes from the middle panel. C) The ground truth Granger sensori-behavioral functional taxonomy of the network in panel A. D) Sample trial showing estimated and ground-truth signals for a sample neuron (left). Rows top to bottom show estimated vs. true latent AR process, spiking activity, and calcium observations, respectively.

In each trial, the primary stimulus, s1, was randomly and uniformly turned “on” or “off”. In the “on” condition, the primary stimulus was a 100 ms pulse of magnitude 1. A background zero-mean white noise with variance σprim. stim.2=0.1 was added to the primary stimulus. In order to model a possible confounding effect, a secondary stimulus, s2, was also considered, which was in the form of a short pulse (quarter of the primary stimulus duration) occurring during the second-half of the primary stimulus interval, with the same magnitude and background noise variance (See the schematic time courses of s1 and s2 in Fig 2A). While the primary stimulus is chosen by the experimenter (e.g., intended visual or auditory stimulus), the secondary stimulus is a sensory stimulus that is not accounted for by the experimenter (e.g., unintended visual or auditory distractors). Nevertheless, both can be encoded by the neuronal network and affect the behavioral outcome [15].

Fig 2B shows two sample trials with the primary stimulus on (left) and off (right) for a sample neuron. Note that even when the primary stimulus is off, there could be significant spiking activity due to the fluctuations of the latent endogenous process (red trace in the first row). The binary behavior corresponding to the primary stimulus detection task was generated via a GLM model with covariates from the average activity of a subset of stimulus-driven neurons (i.e., green arrows outgoing from neurons 1, 4 and 7 in Fig 2) during the readout interval, defined as the second half of the primary stimulus interval (see the readout interval highlighted in Fig 2A). In the schematic network of Fig 2A, only neurons 1, 7, and 10 have a non-zero receptive field (i.e., blue arrows incoming from the stimuli). The receptive fields of neurons 1 and 10 are the same, and account for a sliding window average of the primary stimulus (i.e., both lags positive), whereas they are not responsive to the secondary stimulus. Neuron 7, however, has the same receptive fields for both stimuli, which model an onset/offset detector (i.e., the two lags have different polarities). These receptive fields are schematically shown as 2-by-2 tables in Fig 2A.

By design, the network setting of Fig 2A attributes a ground truth sensori-behavioral role to each neuron, which is shown in Fig 2C: neurons 1, 7, and 10 are Granger sensory neurons (i.e., non-zero receptive fields), and neurons 1, 4 and 7 are Granger behavior neurons (i.e., affecting behavior). Neuron 1 encodes a moving average version of the primary stimulus, which is then read out during the readout interval and contributes to the behavior. As such, neuron 1 encodes stimulus information that informs behavior and is thus a Granger intersection neuron. Neuron 7, however, encodes the onset/offset of the primary stimulus s1, which does not significantly contribute to its activity during the readout window. Hence, it is encoding features of the primary stimulus that do not inform behavioral readout. As such, neuron 7 is both Granger sensory and behavior, but not intersection. We expect the inferred G-taxonomy, obtained from the observed neuronal activity and behavioral outcomes only, to closely match the ground truth labels, which are determined by design.

In order to assess the performance of the proposed G-taxonomy, we first generate various random instances of such networks shown in Fig 2A: we constructed randomly generated networks by choosing three of the ten neurons at random to receive input from the primary stimulus, where one of them at random also received input from the secondary stimulus. The VAR coupling coefficients were kept the same across network realizations. Finally, in addition to the neuron receiving input from both stimuli, another stimulus-encoding neuron and a non-stimulus encoding neuron (chosen at random) were considered to form covariates for generating the behavioral outcome.

Fig 2D shows an instance of the estimated endogenous latent process, spiking activity, and reconstructed observations for a sample neuron from a sample network. The estimated variables (dashed traces and gray bars) closely match the ground truth (solid traces and black bars). To assess the performance of the proposed G-taxonomy on this simulated setting, we consider two benchmark methods: 1) Two-stage PSTH: in which the spikes are deconvolved first, using the FCSS procedure [45] to form the peristimulus time histogram (PSTH) of each neuron, followed by fitting a VAR model on said PSTH signals to obtain the network parameters and identify the taxonomy; 2) 2P Data: in which the 2P data are considered to be governed by a VAR process, from which the network parameters and taxonomy are identified [22] (See Methods for more details on these benchmark approaches).

Fig 3A shows the ROC performance plots for the proposed G-taxonomy over 10 random network realizations, as well as those corresponding to the foregoing benchmark methods. The proposed framework achieves perfect detection for the three categories as well as GC links between neurons. The false alarms were negligible for GS, GB, and GI categories, while they were slightly higher for the GC category. This is consistent with the difficulty of identifying the parameters of a GLM model with many parameters from a limited number of trials [36]. The two-stage PSTH and 2P Data methods, however, exhibit poor hit rates, primarily for identifying the GC links and GS neurons. The details of statistical testing and FDR correction are given in the Methods.

Fig 3. Results of the illustrative simulation study (cont’).

Fig 3

A) The baseline ROC performances of detecting the GC links between the neurons and the proposed G-taxonomy are shown for the 2P Data (left), Two-Stage PSTH (middle), and the proposed (right) methods. Each panel is the result of 10 random network realizations and error bars indicate 95% confidence intervals. B) ROC performances for stimulus SNR = 10 dB. C) ROC performances for stimulus SNR = 5 dB. D) ROC performances with spiking model mismatch, where the data is generated by a Poisson point process, but inferred using a Bernoulli model. E) ROC performances for network sub-sampling (10 neurons randomly chosen out of a network of 50 neurons). ROC analysis in panel A shows high sensitivity and specificity for all categories (FDR controlled) for our proposed method, whereas the 2p Data and Two-Stage PSTH suffer from poor hit rate and high false alarm rate (see the dashed ellipsoids for a visual guideline). While the performance of all methods degrades in panels B-E compared to the baseline, our proposed method exhibits more robustness, especially in detecting the GC and GS neurons.

The ROC performance evaluation shown in Fig 3A serves as a baseline comparison. To further assess the robustness of these methods to more realistic experimental conditions, we consider three additional perturbation analyses:

  • 1) Signal-to-noise ratio (SNR) of the Primary Stimulus: Recall that in our generative model, we added a background zero-mean white noise with variance σprim. stim.2=0.1 to the primary stimulus, to account for mismatch in stimulus representation, whereas the estimator in the inverse model is not aware of such mismatch. This amounts to an SNR of 20 dB in the baseline comparison. To further assess the effect of this mismatch, we increased the noise and repeated the comparison for SNR levels of 10 and 5 dB, which are shown in Fig 3B and 3C, respectively. While the performance of the 2P and two-stage PSTH methods degrades severely as SNR decreases, especially in terms of detecting Granger stimulus neurons, and thereby Granger intersection neurons, our proposed method exhibits more noise resilience and operates reliably for SNRs as low as 5 dB.

  • 2) Spiking Model Mismatch: In our baseline model, we assumed a Bernoulli spiking model in both the generative and inverse models. In practice, however, these two spiking models could be different. We thus generated the data using a Poisson spiking model, but used a Bernoulli spiking model for the inverse model, thus inducing a spiking model mismatch. The ROC comparisons are shown in Fig 3D. While our method is able to produce high hit rates and moderate false alarm rates under this scenario, the two benchmark methods are not capable of recovering any of the Granger stimulus and intersection neurons.

  • 3) Network Sub-sampling: The baseline comparison corresponds to the simulated activity of N = 10 neurons, which is a modest number compared to the typical number of neurons observed using two-photon imaging. In practice, the number of neurons used for network analysis is usually a small fraction of the observed neurons, due to the computational requirements of such analysis. This network sub-sampling procedure could thus confound the analysis results, as many of the key underlying processes remain latent. To assess the robustness of our proposed method to this condition, we simulated a network of N = 50 neurons, with a VAR model ensuring at most 8 source neurons are connected to each target neuron. Then, we assigned 10 Granger sensory, 10 Granger behavior, and 5 Granger intersection neurons in a similar fashion as in the case of 10 neurons in our baseline model. Finally, we randomly sub-sampled 10 networks of size N = 10 neurons out of 50, and performed the ROC evaluation shown in Fig 3E. As expected, the GC detection performance of all methods degrades, due to the confounding effect of network sub-sampling [36]. Remarkably, our method is able to recover both Granger sensory and intersection neurons at a high hit rate and low false alarm rate, whereas the other two benchmarks detect none.

In summary, our simulation study highlights how the proposed G-taxonomy can reveal distinct roles of neurons within a network: while specific neurons act as sensory encoding or behavioral readout neurons, there are some integrative nodes in the network that both encode sensory input and drive task-related behavior. These GI neurons bridge the encoding and decoding domains, that are often studied separately, and take the role of functional intermediaries in sensory–behavioral transformation. In addition, our perturbational analyses suggest that while more realistic experimental conditions would affect the performance of our proposed G-taxonomy, it exhibits a higher degree of robustness to said perturbations compared to the existing benchmarks.

Identifying granger sensory neurons in mouse A1 during passive listening

We next apply our proposed network inference and G-taxonomy to experimentally- recorded two-photon calcium imaging data from layer 2/3 of the mouse primary auditory cortex (A1). The dataset, originally reported by [40], consists of trials in which short broad-band noise stimuli are presented to the animal (referred to as Stim. On trials), which are randomly interleaved with silent trials of equal duration (referred to as Stim. Off trials). The stimuli were 75 dB SPL 100 ms broadband noise (4−48 kHz). Each trial was 5.1 s long (1 s pre-stimulus silence + 0.1 s stimulus + 3 s post-stimulus silence), and the inter-trial duration was 3 s. The recordings therefore contained both stimulus-driven and spontaneous neural activity, providing an opportunity to examine both GC links between neurons as well as their stimulus encoding properties.

We analyzed a subset of N = 9 neurons selected at random, with L = 50 stimulus presentation trials per neuron and T = 135 frames (5.1 s) per trial. The fluorescence traces (ΔF/F) of each neuron were normalized based on the average peak amplitude of prominent transients, ensuring consistent scaling across cells. The observation noise covariance matrix was estimated from the first 30 frames of each trial, corresponding to pre-stimulus baseline activity.

To capture the temporal receptive field structure of each neuron, we considered 10 lags of the stimulus, representing responses over a 330 ms window. The effective integration window for the latent AR process was set to W = 10 frames, assuming that neural activity within this window was driven by the same latent cortical process. The target FDR was chosen as 0.01.

The estimated network is shown in Fig 4A, with the detected GS neurons labeled. While some of the GS neurons also participate in the GC network as sources, e.g., neurons 5 and 9, others are not (e.g., neurons 1 and 7). To further validate the detected GS labels, Fig 4A shows the trial averaged responses of all neurons for Stim. Off (gray traces) and Stim. On (blue traces) trials. As it can be visually confirmed, the responses of the GS neurons in Stim. Off and On trials are quite distinct, whereas they are widely overlapping for the non-GS neurons. The J-statistics are also reported in the insets, which are consistent with these visual observations: the J-statistics for neurons 2, 3, 7, and 9 with visibly distinct response profiles under both trial conditions are 0.99, which shows high confidence in labeling them as GS. Neuron 5, however, is detected as GS with a J-statistic of 0.82, which is consistent with the response profiles being more similar.

Fig 4. Identifying Granger sensory neurons in mouse A1 during passive listening.

Fig 4

A) Estimated GC network and GS labels in mouse A1 during passive listening to randomly interleaved trials of silence and white-noise stimuli. B) The trial averaged responses of the neurons in panel A for Stim. Off (gray) and Stim. On (blue) trials. The stimulus interval is shown as a gray vertical hull. The J-statistics of the GS neurons are shown as insets in each sub-panel. The colored hulls show 95% confidence intervals.

Our analysis reveals two key advantages of the proposed G-taxonomy: first, the GS labels are detected conditioned on the entire network activity, which can thereby rule out potential network effects that could be otherwise attributed to stimulus. For instance, the response profiles of neuron 4 under Stim. Off and On trials are dissimilar later throughout the trial, and a statistical test performed on their difference may conclude that this neuron is responsive to the stimulus. However, based on our proposed analysis, this observed difference is likely due to the GC link from another GS neuron, i.e., neuron 9, which exhibits similar response profiles later throughout trial, while being highly responsive to the stimulus onset.

Second, the parametric nature of the underlying statistical tests in detecting GC links as well as the G-taxonomy are likely to have higher statistical power than commonly-used non-parametric tests applied to response differences shown in Fig 4B. This is particularly important when the number of trials and the trial duration are limited. For instance, while neuron 5 is detected as a GC neuron, a simple non-parametric statistical test applied to the response differences would not register as significant. This situation becomes even more stringent after correcting for multiple comparisons across neurons. However, our method tests for the improvement in response prediction variance by including the stimulus as a covariate on a trial to trial basis, and thereby labels neuron 5 as a GS neuron with a J-statistic of 0.82. This implies that while the type I error (i.e., p-value) is less than 0.01 due to the choice of the FDR rate, the test power is at least 0.82.

In summary, our analysis shows that the proposed network inference and G-taxonomy can be used as an alternative to existing approaches in detecting significantly responsive neurons under passive listening to randomly interleaved silent and stimulus-driven trials, with the advantage of ruling out possible network effects as well as increasing the test power compared to commonly-used non-parametric tests for responsiveness.

Granger sensori-behavioral functional taxonomy of neurons in mouse A1 L2/3 during tone discrimination

To test how our framework works in behaving animals, we analyzed two-photon calcium imaging data from the mouse A1 L2/3 during a pure-tone discrimination task [22]. Head-fixed mice performed a go/no-go task while A1 L2/3 activity was recorded. Low-frequency tones (7 or 9.9 kHz) were targets (go) and high-frequency tones (14 or 19.8 kHz) were non-targets (no-go); all four frequencies were randomly interleaved. The animals were trained to wait 0.5 s after the stimulus onset before making a decision (lick or no lick). Trials were labeled as hit (H), miss (M), correct rejection (C) or false alarm (F) based on the first lick [22]. We analyzed both passive blocks, where tones were presented while the mouse was quiescent, and behavior blocks with active task performance with the same tones. Detailed experimental procedures (animal training, imaging, and behavioral definitions) are provided in [22].

Unless otherwise noted, our analyses used a subset of 10 experiments from the data in [22]. The 10 experiments contained 1798 total neurons in the field of views, 225 of which exhibited significant activity in response to tones. Within each selected experiment, we randomly sampled N = 10 neurons and used all L = 50 available trials with T = 135 imaging frames per trial. For each neuron, ΔF/F traces were normalized by the average amplitude of visually identified peak transients to place cells on a comparable scale. The observation noise covariance was estimated from the first 30 frames of each trial (pre-stimulus baseline) and pooled across trials to form a per-neuron variance estimate. Stimuli were represented as binary pulse trains (tone onsets) and we modeled the receptive fields with two temporal lags. The effective integration window for the latent AR process was set to W = 10 frames (330 ms), assuming that neural activity within this window was driven by the same latent cortical process.

Fig 5A summarizes the distribution of detected links across passive and behavior blocks (top) as well as the pooled trial averaged response of all neurons in correct (H & C) vs. incorrect (F & M) trials (bottom). The number of detected links during the passive blocks are significantly larger than that during incorrect trials. In addition, the number of links during incorrect trials is significantly smaller than that for both behavior categories pooled together. These findings are consistent with the results of [22] (Figs 4 and S3 therein) using short integration windows (233 ms) to analyze the connectivity changes during passive and behavior conditions. Compatible with our finding, it is shown in [22] that while the number of GC links for C and F categories are comparable, the number of H links are significantly larger than the M links. The average responses in correct (black) and incorrect (red) trials shown in the bottom panel exhibit intervals of significant difference both during the peri-stimulus and post-stimulus intervals. The time points of significant difference are marked by small vertical bars below the graph, with a family-wise error rate of less than 5% (See Methods for details).

Fig 5. GC network and G-taxonomy analysis of mouse A1 during tone discrimination.

Fig 5

A) number of GC links between neurons across multiple experiments, during passive and behavior conditions (top, * p<0.05; ** p<0.01; *** p<0.001). Average activity of all neurons during correct vs. incorrect behavior are shown at the bottom (N = 100 neurons). B) Average activity of different neuron categories from the proposed G-taxonomy during correct vs. incorrect behavior. GI neurons show notable divergence between correct vs. incorrect conditions that is sustained throughout the post-stimulus interval, whereas the GS and GB neurons exhibit more transient differences. Shaded hulls represent 95% bootstrapped confidence intervals, and black bars below each trace indicate groups of time points that show significant difference between correct vs. incorrect trials (at a 95% confidence level).

To further tease apart the response differences shown in Fig 5A, we leverage our proposed G-taxonomy and refine the trial averages based on the Granger sensori-behavioral relevance of the neurons. Fig 5B shows the aforementioned refinement. The leftmost column in Fig 5B shows the trial averaged responses of Granger sensory (top) and behavior (bottom) neurons. The Granger sensory neurons show significant differences in correct vs. incorrect trials both during the peri-stimulus and post-stimulus intervals, whereas the Granger behavior neurons show different responses later during the trial. Given that some Granger sensory neurons may also be Granger behavior and vice versa, we further inspect the average responses of neurons that are Granger sensory and not behavior (i.e., exclusively GS, top) and those that are Granger behavior and not sensory (i.e., exclusively GB, bottom) in the middle column. Interestingly, the exclusively GS neurons show significant differences between correct vs. incorrect trials early during the stimulus presentation, which does not extend beyond the stimulus off-set and through the rest of the trial. The exclusively GB neurons, however, exhibit response differences mainly during the pre- and peri-stimulus intervals. These two results, not previously reported to the best of our knowledge, suggest that exclusively GS neurons show differences that are specific to the stimulus presentation window and do not persist throughout the trial, and exclusively GB neurons show differences early on and prior to stimulus presentation, which could relate to the behavioral bias of the animals independent of the stimulus category.

In the third column of Fig 5B, we inspect the responses of Granger intersection neurons (top), as well as Granger sensory & behavior neurons that are not Granger intersection (bottom). The Granger intersection neurons exhibit significant response differences between the correct and incorrect trials, which persist throughout the entire post-stimulus interval. This is consistent with [22] (Fig 2 therein), showing the reverberation of intersection information during the trial by inspecting the information ratio between intersection and sensory/choice categories. The Granger sensory & behavior neurons which are not intersection, however, show transient response differences mainly in the pre-stimulus interval, in stark contrast to the differences exhibited by the Granger intersection neurons. This result suggests that being Granger sensory & behavior is not sufficient for the neuron to carry sensori-behaviorally relevant information, whereas Granger intersection neurons carry information from both the sensory stimulus and behavior that persists throughout the trial.

Finally, we probed the response differences in incorrect vs. correct trials refined by the behavioral outcomes of lick or no-lick in Fig 6. The top row shows the responses of Granger sensory (left), behavior (middle), and intersection (right) neurons during the lick trials, in which correct and incorrect outcomes correspond to H and F, respectively. The Granger sensory neurons show response differences shortly after the stimulus off-set, whereas the Granger behavior and intersection neurons exhibit response differences that persist throughout the trial, more prominently for the hit trials. The bottom row similarly shows the responses during no-lick trials, in which correct and incorrect outcomes correspond to C and M, respectively. In contrast to the top panel, for the no-lick trials there are no notable differences between the responses of either category of neurons in C vs. M trials. This result, not previously reported to the best of our knowledge, suggests that the differences observed across the behavioral categories, indeed depend on the animals’ actual response, and not just on the correct vs. incorrect categorization; while the H and F categories show significant response differences that are distinct for Granger sensory, behavior, and intersection neurons, the neuronal responses in M and C categories seem to be similar and not dependent on their functional type.

Fig 6. GC network and G-taxonomy analysis of mouse A1 during tone discrimination (cont’).

Fig 6

Average activity of different neuron categories from the proposed G-taxonomy during correct vs. incorrect behavior for lick (top) and no-lick (bottom) trials. Consistent with Fig 5, GI neurons exhibit sustained difference between correct and incorrect trials, but only for lick trials. During no-lick behavior, no significant difference in the activity of neurons across correct and incorrect trials is registered. Shaded hulls represent 95% bootstrapped confidence intervals, and black bars below each trace indicate groups of time points that show significant difference between correct vs. incorrect trials (at a 95% confidence level).

Discussion

We introduced a unified statistical framework for joint estimation of GC influences among neurons in an ensemble as well as a functional taxonomy, namely G-taxonomy, that quantifies the sensori-behavioral relevance of each neuron, all directly from two-photon calcium imaging data. Our proposed G-taxonomy labels a neuron as: (1) Granger Stimulus (GS), implying that the stimulus is a significant predictor of its activity, (2) Granger Behavior (GB), implying that the neuron’s activity is a significant predictor of the behavior, and (3) Granger Intersection (GI), implying that the neuron encodes sensory information that is relevant to behavior. The GC links among neurons as well as the foregoing functonal G-taxonomy are established using rigorous statistical tests. Using both simulated and experimental recordings from mouse auditory cortex, we demonstrated the utility of the proposed framework in identifying the GC links between the neurons as well as establishing their sensori-behavioral relevance.

Our proposed approach is inspired by the Intersection Information (II) framework [15,16,22,24,52], in which the partial information decomposition (PID) machinery is used to quantify how much information, in the sense of Shannon’s mutual information, a neuron carries about the sensory stimulus, the behavioral readout, or both. While the II framework has successfully been applied to a wide variety of neural data and has resulted in novel insights regarding the interaction of sensory encoding and behavior, it comes with a number of challenges: First, due to the exponential complexity of the PID framework in the number of neurons, the II framework has mainly been restricted to a pair or triplets of neurons or variables; Second, the II framework assumes that the spiking activity is directly observed or its reliable estimates from indirect measurements are available; Third, the II framework represents the stimulus by simple features chosen a priori, often constant and univariate, in favor of the ease of solving the optimization problems involved in PID. As such, application of the II framework to larger networks of neurons, presented with potentially complex and time-varying stimuli, and measured indirectly via modalities such as two-photon imaging.

Our approach addresses these shortcomings through several mechanisms: First, by adopting the Granger machinery, as opposed to PID, we use a hierarchical parametric generative model that admits efficient estimation and scales favorably with network size. This is in contrast to the common applications of II that use nonparametric and model-free estimates of mutual information between pairs or triplets of neurons. Leveraging the milder dependence of estimation accuracy to the sample size in parametric models, we form a series of rigorous statistical tests that allow family-wise error correction and thus preserve statistical power. In the II framework, however, nonparametric tests are often used, which are known to have less statistical power than parametric ones, especially when the number of trials and their duration are limited.

Second, the parametric nature of our hierarchical models allows us to represent the stimuli as a multivariate time-varying signal, whose effects are parameterized by high-dimensional receptive fields. As such, no a priori assumptions are made on which features of the stimuli are relevant, and instead these features are captured in a data-driven fashion through the estimated receptive fields.

Finally, while most existing methods perform network inference in a two-stage fashion, by first estimating spikes and then forming network measures from said spike estimates, our modeling and estimation framework integrates several techniques such as dynamic Bayesian network models, state-space inference, Pólya-Gamma augmentation, and variational inference to avoid two-stage processing and thereby minimize estimation biases. It is worth noting that while our proposed method intergates the two stages of analysis into one, it requires a priori knowledge of cell locations. However, some of the existing two-stage methods simultaneously detect cell locations, calcium traces, and spiking activities [53] in the first stage and are thus less dependent on pre-processing.

Another key advantage of our proposed framework is to simultaneously estimate the functional connectivity between the neurons in the sense of Granger’s temporal predictability, and to attribute a sensori-behavioral functional taxonomy to all the neurons, also in the sense of Granger’s temporal predictability, to quantify their role in the network function. Most existing methods solve these two inverse problems independently and disjointly: they either focus on capturing the encoding or readout properties of the neurons, regardless of their connectivity, or just aim at estimating functional connectivity by ignoring the effects of the stimulus.

The advantage of solving these two problems simultaneously is two-fold: First, in detecting the GC links between neurons, the effect of external stimuli as a confound would be ruled out. For instance, if two neurons are being driven by the same stimulus with different latencies, by explicitly modeling the receptive fields and quantifying the stimulus effect, the detected GC links would only be resulting from the coupling of the endogenous latent process governing the neuron’s stimulus-independent activity; Second, in attributing the sensori-behavioral relevance to each neuron, the network effects arising from endogenous interactions between the neurons as a confound would be ruled out. For instance, we can rule out if heightened activity of a neuron corresponding to a particular behavioral category is due to its relevance to behavior, or is just due to receiving an endogenous input from another neuron that contributes to behavior. It must be noted that our forward/inverse models that form the basis of the G-taxonomy are not aimed at establishing a physical circuit model, but serve as a statistical model that captures the functional dependencies among neurons in terms of their networked activity. As such, the links that are found between neurons may not be interpreted as direct synaptic connections. Our proposed G-taxonomy can also be thought of as a clustering methodology, which explicitly uses the functional sensori-behavioral relevance of the neurons’ activity to categorize them, akin to methods such as demixed PCA [54].

We presented a comprehensive simulation study that showcases the intricacies involved in attributing sensori-behavioral relevance to neurons in a network and demonstrated that our proposed framework reliably achieves this task, while existing two-stage approaches suffer from poor hit rate and high false alarms.

We also applied our proposed framework to two datasets of two-photon recordings from mouse A1 layer 2/3. The first dataset corresponded to a network of mouse A1 neurons during passive listening in a sequence of trials in which either a broad-band white noise auditory stimulus is on or off in a randomly interleaved fashion [40]. Our proposed method labeled a set of neurons as GS neurons, which upon further inspection of their trial averaged activity, exhibited highly distinct responses in stimulus on vs. off trials. Interestingly, while some neurons exhibited distinct responses in these two conditions, they were not labeled as GS; indeed, the difference in their activity was much later throughout the trial in the late post-stimulus period. It is worth noting that this dataset did not include any behavioral measurements, such as pupillometry or whisking activity. If principle, if non-task-relevant behavioral measures exist, one can identify GB neurons and use them to obtain a more accurate baseline of neural activity, e.g., accounting for compulsive non-task-relevant behavior [55].

The second dataset was collected during a tone discrimination task [22], in which the mice were trained to lick a spout after the onset of low frequency target tones and avoid licking when high frequency non-target tones are presented. Summarizing the GC network and G-taxonomy statistics across several animals resulted in several key findings: First, comparing the GC networks between the passive and behavioral conditions of correct vs. incorrect showed that the incorrect GC networks are sparser than the passive condition, consistent with the results of [22] (Figs 4 and S3 therein). Second, neurons labeled as GI showed persistent differences in their responses between correct vs. incorrect trials throughout the post-stimulus period, also consistent with the reported reverberation of information in II neurons [22] (Fig 2 therein).

Third, neurons that were exclusively labeled as GS only showed transient response differences between correct vs. incorrect trials in early peri-stimulus period, and those labeled as exclusively GB, showed transient response differences predominantly in the pre-stimulus period. This result suggest that these neurons may not play a key role in linking sensory stimulus to behavioral outcome as their activity profile does not correlate with the animal’s behavioral category in a persistent fashion. Finally, neurons that were labeled as GI showed a striking difference in their activity profile, persistently during the post-stimulus period. Interestingly, the activity of neurons labeled as GS and GB, but not GI, as starkly contrasting to those labeled as GI. This result is consistent with the rationale of the II framework, implying that neurons that encode sensory stimulus and are predictive of behavior, may not necessarily encode features of the stimuli that are relevant to behavior.

While our proposed framework successfully recovers GC links and sensori-behavioral relevance directly from two-photon imaging data, several limitations remain. The current model assumes linear vector autoregressive dynamics and fixed time lags between neural influences, which may not fully capture nonlinear or time-varying dependencies present in real cortical circuits. In particular, in light of the representational drift phenomenon in the cortex [56], our results are only valid over a time interval during which the cortical representation is stationary, e.g., within a few trials. Averaging across trials within an experimental session would only capture an average-sense taxonomy which could be confounded with representational drift. Future work could incorporate kernelized or hierarchical time-varying extensions [57] to better represent complex neuronal response properties.

Another caveat of the Granger formalism is the so-called “predictive separability” requirement: the source of a GC effect must have a separate predictive contribution on the target than the target’s past activity. As such, when two sources are being driven by a synchronized latent process, no GC effect would be attributed between them, as the past of each is a strong predictor of their future, even though one source could be indeed driving the other one. This issue is addressed in the Convergent Cross Mapping (CCM) approach [58,59]: if the manifold of the past activity of a target contains information about the source, then the source’s activity can be reconstructed using a cross-mapping from the manifold of the past activity of the target. As such, a common latent process driving both source and target would not necessarily embed the source in the target’s activity manifold [60]. In light of the presence of brain-wide oscillatory activity in some two-photon imaging experiments [61], such latent common input could violate the predictive separability required by the Granger formalism. In practice, GC is more robust to noise and requires smaller sample complexity for reliable inference. Given that we did not observe any brain-wide oscillatory activity in the datasets used in this work (possibly due to using slower calcium indicators than used in [61]), we have no evidence supporting that our results are confounded by the violation of predictive separability.

Additionally, analyses were performed on relatively small neuronal subsets due to computational constraints. Extending this framework to full-field datasets with hundreds of neurons will require optimized inference and regularization strategies. Finally, although GC reflects predictive influence, it does not imply direct synaptic connectivity. Combining this approach with anatomical tracing or targeted optogenetic perturbations will be essential for establishing causal validation.

In summary, this study presents a unified and statistically grounded framework for uncovering directed functional interactions and sensori-behavioral relevance of network activity, in the sense of Granger’s temporal predictability, from two-photon data. By jointly modeling stimuli, neural activity, and behavioral responses, it captures how sensory information can dynamically reorganizes network connectivity across behavioral states. Beyond auditory processing, the same principles can be extended to other sensory systems and experimental paradigms, offering a powerful tool for studying how distributed neural populations transform sensory input into behaviorally relevant computation.

Methods

We first describe the generative model in detail, followed by the inverse problem and the proposed solution. The proposed inverse solution consists of three main parts: 1) efficient network parameter estimation, 2) full and reduced models used in the Granger formalism, and 3) statistcal testing of GC links and GS, GB, and GI attributes.

Generative model formulation

Consider a standard experimental setting where we have the fluorescence traces of N neurons within a trial of length T frames for a total of L independent trials. We define 𝐲t,l:=[yt,l(1),yt,l(2),⋯,yt,l(N)]⊤, 𝐳t,l:=[zt,l(1),zt,l(2),⋯,zt,l(N)]⊤, and 𝐧t,l:=[nt,l(1),nt,l(2),⋯,nt,l(N)]⊤ as the vectors representing the noisy observations, intracellular calcium concentrations, and ensemble spiking activities, respectively, at trial l and frame t. We aim to capture the temporal patterns within 𝐲t,l using the following state-space model [40,42,62]:

𝐲t,l=𝐀z𝐳t,l+𝐰t,l,𝐳t,l=α𝐳t−1,l+𝐧t,l, (1)

where 𝐀z∈ℝN×N represents a diagonal scaling matrix capturing the cross-neuron intensity variations, 𝐰t,l is zero-mean i.i.d. Gaussian noise with covariance Σw, and 0≤α<1 is the state transition parameter capturing the calcium decay dynamics via first-order autoregression. Note that our chosen state-space model exhibits non-Gaussian characteristics due to the binary nature of the spiking activity, that is, nt,l(j)∈{0,1}.

To model the spiking data, we employ two covariates within a point process or Generalized Linear Model framework with Bernoulli statistics. The first covariate, designated as the latent endogenous process xt,l(j), accounts for spontaneous and stimulus-independent neural activity. The second component models the responses driven by external stimuli 𝐬t,l∈ℝJ, where J denotes the flattened length of a multi-variate stimulus and its previous lags effective at time t. The latter component is denoted by the exogenous component. We hereafter assume that the latent endogenous process evolve over a comparatively slower time scale relative to the imaging frame rate, i.e., observations within a window of length W≥1 are driven by the same instances of the latent process [40]:

nt,l(j)~Bernoulli(λt,l(j)),λt,l(j)=exp(μl(j)+xk,l(j)+𝐝j⊤𝐬t,l)1+exp(μl(j)+xk,l(j)+𝐝j⊤𝐬t,l), (2)

where k:=⌈tW⌉, μl(j) is the baseline rate parameter of neuron j in trial l, and 𝐝j is the flattened receptive field of neuron j encoding the effect of stimulus 𝐬t,l. The non-linear mapping relating the different covariates to λt,l(j) is referred to as the logistic link, which is the canonical link for a Bernoulli process within the Generalized Linear Model framework [63,64].

To account for the endogenous and directed coupling of the neurons, we employ a vector autoregressive (VAR) process to model the dynamics of xk,l(1:N). Letting 𝐱k,l:=[xk,l(1),⋯,xk,l(N)]⊤∈ℝN, the VAR model can be expressed as follows [65]:

𝐱k,l=∑p=1P𝐀x(p)𝐱k−p,l+ηk,l,ηk,l~𝒩(0,Σx) (3)

where 𝐀x(p)∈ℝN×N represents the AR coefficients associated with the pth time lag, and the noise covariance Σx∈ℝN×N is a diagonal matrix with the jth diagonal entry given by σj2.

Finally, we use a categorical probabilistic model to account for observed behavior. Letting 𝒯RO⊆{1,2,⋯,T} be the readout interval (e.g., the second half of the stimulus interval), the binary behavior bl (e.g., lick/no-lick) in trial l is modeled as

bl~Bernoulli(exp(γ0+∑j=1Nγjn¯RO,l(j))1+exp(γ0+∑j=1Nγjn¯RO,l(j))), (4)

where

n¯RO,l(j)=1|𝒯RO|∑t∈𝒯ROnt,l(j) (5)

is the average activity of neuron j in trial l during the readout interval 𝒯RO, γ0 is the behavior bias parameter, and γj capture the contribution of the different neurons to the behavior. Fig 1 illustrates the key elements of the foregoing generative model.

The overall inverse problem can be stated as follows: given the observed fluorescence traces from N neurons over L independent trials of duration T each, y1:T,1:L(1:N), extract the Granger Causality (GC) links among the neurons as well as the proposed G-taxonomy of GS, GB, and GI for all the N neurons in the population.

The objective of the inverse problem hinges on accurately estimating the network parameters {𝐀x(p)}p=1P,Σx, the receptive fields {𝐝j}j=1N, and behavior parameters {γj}j=1N. Then, to test whether a neuron i has a GC influence on neuron j, we first estimate the network parameters without imposing any restrictions, namely the full model. Then, we set the coupling VAR parameters from neuron i to neuron j in the and re-estimate all the other network parameters, resulting in the reduced model. If including xk,l(i) in the prediction of xk,l(j) results in significantly higher likelihood, the full model is preferred over the reduced model, indicating the existence of a GC link from neuron i to j [36]. A similar procedure can be applied to the inference of G-taxonomy, albeit with more technical care in defining the respective full and reduced models.

In the subsequent sections, we first give a detailed account of the network parameter estimation procedure, followed by defining the full and reduced models for G-taxonomy and the associated statistical tests.

Inverse solution (1): Efficient network parameter estimation.

Let θ:={{𝐀x(p)}p=1P,Σx,{𝐝j}j=1N} be the set of network parameters to be estimated. To this end, we use the EM framework, which offers an iterative procedure for obtaining a sequence of parameter estimates θ^(r) such that:

p({yt,l(j)}t=1:T,l=1:Lj=1:N|θ^(r+1))≥p({yt,l(j)}t=1:T,l=1:Lj=1:N|θ^(r)). (6)

The overall architecture of the EM procedure used for parameter estimation in our work is shown in Fig 7. We illustrate this procedure for the full model first. The joint log-likelihood of the observations, latent processes and parameters can be expressed as:

Fig 7. Schematic depiction of the inverse solution.

Fig 7

The E-step includes two nested iterative procedures, namely variational inference via Pólya-Gamma augmentation (VI/PG) and Iteratively Re-weighted Least Squares/Fixed Interval Smoothing (IRLS/FIS). The first and second moments of the latent endogenous process are then computed and fed to the M-step to compute the network parameters.

logp(y1:T,1:L(1:N),z1:T,1:L(1:N),x1:K,1:L(1:N),θ)=∑j,k,l,w=1N,K,L,W((z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j))(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)−log(1+exp(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)))−∑k,l,w=1K,L,W12(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)⊤Σw−1(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)−KLW2log|Σw|−∑k,l=1K,L12(𝐱k,l−∑p=1P𝐀x(p)𝐱k−p,l)⊤Σx−1(𝐱k,l−∑p=1P𝐀x(p)𝐱k−p,l)−KL2log|Σx|+C, (7)

where C stands for terms that are not functions of {yt,l(j),nt,l(j),zt,l(j)}1:T,1:L(1:N), {xk,l(j)}1:K,1:L(1:N), or θ. Hereafter, we use shortened notations 𝐲:={yt,l(j)}1:T,1:L(1:N),𝐲:={zt,l(j)}1:T,1:L(1:N), 𝐱:={xk,l(j)}1:K,1:L(1:N), and 𝐝:={𝐝j}j=1N for convenience.

The E-step.

We need to compute the so-called Q-function given by:

Q(θ|θ^(r)):=𝔼[logp(𝐲,𝐳,𝐱)|𝐲,θ^(r)]

where θ^(r) is the parameter estimates at iteration r. Utilizing the state augmentation technique, we express the VAR model as:

[𝐱k,l,𝐱k−1,l,⋯,𝐱k−(P−1),l]⊤⏟:=𝐱~k,l=𝐀~x[𝐱k−1,l,𝐱k−2,l,⋯,𝐱k−P,l]⊤⏟:=𝐱~k−1,l+[ηk,l,01×(P−1)N]⊤⏟η~k,l, (8)

with

𝐀~x:=[𝐀x(1)𝐀x(2)⋯𝐀x(P)𝐈(P−1)N×(P−1)N0(P−1)N×N], (9)

and η~k,l~𝒩(0,Σ~x) where

Σ~x=[Σx0N×(P−1)N0(P−1)N×N0(P−1)N×(P−1)N], (10)

complete log-likelihood of Eq. (7) can be more concisely expressed as:

∑j,k,l,w=1N,K,L,W((z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j))(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)−log(1+exp(μl(j)+x~k,l(j)+𝐝j⊤𝐬(k−1)W+w,l)))−∑k,l,w=1K,L,W12(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)⊤Σw−1(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)−KLW2log|Σw|−∑k,l=1K,L12(𝐱~k,l−𝐀x𝐱~k−1,l)⊤Σ~x−1(𝐱~k,l−𝐀x𝐱~k−1,l)−KL2log|Σx|+C, (11)

Upon inspecting Eq. (11), the complexity of the E-step becomes evident: the joint log-likelihood function involves interactions that are not purely quadratic, hence the expectations can not be expressed using the first and second moments, as in the Gaussian case. To address this, we use an instance of Variational Inference (VI) [66–68], a powerful technique from Bayesian statistics. VI approximates complex posterior distributions by transforming the inference problem into an optimization problem. This method reduces computational complexity compared to traditional approaches based on sampling, providing an efficient and scalable solution for parameter estimation.

To proceed with the VI framework, we assume that the constants α, 𝐀z and Σw are either predetermined or can be reliably estimated from pilot trials. For instance, we treat 𝐀z as a diagonal matrix, estimating its diagonal entries from the intensity of spiking events. Moreover, α can be estimated based on the decay rate of observed spikes, as it relates to the calcium indicator and imaging technique. Finally, Σw can be estimated using the background fluorescence in intervals without spiking activity.

Variational inference: Decoupling via Pólya-gamma augmentation.

When confronted with problems encompassing both discrete and continuous random variables, the straightforward utilization of VI frequently results in the generation of intractable probability density functions. In our specific model, deriving an appropriate variational distribution for 𝐱t,l using standard distributions becomes intractable due to the interrelationships between Bernoulli and Gaussian random variables in the posterior. To address this challenge, we utilize the Pólya-Gamma (PG) latent variable augmentation technique [43,69,70]. By examining Eq. (7), we observe that the posterior density, p(𝐱|𝐳,𝐱,𝐀x,𝐝,Σx), admits conditional independence in k and l, through expressing:

p(𝐱k,l|𝐳,𝐲,𝐀x,𝐝,Σx)∝p(𝐱k,l|𝐀x,Σx)∏w,j=1N,W(exp(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l))z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j)1+exp(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l). (12)

This latter density possess the desired characteristics for the PG augmentation scheme which relies on the following identity [40,43]:

aψ−log(1+exp(ψ))=(a−12)ψ−log2+∫0∞(−ω2ψ2+logpPG(1,0)(ω))dω, (13)

where pPG(1,0)(ω) represents the PG density. Comparing the first term in Eq. (11) with the left-hand side of Eq. (13), we can identify a:=(z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j)) and ψ:=μl(j)+xk,l(j)+𝐝j⊤𝐬t,l. We then introduce a set of i.i.d. auxiliary latent random variables ωt,l(j)~PG(1,0) for 1≤j≤N,1≤t≤T and 1≤l≤L. Letting ω:={ωt,l(j)}t,l=1T,L, we have:

logp(𝐲,𝐳,𝐳,ω,θ)=∑j,k,l,w=1N,K,L,W((z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j)−12)(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)−12ω(k−1)W+w,l(j)(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)2+logPPG(1,0)(ω(k−1)W+w,l(j)))−∑k,l,w=1K,L,W12(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)⊤Σw−1(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)−KLW2log|Σw|−∑k,l=1K,L12(𝐱~k,l−𝐀~x𝐱~k−1,l)⊤Σ~x−1(𝐱~k,l−𝐀~x𝐱~k−1,l)−KL2log|Σx|+C (14)

By taking 𝐳^ and 𝐝^ as parameters and assuming their estimates are available, we next assume a mean-field variational density family and adopt the Coordinate Ascent Variational Inference (CAVI) procedure to derive the optimal variational densities [40]. The procedures for updating the parameters 𝐳^ and 𝐝^ will be detailed in the subsequent section.

The augmented log-likelihood in Eq. (14) exhibits a quadraticdependence on 𝐱~k,l and 𝐳t,l. Consequently, the conditional distribution p(𝐱~k,l|𝐲,𝐳,ω^,θ^(r)), given an estimate ω^, can be identified as Gaussian. This property enables us to leverage fixed interval smoothing [44] and covariance smoothing [48] for efficient computation of the conditional expectation for 𝐱~k,l, 𝐱~k,l𝐱~k,l⊤, and 𝐱~k−1,l𝐱~k,l⊤ given 𝐲,𝐳,ω^,θ^(r), to fully characterize the expectations in the E-step.

The augmented log-likelihood in Eq. (14) also implies the conditional distribution p(ωt,l(j)|𝐱,θ)~PG(1,ct,l(j)), with ct,l(j):=|μl(j)+𝔼{xk,l(j)|𝐲,𝐳,ω^,θ^(r)}+𝐝j⊤𝐬t,l|, where t:=(k−1)W+w. Therefore, we estimate the PG variables as ω^t,l(j):=𝔼[ωt,l(j)|𝐱,θ^(r)]=12ct,l(j)tanh(ct,l(j)2). To improve the accuracy of the latent PG variable estimation, we alternate between estimating the first and second moments of 𝐱~k,l and ω^t,l(j), before proceeding to the M-step.

VI parameter updates.

Recall that we treat 𝐳 and 𝐝 as an unknown parameters, instead of unknown random variables whose densities would require variational parametrization. This choice is due to the temporal dependencies induced by the interaction of 𝐳 and 𝐱 in Eq. (7), which complicate quantifying the mean-field variational densities.

Note that the variable nt,l(j)=zt,l(j)−αzt−1,l(j) is a Bernoulli random variable, posing a set of constraints zt,l(j)−αzt−1,l(j)∈{0,1}, for t=1,⋯,T, l=1,2,⋯,L, and j=1,⋯,N. The combinatorial nature these constraint renders the estimation of 𝐳 intractable. Following the relaxation procedure of [40,45], we instead use the modified log-likelihood:

logp(𝐲,𝐳,𝐱,ω,θ)=∑j,k,l,w=1N,K,L,W((ν(k−1)W+w,l(j)|z(k−1)W+w,l(j)−αz(k−1)W+w−1,l(j)|−12)×(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)−12ω(k−1)W+w,l(j)(μl(j)+xk,l(j)+𝐝j⊤𝐬(k−1)W+w,l)2+logPPG(1,0)(ω(k−1)W+w,l(j)))−∑k,l,w=1K,L,W12(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)⊤Σw−1(𝐲(k−1)W+w,l−𝐀z𝐳(k−1)W+w,l)−KLW2log|Σw|−∑k,l=1K,L12(𝐱k,l−∑p=1P𝐀x(p)𝐱k−p,l)⊤Σx−1(𝐱k,l−∑p=1P𝐀x(p)𝐱k−p,l)−KL2log|Σx|+C, (15)

where ν(k−1)W+w,l(j):=βj|μl(j)+𝔼{xk,l(j)|𝐲,𝐳,ω^,θ^(r)}+𝐝j⊤𝐬(k−1)W+w,l| with βj≥0 denoting a hyper-parameter. In our analysis, we set the value of βj inversely proportional to the variance of the observed fluorescence signal as βj=0.7/(Σw)j. To maximize the modified log-likelihood in Eq. (15) with respect to 𝐳, we utilize the Iteratively Re-weighted Least Squares (IRLS) procedure [46]. At iteration i given a current estimate 𝐳^[i−1], the log-likelihood can be identified as that of the state-space model:

𝐲t,l=𝐀z𝐳t,l+ηt,l,𝐳t,l=α𝐳t,l+𝐯t,l (16)

In this equation, ηt,l~𝒩(0,Ση) and 𝐯t,l~𝒩(0,Σ𝐯t,l[i]) where Σ𝐯t,l[i] is a diagonal matrix with (Σ𝐯t,l[i])j,j:=(z~t,l(j)[i−1]−αz~t−1,l(j)[i−1])2+ϵ2/νt,l(j), for some small constant ϵ>0. Thus, the next iterate 𝐳^[i] can be efficiently computed using FIS [44]. Note that this method for estimating the calcium concentrations 𝐳t,l functions as a soft spike deconvolution, seamlessly integrated within the variational inference framework. This differs significantly from traditional two-stage estimators, which rely on hard spike deconvolution.

With the updated estimates of 𝐳^, the kernel parameters 𝐝 can be estimated by maximizing the log-likelihood in Eq. 14 with respect to 𝐝j:

𝐝^j(r+1)=[∑t,lT,Lω^t,l(j)𝐬t,l𝐬t,l⊤]−1[∑t,lT,L(𝐳^t,l(j)−α𝐳^t−1,l(j)−12)𝐬t,l−μl(j)ω^t,l(j)𝐬t,l−ω^t,l(j)𝐬t,l𝔼{x⌈tW⌉,l(j)|𝐲,𝐲,ω^,θ^(r)}]. (17)

Finally, the VI procedure iterates between updating the variational densities and the parameters.

The M-step.

In the M-step the parameters 𝐀x and Σx are updated to maximize the Q-function. The update rules for the jth row of 𝐀x and Σx are given by:

𝐚^j(r+1)=(∑k,lK,L𝔼[xk,l(j)𝐱~k−1,l⊤|𝐲,𝐳^,ω^,θ^(r)])(∑k,lK,L𝔼[𝐱~k−1,l𝐱~k−1,l⊤|𝐲,𝐳^,ω^,θ^(r)])−1, (18)
Σ^x(r+1)=1KL(∑k,lK,LE[𝐱~k,l𝐱~k,l⊤|𝐲,𝐳^,ω^,θ^(r)]−E[𝐱~k,l𝐱~k−1,l⊤|𝐲,𝐳^,ω^,θ^(r)]𝐀^x(r+1)⊤−𝐀^x(r+1)E[𝐱~k−1,l𝐱~k,l⊤|𝐲,𝐳^,ω^,θ^(r)]+𝐀^x(r+1)E[𝐱~k−1,l𝐱~k−1,l⊤|𝐲,𝐳^,ω^,θ^(r)]𝐀^x(r+1)⊤), (19)

The EM algorithm proceeds until a standard stopping criterion is met [40].

Inverse solution (2): Full and reduced models in the granger formalism

Given the foregoing efficient procedure to estimate the network parameters, we next need to define the nested full and reduced models for the GC links as well as the G-taxonomy to be able to extract relevant statistics for hypothesis testing.

Full and reduced models for GC links between neurons.

In the reduced model for assessing a GC link from neuron i to neuron m, we remove the influence of the source neuron on the target neuron in Eq. (3) by setting the corresponding VAR coefficients to zero. The update rule of Eq. (18) for all j≠m remains the same. For j = m, however, we utilize a reduced vector 𝐱~k−1,l\i∈ℝ(N−1)×P, derived by removing the elements of 𝐱~k−1,l that correspond to neuron i. The update for 𝐚^m(r+1)∈ℝ(N−1×)P is then given by:

𝐚^m(r+1)=(∑k,lK,L𝔼[xk,l(m)𝐱~k−1,l\i⊤|𝐲,𝐳^,ω^,θ^(r)])(∑k,lK,L𝔼[𝐱~k−1,l\i𝐱~k−1,l\i⊤|𝐲,𝐳^,ω^,θ^(r)])−1, (20)

The coefficients corresponding to neuron i are then explicitly set to zero. Similarly, Eq. (19) is modified by replacing 𝐱~k,l and 𝐱~k−1,l with 𝐱~k,l\i and 𝐱~k−1,l\i, respectively.

Full and reduced models for GS and GB neurons.

In the reduced model for assessing the effect of the stimulus on neuron m, we set 𝐝m=0 and estimate all the other network parameters. In other words, Eq. (2) for all j≠m remains the same, and we have:

nt,l(m)~Bernoulli(λt,l(m)),λt,l(m)=exp(μl(m)+xk,l(m))1+exp(μl(m)+xk,l(m)), (21)

The reduced model for assessing the effect of the activity of neuron m to behavior, corresponds to setting γm=0, i.e.:

bl~Bernoulli(exp(γ0+∑j=1,j≠mNγjn¯RO,l(j))1+exp(γ0+∑j=1,j≠mNγjn¯RO,l(j))), (22)

The parameters γj, j≠m can be estimated by maximizing the joint log-likelihood of {bl}l=1L using the Newton–Raphson algorithm.

Full and reduced models for GI neurons.

Recall that a neuron m being both GS and GB does not imply that it encodes stimulus information which is subsequently utilized for task-related behavior, i.e., a GI neuron. Mirroring the rationale of II theory based on mutual information, here we need to see if estimating the stimulus from the average activity of neuron m during the readout window would be significantly improved if the behavior is included as a covariate or not. Noting that the behavior is typically a categorical variable and the average activity of neuron m during the readout window is constant, using them to estimate the time-course of the multi-dimensional stimulus does not constitute a rich enough model to test the aforementioned effect, since both the full and any possible reduced model are likely to be equally and drastically poor. We thus suppress the temporal dimension of the stimulus 𝐬t,l, and consider a categorical representation for sl∈{1,2,⋯,Ξ}. For instance, if the stimulus corresponds to a modulated presentation of different pure tones, the Ξ categories correspond to the number of tones to generate the stimulus set.

To this end, we use a multinomial logistic model as the full model:

P(sl=ξ)=exp(ρ0,ξ(m)+ρ1,ξ(m)bl+ρ2,ξ(m)n¯RO,l(m))∑ξ′=1Ξexp(ρ0,ξ′(m)+ρ1,ξ′(m)bl+ρ2,ξ′(m)n¯RO,l(m)), (23)

where the parameters {ρ0,ξ(j),ρ1,ξ(j),ρ2,ξ(j)}j=1,ξ=1N,Ξ are estimated by maximizing the multinomial joint log-likelihood of {sl}l=1L using the Newton–Raphson algorithm.

The reduced model can then be formulated by constraining ρ1,ξ(m)=0, thereby removing the direct influence of the behavior on the predicted stimulus category. As such, the reduced model isolates the contribution of the activity of neuron m during the readout interval to stimulus prediction, independent of the behavior. The rest of the parameters {ρ0,ξ(j),ρ2,ξ(j)} are re-estimated under the constraint ρ1,ξ(m)=0 using the same optimization procedure.

Inverse solution (3): Statistical testing of GC links and GS, GB, and GI attributes.

The test statistic to be used to compare the full and reduced models is the deviance difference [36,37]:

D(i→j):=2(ℓf−ℓr), (24)

where ℓf and ℓr denote the log-likelihood of the observations corresponding to the full and reduced models, respectively. Given that the latent endogenous process is unobserved, computing the log-likelihood of the observed fluorescence traces is not straightforward, as it involves intractable integrations over the range of the latent process. We thus adopt the procedure of [71] that uses a specific sample path of the latent endogenous process that significantly simplifies the computation of the log-likelihood. The key idea is to factorize the likelihood of the observations as:

p(𝐲)=p(𝐲,𝐳)p(𝐳|𝐲)=p(𝐲,𝐳|𝐱)p(𝐱)p(𝐳|𝐲)p(𝐱|𝐲,𝐳)=∏t,lT,Lp(𝐲t,l,𝐳t,l|𝐱1:K,1:L)∏k,lK,Lp(𝐱k,l|𝐱k−1,l)p(𝐳|𝐲)p(𝐱K|𝐲,𝐳)∏k=1K−1p(𝐱k|𝐱k+1,𝐲,𝐳), (25)

where 𝐱 and 𝐳 can be taken as any possible choice of the latent endogenous process and calcium concentrations. The numerator of Eq. (25) can be expressed in closed-form using our generative model. However, the denominator lacks such simplicity, primarily due to the intricate interplay between xk,l and the observation model. To address this complexity, we employ the Laplace approximation by making the assumption p(𝐱k,l|𝐱k+1:K,l,𝐲,𝐳)~𝒩(𝐱ˇk|K,l,𝐏k|K,l), where 𝐱ˇk|K,l and 𝐏k|K,l satisfy [71,72]:

xˇk|K,l=(I−𝐂k+1,l𝐀^x)𝔼{𝐱~k,l|𝐲,𝐳,ω^,θ^}+𝐂k+1,l𝐱k+1,l, (26)
𝐏k|K,l=(𝐈−𝐂k+1,l𝐀^x)Cov{𝐱~k,l|𝐲,𝐳,ω^,θ^}, (27)

where

𝐂k+1,l=Cov{𝐱~k,l|𝐲,𝐳,ω^,θ^}𝐀^x⊤(𝐀^xCov{𝐱~k,l|𝐲,𝐳,ω^,θ^}𝐀^x⊤+Σ^x)−1, (28)

with 𝐀^x and Σ^x being the estimated AR coefficients and the first and second moments of 𝐱~k,l being available following the parameter estimation procedure. Initializing with 𝐱ˇK|K,l:=𝔼{𝐱~K,l|𝐲,𝐳,ω^,θ^(r)}, for k=K−1,K−2,⋯,1, we proceed in a backward fashion by setting 𝐱k+1,l=𝐱ˇk+1|K,l in Eq. (26) to obtain a sample path {𝐱ˇk|K,l}k=1K. Evaluating the denominator of Eq. (25) at this sample path yields Cp(𝐳|𝐲)/∏k=1K(2π)P(N−1)/2|𝐏k|K,l|1/2. Finally, we evaluate the likelihood at the estimated 𝐳^ from the parameter estimation procedure. The simplified log-likelihood of the observations can be expressed as:

logp(𝐲)=logp(𝐳^|𝐲)−∑t,l=1T,L12(𝐲t,l−𝐀z𝐳^t,l)⊤Σw−1(𝐲t,l−𝐀z𝐳^t,l)−TL2log(|Σ𝐰|)+∑j,k,l,w=1N,K,L,W((z^(k−1)W+w,l(j)−αz^(k−1)W+w−1,l(j))(μl(j)+xˇk|K,l(j)+𝐝j⊤𝐬(k−1)W+w,l)−log(1+exp(μl(j)+xˇk|K,l(j)+𝐝j⊤𝐬(k−1)W+w,l)))−∑k,l=1K,L12(𝐱ˇk|K,l−𝐀^x𝐱ˇk−1|K,l)⊤Σ^x−1(𝐱ˇk|K,l−𝐀^x𝐱ˇk−1|K,l)−KL2log|Σ^x|+∑k,lK,L12log|𝐏k|K,l|+C.

Note that in the absence of observation noise 𝐰t,l, we have 𝐲t,l=𝐀z𝐳t,l, and therefore p(𝐳^|𝐲)=δ(𝐳^−𝐀z−1𝐲). Assuming that the observation noise is small, and the prior p(𝐳t,l) induced by the VAR process 𝐱t,l is smooth around 𝐳^t,l, the posterior p(𝐳^t,l|𝐲)∝𝒩(𝐀z𝐳^t,l,σw2𝐈)p(𝐳^t,l) is approximately Gaussian with mean 𝐀z−1𝐲 and covariance σw2𝐈 and is therefore negligibly dependent on the network parameters. Following this approximation, p(𝐳^|𝐲) takes similar values in the full and reduced models. Therefore, logp(𝐳^|𝐲) cancels out in computing D(i↦j). In fact, in order to speed up the computation of the estimation framework, one can use the regularization parameters νt,l(j)=βj independent of the network parameters, so that 𝐳^ can be computed once for the full model only and used in the reduced model. This way, p(𝐳^|𝐲) in the full and reduced model is evaluated at the same estimate 𝐳^.

The foregoing expression of the log-likelihood of the observations can be used to compute D(i↦j) as well as D(S↦j), denoting the deviance differences of the effect of neuron i to j and the stimulus to neuron j, respectively. The log-likelihood of the full and reduced models for the behavior can be computed using the closed-form expression of the log-likelihood of Bernoulli variables, resulting in the deviance difference D(j↦B). Same goes for the log-likelihood of the stimulus categories in the full and reduced models corresponding to GI neurons, which provides D(B↦S|j).

Asymptotic analysis of the deviance difference D(i↦j) involves the properties of the central and non-central chi-squared distributions [36,37,73–75]. Let M be the number of parameters that are removed in the reduced model. Then, in the absence of a GC effect, D(i↦j) asymptotically (in the observation length) follows a chi-squared distribution with M degrees of freedom D(i↦j) ~χ2(M), and in the presence of a GC effect, it follows a non-central chi-squared distribution, χ2(M,ν(i↦j)) with the same degree of freedom M and non-centrality parameter ν(i↦j). The non-centrality parameter ν(i,↦j) can be estimated as ν^(i↦j)=max{D(i↦j)−M,0}[36]. The degree of freedom M for assessing the different effects in our framework are given as:

M={P(i.e., the VAR order),for GC linksJ(i.e., the dimension of the receptive field),for GS labels1,for GB labels1for GI labels (29)

The p-value of the test comparing the full and reduced model based on D(i↦j) is therefore computed as 1−ℱχ2(M)(D(i↦j)), where ℱχ2(M)(·) is the CDF of χ2(M). For a target significance level of δ, if we detect a GC link using the thresholding rule 1−ℱχ2(M)(D(i↦j))<δ, we can control the false discovery rate (FDR) across all estimated GC links by applying the Benjamini–Yekutielli (BY) procedure [50], at an average FDR of δ¯=(𝒩+1)2𝒩log𝒩δ, where 𝒩 is the number of simultaneous tests.

To summarize each test, we utilize the J-statistic associated with the link i↦j, defined as

J(i↦j)=1−δ−ℱχ2(M,ν^(i↦j))(ℱχ2(M)−1(1−δ)), (30)

with ℱχ2(M,ν^(i↦j))(·) denoting the CDF of χ2(M,ν^(i↦j)). Values of J(i↦j)≈0 indicate small evidence to reject the null hypothesis, whereas J(i↦j)≈1 denotes strong support for the alternative hypothesis. Thus, the J-statistic, bounded within [0,1], serves as an interpretable index of the strength associated with each inferred GC effect. Similarly, we can assign the following J-statistics to the detected GS and GB neurons:

J(j~GS):=J(S↦j)=1−δS−ℱχ2(P,ν^(S↦j))(ℱχ2(P)−1(1−δS)), (31)
J(j~GB):=J(j↦B)=1−δB−ℱχ2(1,ν^(j↦B))(ℱχ2(1)−1(1−δB)), (32)

where δS and δB denote the target significance levels for the GS and GB categories, respectively, and are determined given a target FDR level and the number of simultaneous tests.

For a GI neuron j, we define J(B↦S|j)=1−δI−ℱχ2(1,ν^(B↦S|j))(ℱχ2(1)−1(1−δI)), where δI is the target significance level for the GI category. Given that three different statistical tests are required to identify GI neurons, by the union bound, the sum of type-I and type-II error probabilities of attributing a GI label are bounded by

3−J(j~GS)−J(j~GB)−J(B↦/S|j),

where J(B↦/S|j):=1−J(B↦S|j). Subtracting this expression from unity yields the following lower bound on the J-statistic for a GI neuron:

J(j~GI)≥max{J(j~GS)+J(j~GB)+J(B↦/S|j)−2,0}, (33)

and can be used as measure of statistical confidence in labeling a neuron as GI.

Computational and sample complexity of G-taxonomy

The key computational bottleneck of the proposed G-taxonomy is in the E-step, where the FIS algorithm needs to be repeatedly computed over the trial duration. Recall that for N neurons whose latent processes {xk,l(j)}1:K,1:L1:N are modeled as VAR(P), the state-space dimension is NP. The complexity of the FIS per iteration is thus 𝒪(KN3P3) [76]. Letting Miter be the product of the iteration numbers in the three loops of the overall EM algorithm (See Fig 7), the total computational complexity of testing (N2) possible GC links would be 𝒪(MiterKN5P3). Testing for the GS, GC, and GI categories would not change the order of the overall complexity, as it requires an additional 𝒪(KN) increase in complexity. Finally, the sample complexity for reliable VAR parameter estimation requires L=Ω(NP) trials [77].

As a benchmark for comparison, we consider the computational complexity of partial information decomposition (PID) that is the basis of the II methodology [15,20]. For N time-series of length K, the total number of information atoms to be computed (e.g., redundancy and synergy for N = 2) is given by the Dedekind number of order N [20,78], which scales super-exponentially as 2c12N/N, for some constant c1. Then, considering a quantization of the time-series at q≥2 levels, which is required for non-parametric estimation of information atoms, each atom requires solving an iterative optimization problem over coupled q-dimensional probability mass functions, which requires 𝒪(qc2NK), for some constant c2 per iteration [20,21]. Considering a total number of Miter iterations, the overall complexity of PID would be 𝒪(Miter2c12N/Nqc2NK), which is super-exponential in N and exponential in NK. In addition, the sample complexity for reliable non-parametric estimation of the information atoms requires L=Ω(qNK) trials, which is exponential in NK.

The prohibitive computational complexity of PID limits its applications to typically N = 2 or 3 [15,79]. Under the assumption that the N time-series are jointly Gaussian, the computational complexity can be reduced to 𝒪(2c12N/NN3K3) with a sample complexity of L=Ω(NK) trials, which mitigates the scaling with K [80], but is still super-exponential in N.

Benchmark methods

In our simulation studies, we have used two main benchmark methods, namely, Two-stage PSTH and 2P Data. For completeness, we give a more detailed description of each method here.

Benchmark 1: Two-stage PSTH.

This method can be thought of as an ablation of our proposed method, in which the latent signal xk,l(j) is replaced by an estimate of the spikes n^k,l(j) obtained by the spike deconvolution method FCSS [45], thereby bypassing the entire variational inference pipeline. Other choices of spike deconvolution are possible and used in existing work [81–85]. Then, the kernel parameters 𝐝^j, VAR parameters 𝐚^j and covariance Σ^x are estimated using Eqs. (17)-(19) by replacing xk,l(j) with n^k,l(j). It is quite common in neuroscience to take the trial average spiking responses, i.e., the PSTH, to estimate the encoding parameter 𝐝^j, hence the terminology PSTH.

Benchmark 2: 2P data.

Here, the two-photon observations yt,l(j) are taken as a surrogate of the spikes n^k,l(j), followed by the same procedure explained above in the Two-Stage PSTH method [22,86].

Statistical testing of trial average differences

In Figs 5 and 6, for each sub-panel we computed the average difference between the correct and incorrect trials and obtained the point-wise 95% confidence intervals using bootstrapping. Then, we first identified individual time points with significant positive difference at a level of 5% (bootstrap test, one-sided). Among these individually significant points, starting from the most significant peak level, we iteratively lowered the level and included all the sub-level points as a group and recomputed the group-level p-value via Monte Carlo resampling (10,000 surrogates), until the significance level crossed 5%. The final such group indicated the time points that show simultaneously significant positive differences. In the case of finding more than one peak at the same level, we performed Bonferroni correction for multiple groups to maintain the overall significance level at 5%. This procedure is adapted from [41,87], which we refer the reader to for more details.

Data pre-processing

The data from mouse A1 during passive listening and tone discrimination are adopted from [40] and [22], respectively, which we refer to for all experimental details. As for the pre-processing steps required for our proposed method, first a circular ROI was manually drawn over each cell body to extract raw fluorescence traces from individual cells. Neuropil contamination subtraction was performed on the raw fluorescence traces of each cell [86,88,89] according to Fcorrected=Fcell−αnFneuropil, where αn was set to 0.7 [86]. Then, the baseline fluorescence Fbaseline for each cell was calculated by averaging Fcorrected during the silent baseline period. Finally, the baseline corrected and normalized traces were obtained as ΔFF=Fcorrected−FbaselineFbaseline. The two-photon observations used in our analyses are the output of this pre-processing pipeline. It is worth noting that more advanced neuropil contamination subtraction methods [90] could further improve the accuracy of our method.

Data Availability

Data and software implementations in MATLAB v2024b of the algorithms discussed are publicly available at: https://doi.org/10.13016/i9ar-ymsc.

Funding Statement

This work has been supported in part by the National Science Foundation Awards No. ECCS2032649 and OISE2020624 (to BB) and the National Institutes of Health Awards No. RO1DC017785 (to POK) and U19NS107464 (to BB and POK). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

References

  • 1.Ding N, Simon JZ. Emergence of neural encoding of auditory objects while listening to competing speakers. Proc Natl Acad Sci U S A. 2012;109(29):11854–9. doi: 10.1073/pnas.1205381109 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Fritz JB, David SV, Radtke-Schuller S, Yin P, Shamma SA. Adaptive, behaviorally gated, persistent encoding of task-relevant auditory information in ferret frontal cortex. Nat Neurosci. 2010;13(8):1011–9. doi: 10.1038/nn.2598 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Laurent G, Davidowitz H. Encoding of olfactory information with oscillating neural assemblies. Science. 1994;265(5180):1872–5. doi: 10.1126/science.265.5180.1872 [DOI] [PubMed] [Google Scholar]
  • 4.Mesgarani N, Cheung C, Johnson K, Chang EF. Phonetic feature encoding in human superior temporal gyrus. Science. 2014;343(6174):1006–10. doi: 10.1126/science.1245994 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.Simoncelli EP, Olshausen BA. Natural image statistics and neural representation. Annu Rev Neurosci. 2001;24:1193–216. doi: 10.1146/annurev.neuro.24.1.1193 [DOI] [PubMed] [Google Scholar]
  • 6.Brown EN, Frank LM, Tang D, Quirk MC, Wilson MA. A statistical paradigm for neural spike train decoding applied to position prediction from ensemble firing patterns of rat hippocampal place cells. J Neurosci. 1998;18(18):7411–25. doi: 10.1523/JNEUROSCI.18-18-07411.1998 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Eden UT, Frank LM, Barbieri R, Solo V, Brown EN. Dynamic analysis of neural encoding by point process adaptive filtering. Neural Comput. 2004;16(5):971–98. doi: 10.1162/089976604773135069 [DOI] [PubMed] [Google Scholar]
  • 8.Graf ABA, Kohn A, Jazayeri M, Movshon JA. Decoding the activity of neuronal populations in macaque primary visual cortex. Nat Neurosci. 2011;14(2):239–45. doi: 10.1038/nn.2733 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Huang Y, Brandon MP, Griffin AL, Hasselmo ME, Eden UT. Decoding movement trajectories through a T-maze using point process filters applied to place field data from rat hippocampal region CA1. Neural Comput. 2009;21(12):3305–34. doi: 10.1162/neco.2009.10-08-893 [DOI] [PubMed] [Google Scholar]
  • 10.Kamitani Y, Tong F. Decoding the visual and subjective contents of the human brain. Nat Neurosci. 2005;8(5):679–85. doi: 10.1038/nn1444 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Naselaris T, Kay KN, Nishimoto S, Gallant JL. Encoding and decoding in fMRI. Neuroimage. 2011;56(2):400–10. doi: 10.1016/j.neuroimage.2010.07.073 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Paninski L, Pillow J, Lewi J. Statistical models for neural encoding, decoding, and optimal stimulus design. Prog Brain Res. 2007;165:493–507. doi: 10.1016/S0079-6123(06)65031-0 [DOI] [PubMed] [Google Scholar]
  • 13.Pillow JW, Ahmadian Y, Paninski L. Model-based decoding, information estimation, and change-point detection techniques for multineuron spike trains. Neural Comput. 2011;23(1):1–45. doi: 10.1162/NECO_a_00058 [DOI] [PubMed] [Google Scholar]
  • 14.Panzeri S, Harvey CD, Piasini E, Latham PE, Fellin T. Cracking the Neural Code for Sensory Perception by Combining Statistics, Intervention, and Behavior. Neuron. 2017;93(3):491–507. doi: 10.1016/j.neuron.2016.12.036 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Pica G, Piasini E, Safaai H, Runyan C, Harvey C, Diamond M, et al. Quantifying how much sensory information in a neural code is relevant for behavior. In: Advances in Neural Information Processing Systems. 2017. p. 3686–96.
  • 16.Pica G, Soltanipour M, Panzeri S. Using intersection information to map stimulus information transfer within neural networks. Biosystems. 2019;185:104028. doi: 10.1016/j.biosystems.2019.104028 [DOI] [PubMed] [Google Scholar]
  • 17.Chicharro D, Panzeri S. Synergy and Redundancy in Dual Decompositions of Mutual Information Gain and Information Loss. Entropy. 2017;19(2):71. doi: 10.3390/e19020071 [DOI] [Google Scholar]
  • 18.Latham PE, Nirenberg S. Synergy, redundancy, and independence in population codes, revisited. J Neurosci. 2005;25(21):5195–206. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Schneidman E, Bialek W, Berry MJ 2nd. Synergy, redundancy, and independence in population codes. J Neurosci. 2003;23(37):11539–53. doi: 10.1523/JNEUROSCI.23-37-11539.2003 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Williams PL, Beer RD. Nonnegative decomposition of multivariate information. arXiv preprint arXiv:10042515. 2010.
  • 21.Gutknecht AJ, Wibral M, Makkeh A. Bits and pieces: understanding information decomposition from part-whole relationships and formal logic. Proc Math Phys Eng Sci. 2021;477(2251):20210110. doi: 10.1098/rspa.2021.0110 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Francis NA, Mukherjee S, Koçillari L, Panzeri S, Babadi B, Kanold PO. Sequential transmission of task-relevant information in cortical neuronal networks. Cell Rep. 2022;39(9):110878. doi: 10.1016/j.celrep.2022.110878 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Koçillari L, Celotto M, Francis NA, Mukherjee S, Babadi B, Kanold PO, et al. Behavioural relevance of redundant and synergistic stimulus information between functionally connected neurons in mouse auditory cortex. Brain Inform. 2023;10(1):34. doi: 10.1186/s40708-023-00212-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Koçillari L, Celotto M, Francis NA, Mukherjee S, Babadi B, Kanold PO, et al. Measuring stimulus-related redundant and synergistic functional connectivity with single cell resolution in auditory cortex. In: International Conference on Brain Informatics. Springer; 2023. p. 45–56. [Google Scholar]
  • 25.Park H, Arazi A, Talluri BC, Celotto M, Panzeri S, Stocker AA, et al. Confirmation Bias through Selective Readout of Information Encoded in Human Parietal Cortex. bioRxiv. 2025;:2024–06. [DOI] [PMC free article] [PubMed]
  • 26.Runyan CA, Piasini E, Panzeri S, Harvey CD. Distinct timescales of population coding across cortex. Nature. 2017;548(7665):92–6. doi: 10.1038/nature23020 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Lütcke H, Gerhard F, Zenke F, Gerstner W, Helmchen F. Inference of neuronal network spike dynamics and topology from calcium imaging data. Front Neural Circuits. 2013;7:201. doi: 10.3389/fncir.2013.00201 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Pachitariu M, Stringer C, Harris KD. Robustness of Spike Deconvolution for Neuronal Calcium Imaging. J Neurosci. 2018;38(37):7976–85. doi: 10.1523/JNEUROSCI.3339-17.2018 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Seth AK, Barrett AB, Barnett L. Granger causality analysis in neuroscience and neuroimaging. J Neurosci. 2015;35(8):3293–7. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Barnett L, Barrett AB, Seth AK. Granger causality and transfer entropy are equivalent for Gaussian variables. Phys Rev Lett. 2009;103(23):238701. doi: 10.1103/PhysRevLett.103.238701 [DOI] [PubMed] [Google Scholar]
  • 31.Parra LC, Silvan A, Nentwich M, Madsen J, Parra VE, Babadi B. VARX Granger analysis: Models for neuroscience, physiology, sociology and econometrics. PLoS One. 2025;20(1):e0313875. doi: 10.1371/journal.pone.0313875 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Amblard P-O, Michel OJJ. On directed information theory and Granger causality graphs. J Comput Neurosci. 2011;30(1):7–16. doi: 10.1007/s10827-010-0231-x [DOI] [PubMed] [Google Scholar]
  • 33.Amblard P-O, Michel O. The Relation between Granger Causality and Directed Information Theory: A Review. Entropy. 2013;15(1):113–43. doi: 10.3390/e15010113 [DOI] [Google Scholar]
  • 34.Quinn CJ, Kiyavash N, Coleman TP. Directed Information Graphs. IEEE Trans Inform Theory. 2015;61(12):6887–909. doi: 10.1109/tit.2015.2478440 [DOI] [Google Scholar]
  • 35.Kim S, Putrino D, Ghosh S, Brown EN. A Granger causality measure for point process models of ensemble neural spiking activity. PLoS Comput Biol. 2011;7(3):e1001110. doi: 10.1371/journal.pcbi.1001110 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Sheikhattar A, Miran S, Liu J, Fritz JB, Shamma SA, Kanold PO, et al. Extracting neuronal functional network dynamics via adaptive Granger causality analysis. Proc Natl Acad Sci U S A. 2018;115(17):E3869–78. doi: 10.1073/pnas.1718154115 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Soleimani B, Das P, Dushyanthi Karunathilake IM, Kuchinsky SE, Simon JZ, Babadi B. NLGC: Network localized Granger causality with application to MEG directional functional connectivity analysis. Neuroimage. 2022;260:119496. doi: 10.1016/j.neuroimage.2022.119496 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Manomaisaowapak P, Nartkulpat A, Songsiri J. Granger Causality Inference in EEG Source Connectivity Analysis: A State-Space Approach. IEEE Trans Neural Netw Learn Syst. 2022;33(7):3146–56. doi: 10.1109/TNNLS.2021.3096642 [DOI] [PubMed] [Google Scholar]
  • 39.Das P, Babadi B. Non-Asymptotic Guarantees for Reliable Identification of Granger Causality via the LASSO. IEEE Trans Inf Theory. 2023;69(11):7439–60. doi: 10.1109/tit.2023.3296336 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Rupasinghe A. Direct extraction of signal and noise corrections from two-photon calcium imaging of ensemble neuronal activity. eLife. 2021;10:e69812. doi: 10.7554/eLife.69812 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Jendrichovsky P, Khosravi S, Rupasinghe A, Maximov K, Guo P, Babadi B, et al. Patchy harmonic functional connectivity of the mouse auditory cortex. Proc Natl Acad Sci U S A. 2025;122(27):e2510012122. doi: 10.1073/pnas.2510012122 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Smith AC, Brown EN. Estimating a state-space model from point process observations. Neural Comput. 2003;15(5):965–91. doi: 10.1162/089976603765202622 [DOI] [PubMed] [Google Scholar]
  • 43.Polson NG, Scott JG, Windle J. Bayesian inference for logistic models using Pólya–Gamma latent variables. J Am Stat Assoc. 2013;108(504):1339–49. [Google Scholar]
  • 44.Rauch HE, Striebel CT, Tung F. Maximum likelihood estimates of linear dynamic systems. AIAA J. 1973;3(8):1445–50. [Google Scholar]
  • 45.Kazemipour A, Liu J, Solarana K, Nagode DA, Kanold PO, Wu M, et al. Fast and Stable Signal Deconvolution via Compressible State-Space Models. IEEE Trans Biomed Eng. 2018;65(1):74–86. doi: 10.1109/TBME.2017.2694339 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Ba D, Babadi B, Purdon PL, Brown EN. Convergence and Stability of Iteratively Re-weighted Least Squares Algorithms. IEEE Trans Signal Process. 2014;62(1):183–95. doi: 10.1109/tsp.2013.2287685 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47.Shumway RH, Stoffer DS. An approach to time series smoothing and forecasting using the EM algorithm. J Time Ser Anal. 1982;3(4):253–64. doi: 10.1111/j.1467-9892.1982.tb00349.x [DOI] [Google Scholar]
  • 48.P J, M JM. Covariances for smoothed estimates in state space models. Biometrika. 75(3):601–2. [Google Scholar]
  • 49.Youden WJ. Index for rating diagnostic tests. Cancer. 1950;3(1):32–5. doi: 10.1002/1097-0142(1950)3:1<32::aid-cncr2820030106>3.0.co;2-3 [DOI] [PubMed] [Google Scholar]
  • 50.Benjamini Y, Yekutieli D. The control of the false discovery rate in multiple testing under dependency. Ann Statist. 2001;29(4). doi: 10.1214/aos/1013699998 [DOI] [Google Scholar]
  • 51.Truccolo W, Eden UT, Fellows MR, Donoghue JP, Brown EN. A point process framework for relating neural spiking activity to spiking history, neural ensemble, and extrinsic covariate effects. J Neurophysiol. 2005;93(2):1074–89. [DOI] [PubMed] [Google Scholar]
  • 52.Panzeri S, Harvey CD, Piasini E, Latham PE, Fellin T. Cracking the neural code for sensory perception by combining statistics, intervention, and behavior. [DOI] [PMC free article] [PubMed]
  • 53.Pnevmatikakis EA, Soudry D, Gao Y, Machado TA, Merel J, Pfau D, et al. Simultaneous Denoising, Deconvolution, and Demixing of Calcium Imaging Data. Neuron. 2016;89(2):285–99. doi: 10.1016/j.neuron.2015.11.037 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54.Kobak D, Brendel W, Constantinidis C, Feierstein CE, Kepecs A, Mainen ZF, et al. Demixed principal component analysis of neural population data. Elife. 2016;5:e10989. doi: 10.7554/eLife.10989 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55.Musall S, Kaufman MT, Juavinett AL, Gluf S, Churchland AK. Single-trial neural dynamics are dominated by richly varied movements. Nat Neurosci. 2019;22(10):1677–86. doi: 10.1038/s41593-019-0502-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Schoonover CE, Ohashi SN, Axel R, Fink AJP. Representational drift in primary olfactory cortex. Nature. 2021;594(7864):541–6. doi: 10.1038/s41586-021-03628-7 [DOI] [PubMed] [Google Scholar]
  • 57.Rupasinghe A, Mukherjee S, Babadi B. Adaptive Frequency-domain Granger Causal Inference from Neuronal Ensemble Data. In: 2020 54th Asilomar Conference on Signals, Systems, and Computers. IEEE; 2020. p. 101–5.
  • 58.Sugihara G, May R, Ye H, Hsieh C, Deyle E, Fogarty M, et al. Detecting causality in complex ecosystems. Science. 2012;338(6106):496–500. doi: 10.1126/science.1227079 [DOI] [PubMed] [Google Scholar]
  • 59.Ye H, Deyle ER, Gilarranz LJ, Sugihara G. Distinguishing time-delayed causal interactions using convergent cross mapping. Sci Rep. 2015;5:14750. doi: 10.1038/srep14750 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 60.Takens F. Detecting strange attractors in turbulence. In: Rand DA, Young LS, editors. Dynamical systems and turbulence, Warwick 1980. vol. 898 of Lecture Notes in Mathematics. Berlin, Heidelberg: Springer; 1981. p. 366–81. [Google Scholar]
  • 61.Tort-Colet N, Resta F, Montagni E, Pavone F, Allegra Mascaro AL, Destexhe A. Assessing brain state and anesthesia level with two-photon calcium signals. Sci Rep. 2023;13(1):3183. doi: 10.1038/s41598-023-30224-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 62.Paninski L, Ahmadian Y, Ferreira DG, Koyama S, Rahnama Rad K, Vidne M, et al. A new look at state-space models for neural data. J Comput Neurosci. 2010;29(1–2):107–26. doi: 10.1007/s10827-009-0179-x [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 63.McCullagh P, Nelder JA. Generalized Linear Models. 2nd ed. London: Chapman and Hall/CRC. [Google Scholar]
  • 64.Bishop CM. Pattern Recognition and Machine Learning. New York: Springer. [Google Scholar]
  • 65.Dhamala M, Rangarajan G, Ding M. Estimating Granger causality from fourier and wavelet transforms of time series data. Phys Rev Lett. 2008;100(1):018701. doi: 10.1103/PhysRevLett.100.018701 [DOI] [PubMed] [Google Scholar]
  • 66.Jordan MI, Ghahramani Z, Jaakkola TS, Saul LK. An introduction to variational methods for graphical models. Mach Learn. 2000;37:183–233. [Google Scholar]
  • 67.Blei DM, Kucukelbir A, McAuliffe JD. Variational inference: A review for statisticians. J Am Stat Assoc. 2017;112(518):859–77. [Google Scholar]
  • 68.Beal MJ. Variational algorithms for approximate Bayesian inference. London: University College London; 2003. [Google Scholar]
  • 69.Pillow JW, Scott J. Fully Bayesian inference for neural models with negative-binomial spiking. In: Pereir F, Burges CJC, Bottou L, Weinberger KQ, editors. Advances in Neural Information Processing Systems. vol. 25. Curran Associates Inc; 2012. p. 1898–906. [Google Scholar]
  • 70.Linderman S, Adams RP, Pillow JW. Bayesian latent structure discovery from multi-neuron recordings. In: Advances in Neural Information Processing Systems. p. 2002–10.
  • 71.Frühwirth-Schnatter S. Data augmentation and dynamic linear models. Department of Statistics and Mathematics; Available from: https://epub.wu.ac.at/392/ [Google Scholar]
  • 72.Soleimani B, Das P, Kulasingham J, Simon JZ, Babadi B. Granger Causal Inference from Indirect Low-Dimensional Measurements with Application to MEG Functional Connectivity Analysis. In: 2020 54th Annual Conference on Information Sciences and Systems (CISS). IEEE; 2020. p. 1–5.
  • 73.Davidson RR, Lever WE. The limiting distribution of the likelihood ratio statistic under a class of local alternatives. Sankhā A. 1970;32(2):209–24. [Google Scholar]
  • 74.Wald A. Tests of statistical hypotheses concerning several parameters when the number of observations is large. Trans Amer Math Soc. 1943;54(3):426–82. doi: 10.1090/s0002-9947-1943-0012401-3 [DOI] [Google Scholar]
  • 75.Wilks SS. The Large-Sample Distribution of the Likelihood Ratio for Testing Composite Hypotheses. Ann Math Statist. 1938;9(1):60–2. doi: 10.1214/aoms/1177732360 [DOI] [Google Scholar]
  • 76.Haykin SS. Adaptive Filter Theory. 4th edition. Upper Saddle River, NJ: Prentice Hall; 2002. [Google Scholar]
  • 77.Vershynin R. High-dimensional probability: an introduction with applications in data science. Cambridge University Press; 2018. [Google Scholar]
  • 78.Bertschinger N, Rauh J, Olbrich E, Jost J, Ay N. Quantifying Unique Information. Entropy. 2014;16(4):2161–83. doi: 10.3390/e16042161 [DOI] [Google Scholar]
  • 79.Celotto M, Bím J, Tlaie A, De Feo V, Toso A, Lemke S, et al. An information-theoretic quantification of the content of communication between brain regions. Adv Neural Inform Process Syst. 2023;36:64213–65. [Google Scholar]
  • 80.Barrett AB. Exploration of synergistic and redundant information sharing in static and dynamical Gaussian systems. Phys Rev E Stat Nonlin Soft Matter Phys. 2015;91(5):052802. doi: 10.1103/PhysRevE.91.052802 [DOI] [PubMed] [Google Scholar]
  • 81.Najafi F, Elsayed GF, Cao R, Pnevmatikakis E, Latham PE, Cunningham JP. Excitatory and inhibitory subnetworks are equally selective during decision-making and emerge simultaneously during learning. Neuron. 2020;105(1):165–79. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 82.Soudry D, Keshri S, Stinson P, Oh M-H, Iyengar G, Paninski L. Efficient “Shotgun” Inference of Neural Connectivity from Highly Sub-sampled Activity Data. PLoS Comput Biol. 2015;11(10):e1004464. doi: 10.1371/journal.pcbi.1004464 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 83.Yatsenko D, Josić K, Ecker AS, Froudarakis E, Cotton RJ, Tolias AS. Improved estimation and interpretation of correlations in neural circuits. PLoS Comput Biol. 2015;11(3):e1004083. doi: 10.1371/journal.pcbi.1004083 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 84.Ramesh RN, Burgess CR, Sugden AU, Gyetvan M, Andermann ML. Intermingled ensembles in visual association cortex encode stimulus identity or predicted outcome. Neuron. 2018;100(4):900–15. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 85.Kerlin A, Mohar B, Flickinger D, MacLennan BJ, Dean MB, Davis C. Functional clustering of dendritic activity during decision-making. eLife. 2019;8:e46966. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 86.Francis NA, Winkowski DE, Sheikhattar A, Armengol K, Babadi B, Kanold PO. Small Networks Encode Decision-Making in Primary Auditory Cortex. Neuron. 2018;97(4):885-897.e6. doi: 10.1016/j.neuron.2018.01.019 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 87.Khosravi S, Jendrichovsky P, Maximov K, Kanold PO, Babadi B. Extracting two-dimensional signal correlation maps via Gaussian process regression with Zernike means. In: Proceedings of the 2025 Asilomar Conference on Signals, Systems, and Computers. IEEE.
  • 88.Liu J, Whiteway MR, Sheikhattar A, Butts DA, Babadi B, Kanold PO. Parallel Processing of Sound Dynamics across Mouse Auditory Cortex via Spatially Patterned Thalamic Inputs and Distinct Areal Intracortical Circuits. Cell Rep. 2019;27(3):872–85. doi: 10.1016/j.celrep.2019.03.069 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 89.Bowen Z, Winkowski DE, Kanold PO. Functional organization of mouse primary auditory cortex in adult C57BL/6 and F1 (CBAxC57) mice. Sci Rep. 2020;10(1):10905. doi: 10.1038/s41598-020-67819-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 90.Keemink SW, Lowe SC, Pakan JMP, Dylda E, van Rossum MCW, Rochefort NL. FISSA: A neuropil decontamination toolbox for calcium imaging signals. Sci Rep. 2018;8(1):3493. doi: 10.1038/s41598-018-21640-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014820.r001

Decision Letter 0

Daniel Bush, Alain Nogaret

17 May 2026

Granger Sensori-Behavioral Taxonomy of Neuronal Ensemble Activity from Two-Photon Calcium Imaging Data

PLOS Computational Biology

Dear Dr. Babadi,

Thank you for submitting your manuscript to PLOS Computational Biology. After careful consideration, we feel that it has merit but does not fully meet PLOS Computational Biology's publication criteria as it currently stands. Therefore, we invite you to submit a revised version of the manuscript that addresses the points raised during the review process.

Please submit your revised manuscript by Jul 17 2026 11:59PM. If you will need more time than this to complete your revisions, please reply to this message or contact the journal office at ploscompbiol@plos.org. When you're ready to submit your revision, log on to https://www.editorialmanager.com/pcompbiol/ and select the 'Submissions Needing Revision' folder to locate your manuscript file.

Please include the following items when submitting your revised manuscript:

* A letter that responds to each point raised by the editor and reviewer(s). You should upload this letter as a separate file labeled 'Response to Reviewers'. This file does not need to include responses to formatting updates and technical items listed in the 'Journal Requirements' section below.

* A marked-up copy of your manuscript that highlights changes made to the original version. You should upload this as a separate file labeled 'Revised Manuscript with Track Changes'.

* An unmarked version of your revised paper without tracked changes. You should upload this as a separate file labeled 'Manuscript'.

As the corresponding author, your ORCID iD is verified in the submission system and will appear in the published article. PLOS supports the use of ORCID, and we encourage all coauthors to register for an ORCID iD and use it as well. Please encourage your coauthors to verify their ORCID iD within the submission system before final acceptance, as unverified ORCID iDs will not appear in the published article. Only the individual author can complete the verification step; PLOS staff cannot verify ORCID iDs on behalf of authors.

We look forward to receiving your revised manuscript.

Kind regards,

Alain Nogaret, PhD

Academic Editor

PLOS Computational Biology

Daniel Bush

Section Editor

PLOS Computational Biology

Additional Editor Comments:

The three reviewers are positive about the approach developed in the paper. However they have also made extensive comments and suggestions that need addressing for the paper to meet publication requirements.

Journal Requirements:

If the reviewer comments include a recommendation to cite specific previously published works, please review and evaluate these publications to determine whether they are relevant and should be cited. There is no requirement to cite these works unless the editor has indicated otherwise.

1) We ask that a manuscript source file is provided at Revision. Please upload your manuscript file as a .doc, .docx, .rtf or .tex. If you are providing a .tex file, please upload it under the item type u2018LaTeX Source Fileu2019 and leave your .pdf version as the item type u2018Manuscriptu2019.

2) Please upload all main figures as separate Figure files in .tif or .eps format. For more information about how to convert and format your figure files please see our guidelines:

https://journals.plos.org/ploscompbiol/s/figures

3) Some material included in your submission may be copyrighted. According to PLOS’s copyright policy, authors who use figures or other material (e.g., graphics, clipart, maps) from another author or copyright holder must demonstrate or obtain permission to publish this material under the Creative Commons Attribution 4.0 International (CC BY 4.0) License used by PLOS journals. Please closely review the details of PLOS’s copyright requirements here: PLOS Licenses and Copyright. If you need to request permissions from a copyright holder, you may use PLOS's Copyright Content Permission form.

Please respond directly to this email and provide any known details concerning your material's license terms and permissions required for reuse, even if you have not yet obtained copyright permissions or are unsure of your material's copyright compatibility. Once you have responded and addressed all other outstanding technical requirements, you may resubmit your manuscript within Editorial Manager.

Potential Copyright Issues:

i) Figure 1. Please confirm whether you drew the images / clip-art within the figure panels by hand. If you did not draw the images, please provide (a) a link to the source of the images or icons and their license / terms of use; or (b) written permission from the copyright holder to publish the images or icons under our CC BY 4.0 license. Alternatively, you may replace the images with open source alternatives. See these open source resources you may use to replace images / clip-art:

- https://commons.wikimedia.org

- https://openclipart.org/.

4) Please amend your detailed Financial Disclosure statement. This is published with the article. It must therefore be completed in full sentences and contain the exact wording you wish to be published.

1) State what role the funders took in the study. If the funders had no role in your study, please state: "The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript."

2) If any authors received a salary from any of your funders, please state which authors and which funders..

If you did not receive any funding for this study, please simply state: u201cThe authors received no specific funding for this work.u201d

Reviewers' comments:

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: The manuscript by Khostavi et al., entitled “Granger Sensori-Behavioural Taxonomy of Neuronal Ensemble Activity from Two-Photon Calcium Imaging Data”, immediately stands out as a well-thought-out and executed piece of work that improves our understanding of neuronal computation. It sets out to build and test a computational model that provides an all-in-one account of sensory processing. By all-in-one, they mean both the encoding and decoding of stimuli by neurons, among other things, which together constitute the neuronal response. Therefore, it is laudable that the authors took an approach that is contrary to the previous approach, which slices up neural activity in the study of one or the other, i.e., encoding or decoding of sensory information. With the latter approach, recent developments in statistical hypothesis testing have shown that type I error, thus false positives, abound.

The authors' model is a classification system that describes three categories of neurons related to sensory and behavioural information in neural ensemble activity, based on a correlational metric known as Granger formalism. To be able to infer information, in the spirit of existing frameworks like intersection information and partial information decomposition, Granger causality (GC) presents a robust parametric tool to identify directional effects and within multivariate point process data. To this end, the three categories of neurons were defined as Granger stimulus encoding (GS), Granger behavioural decoding (GB), and Granger Intersection (GI), guided by efficient statistical testing, control of false discovery rate, and effective estimation of network parameters.

To test the model, the authors sought to identify GS, GB, and GI in two-photon calcium imaging data. Further, the marked neurons were hypothesised to approximate neurons in the behaving mouse A1, with similar functions. The results showed a significant presence of GC neurons in both datasets.

While the authors presented good evidence to support the model, there remain significant points that allow for confidence in the utility of the model to be shaken, especially for experimenters as well as theoreticians. These points can be put into two folds: manifested or assumed properties of neurons ascribed to GC neurons and the physical connectivity of identified properties between GC neurons. By their nature, models are physical description of the constitution and mechanism of systems. Hence, the authors' model lacks a cortical structure and precise transduction of information between GC neurons, which the statistical framework, Granger formalism, was supposed to elucidate. For instance, GS, GB, and GI neurons were shown to characterise diverse groups of neurons in the A1 of the mouse, specifically layer 2/3, with no sensori-behavioural markers inherent in neurons and their connectivity, given that area of the brain, in that specific part of the cortical column, by cytoarchitecture, is populated by neurons with structural and perhaps functional similarities to a high degree. To the point, how do the authors square layer 2/3 neurons, characterised almost exclusively as feedforward neurons, with the inverse solution, which requires some form of feedback neurons to implement? Otherwise, without these, the authors' model demonstrates no physical system, except the general notion of variance in a population activity, thus inherent distinct groups, indicated by temporal dynamics in spiking activity.

However, the manuscript was executed accurately and appropriately within the confines of its design. The findings reported truly reflect the manuscript’s objectives. And in that regard, the title, abstract, and author summary capture the content of the text. The main text is clear and comprehensible. Nevertheless, “Granger taxonomy” seems an over-reach, given that it fails to live up to the standard of structural qualification grounded in physical form, required of a generative model.

Reviewer #2: The authors present a framework to extract directional interactions between stimuli, their neural responses and corresponding behavior on two-photon calcium imaging data. This method relies on finding directed acyclic graphs, where nodes serve as neural ensembles active during two-photon imaging, and the directionality of information is determined using Granger causality (GC). This work extends a vast body of research to construct causal relationships and functional connectivity graphs across brain regions based on proxy signals for neural activity when electrophysiological data may be infeasible to obtain. This technique could thus also be relevant for the community developing tools for non-invasive brain imaging. I invite the authors to clarify the following before publication of this work.

- As the work promises to be taxonomical, I want to get a sense of how this method would behave given representational drift (Schoonover et al. 2021) in encoding sensory information. It seems that we would need to run the GC analysis repeatedly over time to recover the taxonomical labels for neural ensembles which may be time consuming. Furthermore, it may be favorable for neurons to switch their labels based on the demands of the task. What is the temporal window over which a given Bayesian network topology remains stable?

- GC is highly sensitive to intrinsic oscillations and relies on separable signals. There is evidence that oscillatory brain state are detectable even in two-photon calcium signals (Tort-Colet et al. 2023), which implies that in the present study, the GC method could have spuriously linked periodic task stimuli with the activity of neural ensemble(s). How does the current method account for this effect? Similarly, it may be insightful to discuss the merits or limitations of GC-based approach vis-a-vis other manifold driven causality techniques like Convergent Cross Mapping which relax the constraints of separability.

- In Figure 1, a first order kernel with additive noise is used to translate spikes into proxy GCaMP-fluorescence signal. Since this is a model of a synapse, would a multiplicative noise model be a better fit? This might better capture synaptic release probability.

- In the toy model example (lines 208-213), the authors add a fixed variance white noise to the primary stimulus. As the GC method is also noise sensitive, it would be insightful to see at which noise levels does the analysis yield incorrect network topology. In other words, what minimum signal-to-noise ratio can this method reliably resolve in this simulated setup?

- The passive listening task presents a unique opportunity to probe the compulsive aspects of behavior independent of the stimulus. For instance, the trial-to-trial variability in neural responses is strongly associated with stereotypical behavior (e.g. whisker movement in mice) (Mussel et al. 2019). It would be insightful to include analysis for GB links in this experiment as well. This measure could, for instance, also be used to determine a better baseline of neural activity which accounts for these stimulus independent behaviors.

References

Schoonover, C.E., Ohashi, S.N., Axel, R. and Fink, A.J., 2021. Representational drift in primary olfactory cortex. Nature, 594(7864), pp.541-546.

Tort-Colet, N., Resta, F., Montagni, E., Pavone, F., Allegra Mascaro, A.L. and Destexhe, A., 2023. Assessing brain state and anesthesia level with two-photon calcium signals. Scientific Reports, 13(1), p.3183.

Musall, S., Kaufman, M.T., Juavinett, A.L., Gluf, S. and Churchland, A.K., 2019. Single-trial neural dynamics are dominated by richly varied movements. Nature neuroscience, 22(10), pp.1677-1686.

Reviewer #3: Reviewer background: My research covers computational neuroscience in general. I have experience developing analysis methods for calcium data as well as analyzing calcium data.

In this work the authors tackle a difficult problem: how can we infer useful information about the neuron activities underlying calcium recordings? There are many previous approaches to this, but the authors and my own knowledge these largely rely on several separate steps involving e.g. spike detection and then further analysis (although see some of my criticisms below). It is then also hard, even after e.g. a spike detection step, to figure out how the different neurons relate to each other and task parameters. In this paper the authors leverage and combine several techniques to go straight from calcium imaging responses to a sensori-behavioral taxonomy.

Overall, I really liked the approach and ideas. However, I saw several major issues and have several open questions that I would need answered or solved before being able to recommend publication. I am recommending major revisions (although really they are between minor and major), but also think that the paper could be better at home in a more methods oriented journal in its current form.

Code review: the code seems to be available and complete, but I am not able to test it due to not using MATLAB. The readme looks extensive and useful. However, much of the code itself seems sparsely commented and I would request the authors rectify this.

Major concerns

- The authors claim that unlike previous works they several a lot of things simultaneously unlike previous studies (in particular, they skip any spike detection but go directly from calcium recordings to their analysis). However, this is not completely fair, as there several previous approaches that also take several analysis steps at once, just at a different point in the analysis pipeline. For example, approaches like cNMF [1] simultaneously detect cell locations, calcium traces, and spiking activities. Then, follow-up approaches are done on the spiking or calcium traces. From my understanding, the approach taken in this paper assumes cell locations and calcium traces are already provided, so also still skips some part of the analysis. Leading to the next point:

- The paper insufficiently details what preprocessing is required of the data before their method is applied. I'm particularly worried about denoising and de-contamination of the cell signals. For example, neuropil contamination can seriously bias analysis methods [2], and could also explain some of the causality links they find in the experimental data. Neuripil contamination can come from overlapping cells in the imaging cone, as well as other surrounding tissue. What is more, Neuropil contamination can specifically be highly tuned to task parameters as well (see also [2]). How is such contamination either accounted for in pre-processing or in their analysis method itself? It is possible I misunderstood some of the method construction and that this is already taken into account.

- In figure 3A+B it seems that the spiking trace does not fully conform to the calcium trace. There are clear bumps in the calcium trace that do not conform to spikes. Perhaps this is the result of modelling something like the neuropil contamination I mention above? However, from the generative model (equation 1), and the fact that A there is diagonal, this does not seem to be the case (as well as how figure 1 illustrates the generative model).

- The paper uses quite a lot terminology and abbreviations which might be unfamiliar to much of the PLOS comp bio audience (at least to the single audience data point that is me!). This makes much of the text hard to follow. Consider for example the text below figure 5 on page 18. We GS and GB are used in abundance, but I had to cross reference a lot to other text to make sense of the text as a whole. Other examples are sentences like 'in the sense of granger' or 'in the sense of Shannon', which I found confusing. There are other similar examples throughout the text. I expect experimental neuroscientists to have similar issues as me. I recommend to both reduce the number of uses of GB, GS, GI terms in general, and to consider using written out terms through instead as well (e.g. just write 'Granger Behavior Neuron' everywhere, while also reducing over-use of the term). Finally, I think some of the terminology could be phrased more intuitively, or perhaps a box could be used to give a quick intro to granger-related terminology.

- The authors first do a simulation study to proof their method can extract the right taxonomy, and then apply their method to real experimental data. For the simulation study I found that it was quite hard to parse how exactly the data was generated, and I recommend to improve this part of the text to make this clearer (perhaps a dedicated methods section after the generative model explanation?). Secondly, I think a more extensive and rigorous study is required to show that their method in general can extract correct taxonomies from realistic datasets. In particular, the considered networks are small and few, and match the method's underlying generative model perfectly. This could be improved by e.g. considering a larger set of sampled taxonomies as well as much larger networks (then subsampled), or even considering datasets generated with a less perfectly matching generative model. Can we from this also define under what conditions the method might fail?

For the experimental data, aside from the issues in the previous point with parsing the text, I was hoping for some more reflection on what we can learn from the taxonomy. It seems that many of the major conclusions are confirmations of previous results. I think the paper would benefit by making more explicit what was already known previously and what new we have learned (or could learn in principle, even if their current dataset was just not sufficient for example).

- The experimental results in general lacks an explicit comparison with other previous methods. For example, the method mentioned a few times (II) could be used on the simulation or experimental data as well, and reported on in the figures (or more specific references could be made to previous literature, if the data is hard to come by or the analyses hard to do).

- A few times it is mentioned experimental analysis results found are consistent with previous papers, without making a specific reference to where in the papers this is also shown, and in what way they are consistent. This can be easily rectified by being more specific, and I would also consider to make a dedicated figure showing some of these correspondences more directly (if possible given datasets available and so on).

- In the discussion it is mentioned no larger analyses were done due to computational constraints. But one of the major advances over the previous method (II) is supposed to be lower complexity. This point I think deserved a dedicated results section (both in reporting in more detail about the computational cost and constraints, and a comparison with II). Secondly, a view on how the method could be extended to larger datasets in the future would be appreciated, as calcium imaging datasets increasingly use very large groups of neurons. Thirdly, as also mentioned above, the simulation study could be used to generate a larger dataset then sub-sampled.

Minor comments and questions

- (very minor) The paper a few times uses sentences like 'we presented a carefully designed simulation' or 'by a careful combination of'. I find such terms vague and it should be up to the reader to judge if indeed the design was careful or not, not for the authors to claim. It's better to be immediately precise about how the design is done, or how the combination is done.

- The figure captions were hard to fully grasp sometimes. For example, figure 3C is for 10 network realizations but this is not mentioned in the caption.

- I would combine figure 2 and figure 3 top row, and make figure 3 bottom row its own figure or combine it as well (since the top row is on specific examples like figure 2).

- How the 10 different networks for 3C are generated is not clear, should be part of methods probably.

- The benchmark methods should be fully explained in the methods.

- Question: I found it interesting to calculate specific average responses only for subsets of neurons according to classification. Is there any relationship with and benefit over methods like demixed PCA for this?

- Figure 1: very minor, but the ordering of GS, GI, and GB is not consistent between figure , text, and caption

- Question: would terms like 'Stimulus linked neuron' perhaps be more intuitive than 'Granger stimulus neuron', even if it is less specific? Or does this not cover the outcome of the analysis enough.

Typo's and others

- line 318 - '*this* results'

- line 76 'of methods such as' is a vague statement, better to just say what methods were used specifically

- line 118 'the *i* neuron'

- line 152+153: double use of 'here,....'

- line 406 'the *to* neuron'

[1] Pnevmatikakis, E. A., Soudry, D., Gao, Y., Machado, T. A., Merel, J., Pfau, D., ... & Paninski, L. (2016). Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron, 89(2), 285-299.

[2] Keemink, S. W., Lowe, S. C., Pakan, J. M., Dylda, E., Van Rossum, M. C., & Rochefort, N. L. (2018). FISSA: A neuropil decontamination toolbox for calcium imaging signals. Scientific reports, 8(1), 3493.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

Reviewer #3: Yes

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review?  For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: Yes:  Jolly Kanjua

Reviewer #2: No

Reviewer #3: No

Figure resubmission:

After uploading your figures to PLOS’s NAAS tool - https://ngplosjournals.pagemajik.ai/artanalysis, NAAS will process the files provided and display the results in the "Uploaded Files" section of the page as the processing is complete. If the uploaded figures meet our requirements (or NAAS is able to fix the files to meet our requirements), the figure will be marked as "fixed" above. If NAAS is unable to fix the files, a red "failed" label will appear above. When NAAS has confirmed that the figure files meet our requirements, please download the file via the download option, and include these NAAS processed figure files when submitting your revised manuscript.

Reproducibility:

To enhance the reproducibility of your results, we recommend that authors of applicable studies deposit laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. Additionally, PLOS ONE offers an option to publish peer-reviewed clinical study protocols. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014820.r003

Decision Letter 1

Daniel Bush, Alain Nogaret

16 Sep 2026

Dear Prof. Babadi,

We are pleased to inform you that your manuscript 'Granger Sensori-Behavioral Functional Taxonomy of Neuronal Ensemble Activity from Two-Photon Calcium Imaging Data' has been provisionally accepted for publication in PLOS Computational Biology.

Before your manuscript can be formally accepted you will need to complete some formatting changes, which you will receive in a follow up email. A member of our team will be in touch with a set of requests.

Please note that your manuscript will not be scheduled for publication until you have made the required changes, so a swift response is appreciated.

IMPORTANT: The editorial review process is now complete. PLOS will only permit corrections to spelling, formatting or significant scientific errors from this point onwards. Requests for major changes, or any which affect the scientific understanding of your work, will cause delays to the publication date of your manuscript.

Should you, your institution's press office or the journal office choose to press release your paper, you will automatically be opted out of early publication. We ask that you notify us now if you or your institution is planning to press release the article. All press must be co-ordinated with PLOS.

Thank you again for supporting Open Access publishing; we are looking forward to publishing your work in PLOS Computational Biology.

Best regards,

Alain Nogaret, PhD

Academic Editor

PLOS Computational Biology

Daniel Bush

Section Editor

PLOS Computational Biology

***********************************************************

The manuscript revision and responses address all major comments raised by reviewers. I am pleased to recommend publication.

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #3: Many thanks for the review response and new results. Especially the new perturbation experiments (noise/model mismatch/subsampling) convinced to advice full acceptance, except for one final suggestion (which I don't need to be consulted on):

The results now clearly show that under sub-optimal conditions the method still works reasonably well, and especially better than the baseline methods. In addition, the new section on computational complexity clarifies how hard it might be to run the method. However, I think the text slightly oversells the results as being just overall good. I think it would still be very helpful for readers that might want to use the method to clearly understand the failure modes: what degree of subsampling/noise/etc. is still ok? What kind of datasets is the method good for? How many neurons can we feasibly apply this to?

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #3: Yes

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review?  For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #3: No

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1014820.r004

Acceptance letter

Daniel Bush, Alain Nogaret

PCOMPBIOL-D-26-00488R1

Granger Sensori-Behavioral Functional Taxonomy of Neuronal Ensemble Activity from Two-Photon Calcium Imaging Data

Dear Dr Babadi,

I am pleased to inform you that your manuscript has been formally accepted for publication in PLOS Computational Biology. Your manuscript is now with our production department and you will be notified of the publication date in due course.

The corresponding author will soon be receiving a typeset proof for review, to ensure errors have not been introduced during production. Please review the PDF proof of your manuscript carefully, as this is the last chance to correct any errors. Please note that major changes, or those which affect the scientific understanding of the work, will likely cause delays to the publication date of your manuscript.

Soon after your final files are uploaded, unless you have opted out, the early version of your manuscript will be published online. The date of the early version will be your article's publication date. The final article will be published to the same URL, and all versions of the paper will be accessible to readers.

For Research, Software, and Methods articles, you will receive an invoice from PLOS for your publication fee after your manuscript has reached the completed accept phase. If you receive an email requesting payment before acceptance or for any other service, this may be a phishing scheme. Learn how to identify phishing emails and protect your accounts at https://explore.plos.org/phishing.

Thank you again for supporting PLOS Computational Biology and open-access publishing. We are looking forward to publishing your work!

With kind regards,

Sharmila Kamatchi

PLOS Computational Biology | Carlyle House, Carlyle Road, Cambridge CB4 3DN | United Kingdom ploscompbiol@plos.org | Phone +44 (0) 1223-442824 | ploscompbiol.org | @PLOSCompBiol

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    Attachment

    Submitted filename: Granger_Taxonomy_PLoS_Response.pdf

    pcbi.1014820.s002.pdf (228.4KB, pdf)

    Data Availability Statement

    Data and software implementations in MATLAB v2024b of the algorithms discussed are publicly available at: https://doi.org/10.13016/i9ar-ymsc.


    Articles from PLOS Computational Biology are provided here courtesy of PLOS

    RESOURCES