A universal probabilistic spike count model reveals ongoing modulation of neural variability

1 Introduction . Classical analyses of neural coding are based on mean spike counts or neural firing rates . Indeed , some of the most paradigmatic examples of the neural code were discovered by regressing neural firing rates to particular sensory stimuli [ 1 , 2 ] or behavioural covariates [ 3 , 4 , 5 , 6 ] to characterize their tuning properties . However , neural spiking is generally not regular . Recordings from many cortical areas show significantly different activity patterns within and across identical trials [ 7 ] , despite fixing experimentally controlled variables . This irregularity is also seen in continual neural recordings without trial structure [ 8 ] . The resulting variability has classically been characterised as ‘ Poisson ’ , with a Fano factor ( variance to mean ratio ) of one [ 9 ] , but experimental data also often exhibits significantly more [ 10 , 8 , 11 , 12 ] and sometimes less [ 13 , 14 ] variability , respectively referred to as over- or underdispersion . Moreover , experimental studies have revealed that neural variability generally depends on stimulus input and behaviour [ 15 , 16 , 17 , 18 ] , and exhibits structured shared 35th Conference on Neural Information Processing Systems ( NeurIPS 2021 ) . variability ( ‘ noise correlations ’ ) across neurons even after conditioning on such covariates . Such correlations can have important consequences for decoding information from neural population activity [ 19 , 20 , 21 ] and reveal key properties of the underlying circuit dynamics [ 22 ] . Moreover , theories of neural representations of uncertainty have assigned computational significance to variability as a signature of Bayesian inference [ 23 , 24 , 25 , 26 ] . Thus , just as classical tuning curves for firing rates have been crucial for understanding some of the fundamental properties of the neural code , a principled statistical characterisation of neural variability , and its dependence on stimulus and behavioral covariates , is a key step towards understanding the dynamics of neural circuits and the computations they subserve . The traditional approach to characterising neural variability has been pioneered in sensory areas , and relies on repeatable trial structure with a sufficiently large number of trials using identical stimulus and behavioral correlates [ 27 , 15 , 28 ] . Variability in this case can be quantified by simple summary statistics of spike counts across trials of the same condition . However , this approach does not readily generalise to more naturalistic conditions where covariates can not be precisely controlled and repeated in an experiment . This more general setting requires statistical methods that take into account temporal variation of covariates for predicting neural count activity . Generalised Linear Models are a popular choice [ 29 ] , but they only model the dependence of firing rates on covariates – with changes in variability directly coupled to changes in the rate inherent to Poisson spiking . More complex methods for inferring neural tuning [ 30 , 31 ] and latent structure [ 32 , 33 , 34 , 35 ] similarly use restrictive parametric families for spike count distributions , and thus also can not model changes in variability that are not ‘ just ’ a consequence of changes in mean counts or firing rates . Conversely , statistical models capable of capturing arbitrary single neuron count statistics , such as histogram-based approaches or copulas [ 36 ] , do not incorporate dependencies on covariates . Here we unify these separate approaches , resulting in a single framework for jointly inferring neural tuning , single neuron count statistics , neural correlations , and latent structure . Our semi-parametric approach leads to the universal count model ( UCM ) for counts ranging from 0 to K , in the sense that we can model arbitrary distributions over the joint count space of size ( K + 1 ) N of N neurons . The trade-off between computational overhead and model expressivity is controlled by hyperparameters , with expressivity upper bounded by the true universal model . Our approach extends the idea of a universal binary count model [ 37 ] to a finite range of integer counts , while allowing flexible dependence on observed and latent covariates to model non-stationary neural activity and correlations . The flexibility reduces biases from restrictive assumptions in any of the model components . Scalability is maintained by leveraging sparse Gaussian processes [ 38 ] with mini-batching [ 39 , 40 ] to handle the size of modern neural recordings . We first define the UCM , and then describe how to interpret as well as evaluate model fits . As our model is able to capture arbitrary single neuron statistics , we build on the Kolmogorov-Smirnov test to construct more absolute goodness-of-fit measures . After validating our method on synthetic data that can not be captured by currently used methods , we apply the model to electrophysiological recordings from two distinct brain regions in mice that show significant tuning to the head direction of the animal [ 41 , 42 ] . We find that ( 1 ) neural activity tends to be less dispersed than common Poisson-like models at higher firing rates , and more dispersed at low rates ; ( 2 ) mean and variance of counts defy a simple parametric relationship imposed by parametric count distribution families ; ( 3 ) variability modulation by behaviour can be comparable or even exceed that of the mean count or firing rate ; ( 4 ) a two-dimensional latent trajectory varying on timescales of ∼ 1 s is sufficient to explain away neural correlations but not the non-Poisson nature of single neuron variability . Finally , we discuss related work , limitations and proposed extensions of our model . 2 Universal count model . Notation Spike count activity of N neurons recorded into T time bins is formally represented as an N -dimensional time series of non-negative integers . Due to biological constraints , the possible spike counts have some finite upper bound K , taken as the highest observed count . We denote probabilities of a spike count distribution ( SCD ) by a vector π of length K + 1 , and use Π to denote the collection of vectors πnt for neurons n and time steps t. Additionally , we denote the count activity by a matrix Y ∈ [ 0 , K ] N×T with elements ynt . Input covariates are observed X ∈ RT×Dx ( e.g . animal speed ) or latent Z ∈ RT×Dz ( to capture e.g . attention ) , with range depending on topology [ 43 ] . We denote their elements xtd and ztq with observed and latent dimension d and q , respectively . 2.1 Generative model . The big picture is to model counts Y with dependence on X . For each neuron , our model consists of C Gaussian process ( GP ) priors , a basis expansion φ : RC → RC̃ , and a linear-softmax mapping ztq ∼ p ( Z ; θpr ) , hcn ( · ) ∼ GP ( 0 , kcn ( · , · ; θGPcn ) ) fcnt = hcn ( xt , zt ) πnt = softmax ( Wn φ ( fnt ) + bn ) ynt ∼ Discrete ( πnt ) ( 1 ) where W ∈ R ( K+1 ) ×C̃ , b ∈ RK+1 , and the GP covariance functions kcn have hyperparameters θGPcn . The use of non-parametric GP mappings with point estimates for W and b leads to a semi-parametric model with parameters θ , see details in Appendix E. The overall generative model Pθ ( Y |X ) is depicted schematically in Figure 1 . Note the model specifies a prior p ( Π|X ) over joint SCDs , conceptually similar to Dirichlet priors [ 37 ] but allowing non-parametric dependence on X . With latent input Z , our model can flexibly describe multivariate dependencies in joint SCDs as conditional independence across neurons no longer holds when marginalizing over Z [ 44 ] . In addition , p ( Z ) models temporal correlations in the latent states . We use Markovian priors ( details in subsection E.2 ) pθ ( Z ) = pθ ( z1 ) T∏ t=2 pθ ( zt|zt−1 ) ( 2 ) with θpr absorbed into model parameters θ for compactness . This allows the model to flexibly capture both neural and temporal correlations in Y . To attain scalability , we use sparse GPs [ 38 ] . Depending on C and basis functions φ ( · ) , we obtain an approximation to the true universal prior on joint SCDs , with ‘ universal ’ referring to the ability to capture any joint SCD over all neurons . Arbitrary single neuron statistics can be captured when C = K with φ ( f ) = f , but fitting is computationally expensive whenN×C 1 . For capturing all correlations , the model also requires a sufficiently large latent space . One controls the trade-off between model expressiveness and computational overhead through C and φ . Larger expansions φ allow one to model count distributions more expressively with small C , e.g . the element-wise linear-exponential φ ( f ) = ( f1 , ef1 , . . . , fC , efC ) covers a range of distributions including the truncated Poisson with only C = 1 ( see subsection A.3 ) . 2.2 Stochastic variational inference and learning . For the joint model distribution pθ ( Y , Π , Z|X ) = P ( Y |Π ) pθ ( Π|X , Z ) pθ ( Z ) , with count distributions P ( Y |Π ) , we approximate the posterior by qθ , χ , ϕ ( Π , Z|X ) that factorizes in the form qθ , χ ( Π|X , Z ) qϕ ( Z ) = ( N∏ n qθ , χ ( Πn|X , Z ) ) ( T∏ t qϕ ( zt ) ) ( 3 ) with ϕ and χ the variational parameters for latent states and the sparse Gaussian process posterior ( Appendix E ) , respectively . Note that we use a factorized normal q ( Z ) for Euclidean Z , and a wrapped normal for circular Z based on the framework of reparameterized Lie groups [ 45 , 43 ] . The posterior over count probabilities qθ , χ ( Π|X , Z ) is defined as mapping the sparse Gaussian process posterior qθ , χ ( F |X , Z ) through Π ( F ) ( Equation 1 ) , a deterministic mapping . This is analytically intractable , so in practice it is represented by Monte Carlo samples . Using stochastic variational inference [ 46 ] , we minimize an upper bound on the negative log marginal likelihood Fθ , χ , ϕ ( Y |X ) = −EZ∼qϕ ( Z ) EΠ∼qθ , χ ( Π|X , Z ) [ log P ( Y |Π ) pθ ( Π|X , Z ) pθ ( Z ) qθ , χ ( Π|X , Z ) qϕ ( Z ) ] ( 4 ) known as the variational free energy . This objective leads to tractable terms ( subsection E.1 ) , allowing us to infer the approximate posterior as well as a lower bound of the log marginal likelihood [ 47 , 40 ] . We use Adam [ 48 ] for optimization , see details of implementation and model fitting in Appendix E . 2.3 Obtaining interpretable spike count statistics from the model . Characterizing spike count distributions From the posterior q ( Π|X ) 1 , we can compute samples of the posterior of any statistic of spike counts as a function of covariates . Single neuron statistics in particular can be characterized by tuning curves for both mean firing rates and Fano factors ( FF ) ρ ( X ) = 1 ∆ Eq ( Π|X ) EP ( Y |Π ) [ Y ] FF ( X ) = Eq ( Π|X ) [ VarP ( Y |Π ) [ Y ] EP ( Y |Π ) [ Y ] ] ( 5 ) with time bin length ∆ . The model also quantifies private neuron variability that can not be explained away by regressing to shared input ( both observed and latent ) through Pn ( ytn|xt ) . To quantify the sensitivity of a some aspect of neuron activity to a set of covariates x∗ , we define a tuning index ( TI ) with respect to a count statistic Ty ( x∗ ) TI = maxx∗ Ty ( x∗ ) −minx∗ Ty ( x∗ ) maxx∗ Ty ( x∗ ) + minx∗ Ty ( x∗ ) ( 6 ) with Ty ( x∗ ) evaluated under the mean posterior SCD marginalized over all other covariate dimensions complementary to x∗ . These marginalized distributions are computed using observed input xt ( subsection D.5 ) . Resulting marginalized tuning curves for TIs are depicted conceptually in Figure 1 . Generalized Z-scores and noise correlations The deviation of activity from the predicted statistics is commonly quantified through Z-scores [ 8 , 49 , 17 ] , which are computed as ( y − 〈y〉 ) / √ 〈y〉 with 〈y〉 being the mean count in some time bin . If neural activity follows a Poisson distribution , the distribution of Z-scores asymptotically tends to a unit normal when average counts 〈y〉 1 ( Appendix B ) . To generalize the normality of the Z-score for arbitrary counts and SCDs , we use ξ = Φ−1 ( u ) with u ( y ) = ∫ y+ 0 p ( ỹ ) dỹ = y−1∑ k=0 P ( k ) + P ( y ) , ∼ U ( 0 , 1 ) ( 7 ) with Φ ( · ) the unit Gaussian cdf. , and dequantization noise to get continuous quantiles u ∼ U ( 0 , 1 ) and generalized Z-scores ξ ∼ N ( 0 , 1 ) from the probability integral transform . With ξ , one can completely describe single neuron statistics with respect to the model . Correlations in the neural activity however will cause ξ to be correlated . We define generalized lagged correlations rij ( ∆ ) ∈ [ −1 , 1 ] and Fisher Z ∈ R that is more convenient for statistical testing rij ( ∆ ) = 〈ξi ( t ) ξj ( t+ ∆ ) 〉t , ZFisher = 1 2 log 1 + r 1− r ( 8 ) which describes spatio-temporal correlations not captured by the model . Noise correlations [ 50 ] refer to the case of ∆ = 0 , when rij becomes symmetric . 1For notational convenience , X denotes both observed and latent covariates here .

Summary: In this paper authors provide a method for modelling spike counts as a function of input covariates and latent covariates. A Markovin prior is assumed over latent parameters, and the effect of latent parameters and input covariates on spike counts are modelled using a Gaussian process. The authors also suggest a method for calculating Z-scores and tuning index based on their method. The results include analyses of a synthetic dataset and an experimental data, which generally shows the proposed method outperforms considered baselines.