# Thermodynamic Formalism in Neuronal Dynamics and Spike Train Statistics
## 3 Thermodynamic Formalism in Neuroscience
### Statistics of Spike Trains and Gibbs Distribution  
The human brain is composed of about a hundred billion neurons that mostly communicate among themselves together using sequences of spikes that are binary events (Sub-threshold oscillations also play an important role [100] and in organs like the retina, where most neurons do not spike.) Although the action potentials can vary in duration, amplitude, and shape, depending, e.g., on the type of neuron, they have a stereotyped shape, so that they can be considered as identical events. The main physiological reason for spike occurrence is that they can propagate information on different scales in the nervous system (centimeters to one meter) essentially without attenuation (active conduction as opposed to passive, Ohmic, conduction). However, from a contemporary point of view, spikes are also considered as events constituting \"bits\" of information. In this paradigm, it is tempting to consider spike trains as objects containing a \"neural code\" [37], i.e., a language that neurons use to communicate and that one could decipher. This terminology should not be considered literally, because, as opposed to computer codes, spike trains have a wide variability (e.g., the repetition of the same stimulus, even under controlled experimental conditions does not induce the same sequence of spikes as a response). In addition, nothing guarantees that there is only one code. When considered from the perspective of Thermodynamic Formalism, the notion of neural codes can have several meanings. (1) Spike trains constitute a symbolic coding of voltage dynamics (which depends on neuronal interactions and stimuli); and, (2) the way how neuronal dynamical systems (especially, spike trains) are affected by stimuli, provides a way for downstream networks to infer the stimulus (e.g., the retina encodes a visual scene in spike trains which are decoded by the visual cortex, capable of reconstructing a representation of the visual scene). Here, we essentially want to address the following questions: how to use Thermodynamic Formalism to fit experimental (or numerically generated) spike train data and which Gibbs distribution is produced by a network of neurons whose dynamics is known. It is useful to consider spikes as instantaneous events (while the duration is about 1 ms) and identify the maximum in the action potential course as the \"time of the spike\" [101]. This implicitly assumes that one considers dynamics on time scales larger than one millisecond. The binary representation is obtained using a window of a constant \"binning size\" (of order 10-20 ms) over the continuous time course of membrane potentials and count how many spikes there are per neuron within each time bin. Two or more spikes may occur within the same time bin, in that case, the convention is to consider these events equivalent to just one spike. This procedure [102] transforms experimental data into sequences of binary patterns (see Figure 2) leading to the following symbolic description. Denoting the discrete time index by \(n\), the spike-state of neuron \(k\) is denoted by \(x_{n}^{k}\in\{0,1\}\), depending on whether the \(k\)-th neuron emits a spike during the \(n\)-th time bin or not. A spike pattern is the spike-state of all the neurons in a network of \(N\) neurons at a given time bin, and it is denoted by \(x_{n}:=\left[x_{n}^{k}\right]_{k=1}^{N}\). A spike block denoted by \(x_{n,r}:=x_{n}x_{n+1}\cdots x_{r}\) is a sequence of spike patterns. The length of the spike block \(x_{n,r}\) is \(r-n+1\). A spike train denoted by \(x\) is the spike block representing the whole sequence of spike patterns. We consider spike trains of finite and infinite length. The set of all possible spike blocks of length \(R\) in a network of \(N\) neurons is denoted by \(A_{R}^{N}\). Thus, in comparison to the previous section, and especially Section 2.1, symbols here are spike blocks of length \(R\).