Abstract
The peristimulus time histogram (PSTH) and its more continuous cousin, the spike density function (SDF) are staples in the analytic toolkit of neurophysiologists. The former is usually obtained by binning spike trains, whereas the standard method for the latter is smoothing with a Gaussian kernel. Selection of a bin width or a kernel size is often done in an relatively arbitrary fashion, even though there have been recent attempts to remedy this situation (DiMatteo et al., Biometrika 88(4):1055–1071, 2001; Shimazaki and Shinomoto 2007a, Neural Comput 19(6):1503–1527, 2007b, c; Cunningham et al. 2008). We develop an exact Bayesian, generative model approach to estimating PSTHs. Advantages of our scheme include automatic complexity control and error bars on its predictions. We show how to perform feature extraction on spike trains in a principled way, exemplified through latency and firing rate posterior distribution evaluations on repeated and single trial data. We also demonstrate using both simulated and real neuronal data that our approach provides a more accurate estimates of the PSTH and the latency than current competing methods. We employ the posterior distributions for an information theoretic analysis of the neural code comprised of latency and firing rate of neurons in high-level visual area STSa. A software implementation of our method is available at the machine learning open source software repository (www.mloss.org, project ‘binsdfc’).
Similar content being viewed by others
Notes
3.2 GHz Intel XeonTM, SuSE Linux 10.1.
http://www.mloss.org, package ‘binsdfc’.
References
Alitto, H. J., & Usrey, W. M. (2004). Influence of contrast on orientation and temporal frequency tuning in ferret primary visual cortex. Journal of Neurophysiology, 91, 2797–2808.
Barraclough, N., Xiao, D., Baker, C., Oram, M., & Perrett, D. (2005). Integration of visual and auditory information by superior temporal sulcus neurons responsive to the sight of actions. Journal of Cognitive Neuroscience, 17, 377–391.
Berenyi, A., Benedek, G., & Nagy, A. (2007). Double sliding-window technique: A new method to calculate the neuronal response onset latency. Brain Research, 1178, 141–148.
Berger, J. (1985). Statistical decision theory and Bayesian analysis. New York: Springer.
Bertsekas, D. P. (2000). Dynamic programming and optimal control. Nashua: Athena.
Cover, T., & Thomas, J. (1991). Elements of information theory. New York: Wiley.
Cunningham, J., Yu, B., Shenoy, K., & Sahani, M. (2008). Inferring neural firing rates from spike trains using Gaussian processes. In J. Platt, D. Koller, Y. Singer, & S. Roweis (Eds.), Advances in neural information processing systems 20. Cambridge: MIT.
Davis, P. (1972). Gamma function and related functions. In M. Abramowitz & I. Stegun (Eds.), Handbook of mathematical functions. New York: Dover.
DiMatteo, I., Genovese, C. R., & Kass, R. E. (2001). Bayesian curve-fitting with free-knot splines. Biometrika, 88(4), 1055–1071.
Edwards, R., Xiao, D., Keysers, C., Földiák, P., & Perrett, D. I. (2003). Color sensitivity of cells responsive to complex stimuli in the temporal cortex. Journal of Neurophysiology, 90(2), 1245–1256. doi:10.1152/jn.00524.2002, http://jn.physiology.org/cgi/content/abstract/90/2/1245, http://jn.physiology.org/cgi/reprint/90/2/1245.pdf.
Eifuku, S., De Souza, W. C., Tamura, R., Nishijo, H., & Ono, T. (2004). Neuronal correlates of face identification in the monkey anterior temporal cortical areas. Journal of Neurophysiology, 91, 358–371.
Endres, D. (2006). Bayesian and information-theoretic tools for neuroscience. Ph.D. thesis, School of Psychology, University of St. Andrews, U.K. http://hdl.handle.net/10023/162.
Endres, D., & Földiák, P. (2005). Bayesian bin distribution inference and mutual information. IEEE Transactions on Information Theory, 51(11).
Endres, D., Oram M., Schindelin, J., & Földiák, P. (2008). Bayesian binning beats approximate alternatives: Estimating peri-stimulus time histograms. In J. Platt, D. Koller, Y. Singer, & S. Roweis (Eds.), Advances in neural information processing systems 20. Cambridge: MIT.
Földiák, P., Xiao, D., Keysers, C., Edwards, R., & Perrett, D. I. (2004). Rapid serial visual presentation for the determination of neural selectivity in area STSa. Progress in Brain Research, 144, 107–116.
Friedman, H.S., & Priebe, C.E. (1998). Estimating stimulus response latency. Journal of Neuroscience Methods, 83, 185–194.
Fries, P., Neuenschwander, S., Engel, A. K., Goebel, R., & Singer, W. (2001). Rapid feature selective neuronal synchronization through correlated latency shifting. Nature Neuroscience, 4, 194–200.
Gabel, S. F., Misslisch, H., Schaafsma, S. J., & Duysens, J. (2002). Temporal properties of optic flow responses in the ventral intraparietal area. Visual Neuroscience, 19, 381–388.
Gawne, T. J., Kjaer, T. W., Hertz, J. A., & Richmond, B. J. (1996a). Adjacent visual cortical complex cells share about 20% of their stimulus-related information. Cerebral Cortex, 6(3), 482–489.
Gawne, T. J., Kjaer, T. W., & Richmond, B. J. (1996b). Latency: Another potential code for feature binding in striate cortex. Journal of Neurophysiology, 76, 1356–1360.
Hanes, D. P., Thompson, K. G., & Schall, J. D. (1995). Relationship of presaccadic activity in frontal eye field and supplementary eye field to saccade initiation in Macaque–Poisson spike train analysis. Experimental Brain Research, 103, 85–96.
Heil, P., & Irvine, D. R. F. (1997). First-spike timing of auditory-nerve fibers and comparison with auditory cortex. Journal of Neurophysiology, 78, 2438–2454.
Hurley, L. M., & Pollak, G. D. (2005). Serotonin shifts first-spike latencies of inferior colliculus neurons. Journal of Neuroscience, 25, 7876–7886.
Hutter, M. (2006). Bayesian regression of piecewise constant functions. Tech. Rep. arXiv:math/0606315v1, IDSIA-14-05.
Hutter, M. (2007). Exact Bayesian regression of piecewise constant functions. Journal of Bayesian Analysis, 2(4), 635–664.
Kiani, R., Esteky, H., & Tanaka, K. (2005). Differences in onset latency of Macaque inferotemporal neural responses to primate and non-primate faces. Journal of Neurophysiology, 94(2), 1587–1596. doi:10.1152/jn.00540.2004, http://jn.physiology.org/cgi/content/abstract/94/2/1587, http://jn.physiology.org/cgi/reprint/94/2/1587.pdf.
Lee, J., Williford, T., & Maunsell, J. H. R. (2007). Spatial attention and the latency of neuronal responses in macaque area V4. Journal of Neuroscience, 27, 9632–9637.
Liu, Z., & Richmond, B. J. (2000). Response differences in monkey te and perirhinal cortex: Stimulus association related to reward schedules. Journal of Neurophysiology, 83, 1677–1692.
Loader, C. (1997). LOCFIT: An introduction. Statistical Computing and Graphics Newsletter, 8(1), 11–17. http://www.stat-computing.org/newsletter.
Loader, C. (1999). Local regression and likelihood. New York: Springer.
Luczak, A., Bartho, P., Marguet, S. L., Buzsaki, G., & Harris, K. D. (2007). Sequential structure of neocortical spontaneous activity in vivo. Proceedings of the National Academy of Sciences of the United States of America, 104, 347–352.
Maunsell, J. H., & Gibson, J. R. (1992). Visual response latencies in striate cortex of the macaque monkey. Journal of Neurophysiology, 68, 1332–1344.
Nawrot, M. P., Aertsen, A., & Rotter, S. (2003). Elimination of response latency variability in neuronal spike trains. Biological Cybernetics, 88, 321–334.
Nemenman, I., Bialek, W., & van Steveninck, R. (2004). Entropy and information in neural spike trains: Progress on the sampling problem. Physical Review E, 69(5), 056111. http://link.aps.org/abstract/PRE/v69/e056111.
Nowak, L. G., Munk, M. H. J., Girard, P., & Bullier, J. (1995). Visual latencies in areas v1 and v2 of the Macaque monkey. Visual Neuroscience, 12, 371–384.
Optican, L., Gawne, T., Richmond, B., & Joseph, P. (1991). Unbiased measures of transmitted information and channel capacity from multivariate neuronal data. Biological Cybernetics, 65, 305–310.
Oram, M., & Perret, D. (1996). Integration of form and motion in the anterior superior temporal polysensory area (stpa). of the Macaque monkey. Journal of Neurophysiology, 19, 109–129.
Oram, M. W., & Perrett, D. I. (1992). Time course of neural responses discriminating different views of the face and head. Journal of Neurophysiology, 68(1), 70–84.
Oram, M. W., Xiao, D., Dritschel, B., & Payne, K. (2002). The temporal precision of neural signals: A unique role for response latency? Philosophical Transactions of the Royal Society, Series B, 357, 987–1001.
Paninski, L. (2004). Estimating entropy on m bins given fewer than m samples. IEEE Transactions on Information Theory, 50(9), 2200–2203.
Panzeri, S., & Treves, A. (1996). Analytical estimates of limited sampling biases in different information measures. Network: Computation in Neural Systems, 7, 87–107.
Perrett, D. I., Oram, M. W., Harries, M. H., Bevan, R., Hietanen, J. K., & Benson P. J. (1991). Viewer-centered and object-centered coding of heads in the Macaque temporal cortex. Experimental Brain Research, 86, 159–173.
Press, W., Flannery, B., Teukolsky, S., & Vetterling, W. (1986). Numerical recipes in C: The art of scientific computing. New York: Cambridge University Press.
Richmond, B. J., & Optican, L. M. (1987a). Temporal encoding of two-dimensional patterns by single units in primate inferior temporal cortex. II. Quantification of response waveform. Journal of Neurophysiology, 57(1), 147–161.
Richmond, B. J., & Optican, L. M. (1987b). Temporal encoding of two-dimensional patterns by single units in primate inferior temporal cortex. III. Information theoretic analysis. Journal of Neurophysiology, 57(1), 162–178.
Richmond, B. J., Oram, M. W., & Wiener, M. C. (1999). Response features determining spike times. Neural Plasticity, 6, 133–145.
Sary, G., Koteles, K., Chadaide, Z., Tompa, T., & Benedek, G. (2006). Task-related modulation in the monkey inferotemporal cortex. Brain Research, 1121, 76–82.
Schmolesky, M. T., Wang, Y., Hanes, D. P., Thompson, K. G., Leutgeb, S., Schall, J. D., et al. (2006). Signal timing across the macaque visual system. Journal of Neurophysiology, 79, 3272–3278.
Shannon, C. E. (1948). The mathematical theory of communication. The Bell Systems Technical Journal, 27, 379–423, 623–656.
Shimazaki, H., & Shinomoto, S. (2007a). Kernel width optimization in the spike-rate estimation. In R. Budelli, A. Caputi, & L. Gomez (Eds.), Neural coding 2007 (pp. 143–146). http://neuralcoding2007.edu.uy.
Shimazaki, H., & Shinomoto, S. (2007b). A method for selecting the bin size of a time histogram. Neural Computation, 19(6), 1503–1527.
Shimazaki, H., & Shinomoto, S. (2007c). A recipe for optimizing a time-histogram. In B. Schölkopf, J. Platt, & T. Hoffman (Eds.), Advances in neural information processing systems (Vol. 19, pp. 1289–1296). Cambridge: MIT.
Shinomoto, S., & Koyama, S. (2007). A solution to the controversy between rate and temporal coding. Statistics in Medicine, 26, 4032–4038.
Stecker G. C., & Middlebrooks J. C. (2003). Distributed coding of sound locations in the auditory cortex. Biological Cybernetics 89, 341–349
Sugase-Miyamoto, Y., & Richmond, B. J. (2005). Neuronal signals in the monkey basolateral amygdala during reward schedules. Journal of Neuroscience, 25, 11071–11083.
Syka, J., Popelar, J., Kvasnak, E., & Astl, J. (2000). Response properties of neurons in the central nucleus and external send dorsal cortices of the inferior colliculus in guinea pig. Experimental Brain Research, 133, 254–266.
Tamura, H., & Tanaka, K. (2001). Visual response properties of cells in the ventral and dorsal parts of the macaque inferotemporal cortex. Cerebral Cortex, 11, 384–399.
Tanaka, M., & Lisberger, S. G. (2002). Role of arcuate frontal cortex of monkeys in smooth pursuit eye movements. I. Basic response properties to retinal image motion and position. Journal of Neurophysiology, 87, 2684–2699.
Thompson, K. G., Hanes, D. P., Bichot, N. P., & Schall, J. D. (1996). Perceptual and motor processing stages identified in the activity of Macaque frontal eye field neurons during visual search. Journal of Neurophysiology, 76, 4040–4055.
Tovee, M. J., Rolls, E. T., Treves, A., & Bellis, R. P. (1993). Information encoding and the responses of single neurons in the primate temporal visual cortex. Journal of Neurophysiology, 70(2). 640–654. http://jn.physiology.org/cgi/content/abstract/70/2/640, http://jn.physiology.org/cgi/reprint/70/2/640.pdf.
van Rossum, M. C. W., van der Meer, M. A. A., Xiao, D., & Oram, M. W. (2008). Adaptive integration in the visual cortex by depressing recurrent cortical circuits. Neural Computation, 20(7), 1847–1872. http://neco.mitpress.org/cgi/content/abstract/20/7/1847, http://neco.mitpress.org/cgi/reprint/20/7/1847.pdf.
Ventura, V. (2004). Testing for and estimating latency effects for Poisson and non-Poisson spike trains. Neural Computation, 16(11), 2323–2349. doi:10.1162/0899766041941952.
Acknowledgements
D. Endres was supported by a Medical Research Council (UK) special training fellowship in bioinformatics G0501319. Both authors would like to thank P. Földiak and J. Schindelin for stimulating discussions and comments on the manuscript. Data collection was supported by EU framework grant (FP5-Mirror) to M. Oram. We thank the unknown reviewers for their clarifying suggestions and references.
Author information
Authors and Affiliations
Corresponding author
Additional information
Action Editor: Matthew Wiener
Appendices
Appendix A: Computing the evidence with dynamic programming
The evidence, or marginal likelihood of a model with M bins is given by (see Eq. (9)):
where the summation boundaries are chosen such that the bins are non-overlapping and contiguous and
Recall that the probability of a (multi)set of spiketrains \(\{\vec{z}^i\}=\{z_1,\ldots,z_N\}\), assuming independent generation, is given by Eq. (3):
where \(s(\{\vec{z}^i\},m)=\sum_{i=1}^N s(\vec{z}^i,m)\) is the number of spikes in all spiketrains in bin m and \(g(\{\vec{z}^i\},m)=\sum_{i=1}^N g(\vec{z}^i,m)\) is the number of all non-spikes, or gaps. The prior of the firing rates (Eq. (5)) is
The integrals in Eq. (32) can be evaluated by virtue of Eqs. (33 and 34):
where \(\mbox{B}(x,y)=\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\) is Euler’s Beta function (Davis 1972). Equation (35) is a product with one factor per bin, and each factor depends only on spike/gap counts and prior parameters in that bin. To compute Eq. (31), we can therefore use an approach very similar to that described in (Endres and Földiák 2005; Endres 2006) in the context of density estimation and in (Hutter 2006, 2007) for Bayesian function approximation: define the function
where \(s(\{\vec{z}^i\},k_s,k_e)\) is the number of spikes and \(g(\{\vec{z}^i\},k_s,k_e)\) is the number of gaps in \(\{\vec{z}^i\}\) between the start interval k s and the end interval k e (both included). Furthermore, collect all contributions to Eq. (31) that do not depend on the data (i.e. \(\{\vec{z}^i\}\)) and store them in the array \(\mbox{pr}[M]\):
Substituting Eq. (35) into Eq. (31) and using the definitions (36) and (37), we obtain
with k M = T − 1 and the constant of proportionality being \(\mbox{pr}[M]\). Since the factors on the r.h.s. depend only on two consecutive bin boundaries each, it is possible to apply dynamic programming (Bertsekas 2000): rewrite the r.h.s. by ‘pushing’ the sums as far to the right as possible:
Evaluating the sum over k 0 requires O(T) operations (assuming that T ≫ M, which is likely to be the case in real-world applications). As the summands depend also on k 1, we need to repeat this evaluation O(T) times, i.e. summing out k 0 for all possible values of k 1 requires O(T 2) operations. This procedure is then repeated for the remaining M − 1 sums, yielding a total computational effort of O(MT 2). Thus, initialise the array \(\mbox{subE}_{0}[k]:=\mbox{getIEC}({0},{k},{0})\), and iterate for all m = 1,...,M:
A close look at Eq. (39) reveals that while we sum over k M − 1, we need \(\mbox{subE}_{M-1}[k]\) for k = M − 1;...;T − 2 to compute the evidence of a model with its latest boundary at T − 1. We can, however, compute \(\mbox{subE}_{M-1}[T-1]\) with little extra effort, which is, up to a factor \(\mbox{pr}[M-1]\), equal to \(P(\{\vec{z}^i\}|M-1)\), i.e. the evidence for a model with M − 1 bin boundaries. Moreover, having computed \(\mbox{subE}_{k}[m]\), we do not need \(\mbox{subE}_{m-1}[k-1]\) anymore. Hence, the array \(\mbox{subE}_{k}[m-1]\) can be reused to store \(\mbox{subE}_{k}[m]\), if overwritten in reverse order. Table 4 shows this algorithm in pseudo-code (\(\mbox{E}[m]\) contains the evidence of a model with m bin boundaries inside [t min,t max] after termination).
Appendix B: Computing the posterior distribution of the latency
We compute the joint probability of the latency L = t and the observed spiketrains \(\{\vec{z}^i\}\) given the number of bins and the signal separation level S via
where
Note that P(L = t|{k m },{f m },M,S) is the r.h.s of Eq. (21) and \(p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M)\) is the numerator of the r.h.s. of Eq. (8). As a consequence of Eq. (21), the only nonzero contributions to the average are models which have a (lower) bin boundary at t. Assume t was at the lower bound of bin j, i.e. at t = k j − 1 + 1 (the {k m } are inclusive upper bin boundaries, as defined above). Carrying out the integrals over the {f m } yields:
The integration boundaries in the last line of Eq. (43) are a consequence of our latency definition: all bins m < j will contribute to the integral only as long as f m < S, hence the upper bound of their integrals is at S. Bin j contributes only if f j ≥ S, thus the lower bound of the integral over f j is S. The bins m > j are not affected by the latency probability (Eq. (21)) whence their integrals still run from 0 to 1. By virtue of Eqs. (3) and (5), we obtain
where \(B_S(a,b)=\int_0^S t^{a-1}(1-t)^{b-1}dt\) is the incomplete Beta function (Davis 1972) and \(\tilde{B}_S(a,b)=\int_S^1 t^{a-1}(1-t)^{b-1}dt=B(a,b)-B_S(a,b)\) is its complement. Note that up to the factor P({k m }|M), Eq. (44) is basically Eq. (35) with some of the Beta functions replaced by incomplete Beta functions. Hence, the remaining summations over the {k m } can be carried out by using
instead of \(\mbox{getIEC}({k_s},{k_e},{m})\) (Eq. (36)) in the evidence computation algorithm. This procedure yields the desired \(P(L=t,\{\vec{z}^i\}|M,S)\). The above derivation is an instance of the general framework for computing expectations of functions of bin boundaries and firing probabilities described in Endres and Földiák (2005).
Appendix C: Computing the posterior density of the firing rate
We compute the joint probability density of the firing rate \(f(t) = \tilde{f}\), the latency L = t and the observed spiketrains \(\{\vec{z}^i\}\) given the number of bins and the signal separation level S via
where
Note that \(P(f(t) = \tilde{f},L=t|\{k_m\},\{f_m\},M,S)\) is the r.h.s of Eq. (24) and \(p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M)\) is the numerator of the r.h.s. of Eq. (8). As a consequence of Eq. (24), the only nonzero contributions to the average are models which have a (lower) bin boundary at t and f(t) ≥ S. Assume t was at the lower bound of bin j, i.e. at t = k j − 1 + 1 (the {k m } are inclusive upper bin boundaries, as defined above). Integrating out the {f m } yields
where the second line is a result of Eq. (3) and (5) multiplied with the Dirac delta function in Eq. (23). Hence, the remaining summations over the {k m } can be carried out by using
instead of \(\mbox{getIEC}({k_s},{k_e},{m})\) (Eq. (36)) in the evidence computation algorithm. Thus we obtain \(P(f(t) = \tilde{f},L=t,\{\vec{z}^i\}|M,S)\).
Rights and permissions
About this article
Cite this article
Endres, D., Oram, M. Feature extraction from spike trains with Bayesian binning: ‘Latency is where the signal starts’. J Comput Neurosci 29, 149–169 (2010). https://doi.org/10.1007/s10827-009-0157-3
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10827-009-0157-3