Journal of Computational Neuroscience

, Volume 29, Issue 1–2, pp 149–169 | Cite as

Feature extraction from spike trains with Bayesian binning: ‘Latency is where the signal starts’

  • Dominik Endres
  • Mike Oram


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 (, project ‘binsdfc’).


Spike train analysis Bayesian methods Response latency PSTH SDF Information theory 



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.


  1. 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.CrossRefPubMedGoogle Scholar
  2. 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.CrossRefPubMedGoogle Scholar
  3. 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.CrossRefPubMedGoogle Scholar
  4. Berger, J. (1985). Statistical decision theory and Bayesian analysis. New York: Springer.Google Scholar
  5. Bertsekas, D. P. (2000). Dynamic programming and optimal control. Nashua: Athena.Google Scholar
  6. Cover, T., & Thomas, J. (1991). Elements of information theory. New York: Wiley.CrossRefGoogle Scholar
  7. 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.Google Scholar
  8. Davis, P. (1972). Gamma function and related functions. In M. Abramowitz & I. Stegun (Eds.), Handbook of mathematical functions. New York: Dover.Google Scholar
  9. DiMatteo, I., Genovese, C. R., & Kass, R. E. (2001). Bayesian curve-fitting with free-knot splines. Biometrika, 88(4), 1055–1071.CrossRefGoogle Scholar
  10. 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,, Scholar
  11. 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.CrossRefPubMedGoogle Scholar
  12. Endres, D. (2006). Bayesian and information-theoretic tools for neuroscience. Ph.D. thesis, School of Psychology, University of St. Andrews, U.K.
  13. Endres, D., & Földiák, P. (2005). Bayesian bin distribution inference and mutual information. IEEE Transactions on Information Theory, 51(11).Google Scholar
  14. 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.Google Scholar
  15. 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.CrossRefPubMedGoogle Scholar
  16. Friedman, H.S., & Priebe, C.E. (1998). Estimating stimulus response latency. Journal of Neuroscience Methods, 83, 185–194.CrossRefPubMedGoogle Scholar
  17. 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.CrossRefPubMedGoogle Scholar
  18. 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.CrossRefPubMedGoogle Scholar
  19. 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.CrossRefPubMedGoogle Scholar
  20. 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.PubMedGoogle Scholar
  21. 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.CrossRefGoogle Scholar
  22. 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.PubMedGoogle Scholar
  23. Hurley, L. M., & Pollak, G. D. (2005). Serotonin shifts first-spike latencies of inferior colliculus neurons. Journal of Neuroscience, 25, 7876–7886.CrossRefPubMedGoogle Scholar
  24. Hutter, M. (2006). Bayesian regression of piecewise constant functions. Tech. Rep. arXiv:math/0606315v1, IDSIA-14-05.
  25. Hutter, M. (2007). Exact Bayesian regression of piecewise constant functions. Journal of Bayesian Analysis, 2(4), 635–664.Google Scholar
  26. 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,, Scholar
  27. 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.CrossRefPubMedGoogle Scholar
  28. 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.PubMedGoogle Scholar
  29. Loader, C. (1997). LOCFIT: An introduction. Statistical Computing and Graphics Newsletter, 8(1), 11–17. Scholar
  30. Loader, C. (1999). Local regression and likelihood. New York: Springer.Google Scholar
  31. 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.CrossRefPubMedGoogle Scholar
  32. Maunsell, J. H., & Gibson, J. R. (1992). Visual response latencies in striate cortex of the macaque monkey. Journal of Neurophysiology, 68, 1332–1344.PubMedGoogle Scholar
  33. Nawrot, M. P., Aertsen, A., & Rotter, S. (2003). Elimination of response latency variability in neuronal spike trains. Biological Cybernetics, 88, 321–334.CrossRefPubMedGoogle Scholar
  34. 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. Scholar
  35. 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.CrossRefPubMedGoogle Scholar
  36. 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.CrossRefPubMedGoogle Scholar
  37. 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.Google Scholar
  38. 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.PubMedGoogle Scholar
  39. 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.CrossRefGoogle Scholar
  40. Paninski, L. (2004). Estimating entropy on m bins given fewer than m samples. IEEE Transactions on Information Theory, 50(9), 2200–2203.CrossRefGoogle Scholar
  41. Panzeri, S., & Treves, A. (1996). Analytical estimates of limited sampling biases in different information measures. Network: Computation in Neural Systems, 7, 87–107.CrossRefGoogle Scholar
  42. 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.CrossRefGoogle Scholar
  43. Press, W., Flannery, B., Teukolsky, S., & Vetterling, W. (1986). Numerical recipes in C: The art of scientific computing. New York: Cambridge University Press.Google Scholar
  44. 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.PubMedGoogle Scholar
  45. 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.PubMedGoogle Scholar
  46. Richmond, B. J., Oram, M. W., & Wiener, M. C. (1999). Response features determining spike times. Neural Plasticity, 6, 133–145.CrossRefPubMedGoogle Scholar
  47. Sary, G., Koteles, K., Chadaide, Z., Tompa, T., & Benedek, G. (2006). Task-related modulation in the monkey inferotemporal cortex. Brain Research, 1121, 76–82.CrossRefPubMedGoogle Scholar
  48. 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.Google Scholar
  49. Shannon, C. E. (1948). The mathematical theory of communication. The Bell Systems Technical Journal, 27, 379–423, 623–656.Google Scholar
  50. 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).
  51. Shimazaki, H., & Shinomoto, S. (2007b). A method for selecting the bin size of a time histogram. Neural Computation, 19(6), 1503–1527.CrossRefPubMedGoogle Scholar
  52. 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.Google Scholar
  53. Shinomoto, S., & Koyama, S. (2007). A solution to the controversy between rate and temporal coding. Statistics in Medicine, 26, 4032–4038.CrossRefPubMedGoogle Scholar
  54. Stecker G. C., & Middlebrooks J. C. (2003). Distributed coding of sound locations in the auditory cortex. Biological Cybernetics 89, 341–349CrossRefPubMedGoogle Scholar
  55. Sugase-Miyamoto, Y., & Richmond, B. J. (2005). Neuronal signals in the monkey basolateral amygdala during reward schedules. Journal of Neuroscience, 25, 11071–11083.CrossRefPubMedGoogle Scholar
  56. 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.CrossRefGoogle Scholar
  57. 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.CrossRefPubMedGoogle Scholar
  58. 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.PubMedGoogle Scholar
  59. 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.PubMedGoogle Scholar
  60. 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., Scholar
  61. 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., Scholar
  62. 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.CrossRefPubMedGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2009

Authors and Affiliations

  1. 1.School of PsychologyUniversity of St. AndrewsSt. AndrewsUK

Personalised recommendations