Skip to main content
Log in

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

  • Published:
Journal of Computational Neuroscience Aims and scope Submit manuscript

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’).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Notes

  1. Alternatively, one could search for the σ m ,γ m which maximise of \(P(\{\vec{z}^i\}|\sigma_m,\gamma_m)=\sum_{M} P(\{\vec{z}^i\}|M) P(M|\sigma_m,\gamma_m)\), where \(P(\{\vec{z}^i\}|M)\) is given by Eq. (9). Using a uniform P(M|σ m ,γ m ), we found σ m  ≈ 2.3 and γ m  ≈ 37 for the data in Fig. 1(A).

  2. 3.2 GHz Intel XeonTM, SuSE Linux 10.1.

  3. 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.

    Article  PubMed  Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • Berger, J. (1985). Statistical decision theory and Bayesian analysis. New York: Springer.

    Google Scholar 

  • Bertsekas, D. P. (2000). Dynamic programming and optimal control. Nashua: Athena.

    Google Scholar 

  • Cover, T., & Thomas, J. (1991). Elements of information theory. New York: Wiley.

    Book  Google Scholar 

  • 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 

  • Davis, P. (1972). Gamma function and related functions. In M. Abramowitz & I. Stegun (Eds.), Handbook of mathematical functions. New York: Dover.

    Google Scholar 

  • DiMatteo, I., Genovese, C. R., & Kass, R. E. (2001). Bayesian curve-fitting with free-knot splines. Biometrika, 88(4), 1055–1071.

    Article  Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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.

    Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • Friedman, H.S., & Priebe, C.E. (1998). Estimating stimulus response latency. Journal of Neuroscience Methods, 83, 185–194.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  Google Scholar 

  • 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.

    CAS  PubMed  Google Scholar 

  • Hurley, L. M., & Pollak, G. D. (2005). Serotonin shifts first-spike latencies of inferior colliculus neurons. Journal of Neuroscience, 25, 7876–7886.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    CAS  PubMed  Google Scholar 

  • Loader, C. (1997). LOCFIT: An introduction. Statistical Computing and Graphics Newsletter, 8(1), 11–17. http://www.stat-computing.org/newsletter.

    Google Scholar 

  • Loader, C. (1999). Local regression and likelihood. New York: Springer.

    Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • Maunsell, J. H., & Gibson, J. R. (1992). Visual response latencies in striate cortex of the macaque monkey. Journal of Neurophysiology, 68, 1332–1344.

    CAS  PubMed  Google Scholar 

  • Nawrot, M. P., Aertsen, A., & Rotter, S. (2003). Elimination of response latency variability in neuronal spike trains. Biological Cybernetics, 88, 321–334.

    Article  PubMed  Google Scholar 

  • 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.

    Article  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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 

  • 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.

    CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  Google Scholar 

  • Paninski, L. (2004). Estimating entropy on m bins given fewer than m samples. IEEE Transactions on Information Theory, 50(9), 2200–2203.

    Article  Google Scholar 

  • Panzeri, S., & Treves, A. (1996). Analytical estimates of limited sampling biases in different information measures. Network: Computation in Neural Systems, 7, 87–107.

    Article  Google Scholar 

  • 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.

    Article  CAS  Google Scholar 

  • 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 

  • 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.

    CAS  PubMed  Google Scholar 

  • 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.

    PubMed  Google Scholar 

  • Richmond, B. J., Oram, M. W., & Wiener, M. C. (1999). Response features determining spike times. Neural Plasticity, 6, 133–145.

    Article  CAS  PubMed  Google Scholar 

  • Sary, G., Koteles, K., Chadaide, Z., Tompa, T., & Benedek, G. (2006). Task-related modulation in the monkey inferotemporal cortex. Brain Research, 1121, 76–82.

    Article  CAS  PubMed  Google Scholar 

  • 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 

  • Shannon, C. E. (1948). The mathematical theory of communication. The Bell Systems Technical Journal, 27, 379–423, 623–656.

    Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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 

  • Shinomoto, S., & Koyama, S. (2007). A solution to the controversy between rate and temporal coding. Statistics in Medicine, 26, 4032–4038.

    Article  PubMed  Google Scholar 

  • Stecker G. C., & Middlebrooks J. C. (2003). Distributed coding of sound locations in the auditory cortex. Biological Cybernetics 89, 341–349

    Article  PubMed  Google Scholar 

  • Sugase-Miyamoto, Y., & Richmond, B. J. (2005). Neuronal signals in the monkey basolateral amygdala during reward schedules. Journal of Neuroscience, 25, 11071–11083.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    Article  CAS  Google Scholar 

  • 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.

    Article  CAS  PubMed  Google Scholar 

  • 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.

    PubMed  Google Scholar 

  • 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.

    CAS  PubMed  Google Scholar 

  • 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.

    CAS  PubMed  Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

  • 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.

    Article  PubMed  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Dominik Endres.

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)):

$$\label{app_evidence} \begin{array}{rcl} P(\{\vec{z}^i\}|M)&=&\sum\limits_{k_{M-1}=M-1}^{T-2} \sum\limits_{k_{M-2}=M-2}^{k_{M-1}-1} \ldots \\ && \ldots \sum\limits_{k_0=0}^{k_1-1} P(\{\vec{z}^i\}|\{k_m\},M)P(\{k_m\}|M) \end{array} $$
(31)

where the summation boundaries are chosen such that the bins are non-overlapping and contiguous and

$$\label{app_pgivenk} \begin{array}{l} P(\{\vec{z}^i\}|\{k_m\},M)\\ {\kern20pt} =\int_0^1 d\{f_m\} P(\{\vec{z}^i\} | \{f_m\},\{k_m\},M) p(\{f_m\}|M). \end{array} $$
(32)

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):

$$\label{app_likelihood_set} \begin{array}{rcl} P(\{\vec{z}^i\}|\{f_m\},\{k_m\},M)&=&\prod\limits_{i=1}^N \prod\limits_{m=0}^M f_m^{s(\vec{z}^i,m)}(1-f_m)^{g(\vec{z}^i,m)} \\ &=& \prod\limits_{m=0}^M f_m^{s(\{\vec{z}^i\},m)}(1-f_m)^{g(\{\vec{z}^i\},m)} \\ \end{array} $$
(33)

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

$$ \label{app_fprior} p(\{f_m\}|M) = \prod_{m=0}^M \mbox{B}(f_m;\sigma_m,\gamma_m). $$
(34)

The integrals in Eq. (32) can be evaluated by virtue of Eqs. (33 and 34):

$$ \label{pzk} P(\{\vec{z}^i\}|\{k_m\},M)\!=\!\prod_{m=0}^M \! \frac{\mbox{B}(s(\{\vec{z}^i\},m)\!+\!\sigma_m,g(\{\vec{z}^i\},m)+\gamma_m)}{\mbox{B}(\sigma_m,\gamma_m)} $$
(35)

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

$$\label{intervalevidences_def} \begin{array}{rcl} \mbox{getIEC}({k_s},{k_e},{m})&:=&\mbox{B}(s(\{\vec{z}^i\},k_s,k_e)\\ &&+\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m) \end{array} $$
(36)

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]\):

$$ \label{priors_def} \mbox{pr}[M]:=\frac{\prod_{m=0}^M \frac{1}{\mbox{B}(\sigma_m,\gamma_m)}}{\left(\begin{array}{c}T-1\\M\end{array}\right)}. $$
(37)

Substituting Eq. (35) into Eq. (31) and using the definitions (36) and (37), we obtain

$$\label{evidence_redef} \begin{array}{rcl} P(\{\vec{z}^i\}|M) &\propto& \sum\limits_{k_{M-1}=M-1}^{T-2}\ldots \\ &&\ldots \sum\limits_{k_0=0}^{k_1-1} \prod\limits_{m=1}^M \mbox{getIEC}({k_{m-1}+1},{k_m},{m}) \\ && \times \mbox{getIEC}({0},{k_0},{0}) \end{array} $$
(38)

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:

$$\label{pushed_sums} \begin{array}{rcl} &&{\kern-7pt} P(\{\vec{z}^i\}|M)\\ &&{\kern12pt} \propto \sum\limits_{k_{M-1}=M-1}^{T-2} \mbox{getIEC}({k_{M-1}\!+\!1},{T\!-\!1},{M}) \\ &&{\kern20pt} \times \sum\limits_{k_{M-2}=M-2}^{k_{M-1}-1} \mbox{getIEC}({k_{M-2}+1},{k_{M-1}},{M-1}) \\ &&{\kern20pt} \times \ldots \sum\limits_{k_0=0}^{k_1-1} \mbox{getIEC}({k_0+1},{k_1},{1})\mbox{getIEC}({0},{k_0},{0}).\\ \end{array} $$
(39)

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:

$$ \mbox{subE}_{m}[k]:=\sum_{r=m-1}^{k-1} \mbox{getIEC}({r+1},{k},{m}) \mbox{subE}_{m-1}[r], $$
(40)

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).

Table 4 Computing the evidences of models with up to M bin boundaries

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

$$ \begin{array}{rcl} P(L=t,\{\vec{z}^i\}|M,S)&=&\sum\limits_{k_{M-1}=M-1}^{T-2} \sum\limits_{k_{M-2}=M-2}^{k_{M-1}-1} \ldots \\ && \ldots \sum\limits_{k_0=0}^{k_1-1} P(L=t,\{\vec{z}^i\},\{k_m\}|M,S) \end{array} $$
(41)

where

$$ \begin{array}{rcl} P(L&=&t,\{\vec{z}^i\},\{k_m\}|M,S) \\ &=&\int_0^1 d\{f_m\} P(L=t|\{k_m\},\{f_m\},M,S) \\ &&\times\,p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M). \end{array} $$
(42)

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:

$$\label{latency_intbounds} \begin{array}{rcl} P(L&=&t,\{\vec{z}^i\},\{k_m\}|M,S) \\ &=& \int_0^1 d\{f_m\} P(L=t|\{k_m\},\{f_m\},M,S) \\ &&\times\, p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M) \\ &=& \int_0^S df_0 \ldots \int_0^S df_{j-1} \int_S^1 df_{j} \int_0^1 df_{j+1} \ldots \\ &&\ldots\,\int_0^1 df_M p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M) \end{array} $$
(43)

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

$$\label{latency_pzk} \begin{array}{rcl} P(L&=&t,\{\vec{z}^i\},\{k_m\}|M,S) \\ &=& \prod\limits_{m=0}^{j-1} B_S(s(\{\vec{z}^i\},m)+\sigma_m,g(\{\vec{z}^i\},m)+\gamma_m) \\ &&\times\, \tilde{B}_S(s(\{\vec{z}^i\},j)+\sigma_m,g(\{\vec{z}^i\},j)+\gamma_m)) \\ &&\times\, \prod\limits_{m=j+1}^M B(s(\{\vec{z}^i\},m)+\sigma_m,g(\{\vec{z}^i\},m)+\gamma_m) \\ &&\times\, \prod\limits_{m=0}^M \frac{1}{B(\sigma_m,\gamma_m)} P(\{k_m\}|M) \end{array} $$
(44)

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

$$\label{intervallatencies_def} \begin{array}{rcl} && \mbox{getIEC}_{L}({k_s},{k_e},{m}):= \\ &&{\kern15pt} =\left\{\begin{array}{ll} B_S(s(\{\vec{z}^i\},k_s,k_e) & \\[6pt] {\kern6pt}+\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m)&\,\,\,\mbox{if } k_e<t\\[6pt] \tilde{B}_S(s(\{\vec{z}^i\},k_s,k_e) & \\[6pt] {\kern6pt}+\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m))&\,\,\,\mbox{if } k_s=t\\[6pt] B(s(\{\vec{z}^i\},k_s,k_e) & \\[6pt] {\kern6pt} +\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m)&\,\,\,\mbox{if } k_s>t \\[6pt] 0 & \,\,\,\mbox{otherwise}\end{array}\right. \end{array} $$
(45)

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

$$ \begin{array}{rcl} &&{\kern-7pt} P(f(t) = \tilde{f},L=t,\{\vec{z}^i\}|M,S) = \\ &&{\kern12pt} =\sum\limits_{k_{M-1}=M-1}^{T-2} \sum\limits_{k_{M-2}=M-2}^{k_{M-1}-1} \ldots \\ &&{\kern11pt} \ldots \sum\limits_{k_0=0}^{k_1-1} P(f(t) = \tilde{f},L=t,\{\vec{z}^i\},\{k_m\}|M,S) \end{array} $$
(46)

where

$$ \begin{array}{rcl} &&{\kern-7pt} p(f(t) = \tilde{f},L=t,\{\vec{z}^i\},\{k_m\}|M,S) \\ &&{\kern12pt} =\int_0^1 d\{f_m\} P(f(t) = \tilde{f},L=t|\{k_m\},\{f_m\},M,S) \\ &&{\kern20pt} \times\, p(\{\vec{z}^i\},\{f_m\},\{k_m\}|M) \end{array} $$
(47)

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

$$\label{latfire_pzk} \begin{array}{rcl} &&{\kern-7pt} p(f(t)= \tilde{f},L=t,\{\vec{z}^i\},\{k_m\}|M,S) \\ &&{\kern12pt} =\prod\limits_{m=0}^{j-1} B_S(s(\{\vec{z}^i\},m)+\sigma_m,g(\{\vec{z}^i\},m)+\gamma_m) \\ &&{\kern20pt} \times \tilde{f}^{s(\{\vec{z}^i\},j)+\sigma_m-1}\;(1-\tilde{f})^{g(\{\vec{z}^i\},j)+\gamma_m)-1} \\ &&{\kern20pt} \times \prod\limits_{m=j+1}^M B(s(\{\vec{z}^i\},m)+\sigma_m,g(\{\vec{z}^i\},m)+\gamma_m) \\ &&{\kern20pt} \times \prod\limits_{m=0}^M \frac{1}{B(\sigma_m,\gamma_m)} P(\{k_m\}|M) \end{array} $$
(48)

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

$$\label{intervallatfire_def} \begin{array}{rcl} &&{\kern-7pt} \mbox{getIEC}_{f,L}({k_s},{k_e},{m}):= \\ &&{\kern12pt} \left\{\begin{array}{ll} B_S(s(\{\vec{z}^i\},k_s,k_e) & \\[6pt] {\kern6pt}+\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m)&\,\,\,\mbox{if } k_e<t \\[6pt] \tilde{f}^{s(\{\vec{z}^i\},k_s,k_e)+\sigma_m-1} & \\[6pt] {\kern6pt}\times (1-\tilde{f})^{g(\{\vec{z}^i\},k_s,k_e)+\gamma_m -1}&\,\,\,\mbox{if } k_s=t \\[6pt] B(s(\{\vec{z}^i\},k_s,k_e) & \\[6pt] {\kern6pt}+\sigma_m,g(\{\vec{z}^i\},k_s,k_e)+\gamma_m)&\,\,\,\mbox{if } k_s>t \\[6pt] 0 & \,\,\,\mbox{otherwise}\end{array}\right. \end{array} $$
(49)

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

Reprints 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

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10827-009-0157-3

Keywords

Navigation