# Thermodynamic Formalism in Neuronal Dynamics and Spike Train Statistics
## 3 Thermodynamic Formalism in Neuroscience
### The Hammersley-Clifford Theorem  
In our representation spikes take a binary value 0 or 1. Thus, any potential of range \(R\) is a function taking a finite set of values. A general theorem from [PERSON] and [PERSON] [105; 106] states that any range-\(R\) observable, in particular, the potential \(\phi\left(\,x_{n-R,n}\,\right)\), can be written in the form  
\[\phi\left(\,x_{n-R,n}\,\right)=\sum_{l}\phi_{l}\,m_{l}(x_{n-R,n}), \tag{22}\]  
where the coefficients \(\phi_{l}\) correspond to the decomposition of \(\phi\) in the space of finite range \(R\)-observables. This is analogous to Equation (5), with two main differences. First, the linear combination in (5) is used as an example making a link with Thermodynamics and the Maximum Entropy principle. Here, the decomposition (22) is a systematic expansion of any potential of range \(R\) defined over spike sequences. Second, in contrast to (5), the observables, denoted \(f_{k}\) in (5) only consider finitely many values. Equation (22) is a linear decomposition on a basis of eigenfunctions referred to from now on as monomials [107]. They have the form:  
\[m_{l}(x_{n-R,n})=\prod_{k=1}^{d}x_{i_{k}}^{n_{k}}.\]  
where \(n_{k}=1,\ldots,N\) is a neuron index, and \(i_{k}=n-R,\ldots,n\) a time index. Thus, \(m_{l}(x_{n-R,n})=1\) if and only if, in the spike sequence \(x_{n-R,n}\) neuron \(n_{k}\) spikes at time \(i_{k}\) for all \(k=1,\ldots,d\). Otherwise, \(m_{l}(x_{n-R,n})=0\). The number \(d\) is the _degree_ of the monomial; degree one monomials have the form \(x_{i_{1}}^{n_{1}}\), taking the value 1 if and only if neuron \(n_{1}\) spikes at time \(i_{1}\). Degree two monomials have the form \(x_{i_{1}}^{n_{1}}\)\(x_{i_{2}}^{n_{2}}\), taking the value 1 if and only if neuron \(n_{1}\) spikes at time \(i_{1}\) and neuron \(n_{2}\) spikes at time \(i_{2}\), and so on. Thus, monomials provide a notion of spike interactions, similar to spins interactions in magnetic systems. For example, monomials of degree two correspond to pairwise interactions, like, e.g., in an Ising model. In contrast to the Ising model, the interactions that are considered here may involve time delays between spikes. There are \(2^{NR}\) monomials for \(N\) neurons and a given range \(R\). One can index them by an integer \(l\) in one-to-one correspondence with the set of pairs \((i_{k},n_{k})\). The advantage of the monomial representation is that it focuses on spike events, which is natural for spiking neuronal dynamics. Thus, the Hammersley Clifford decomposition gives a canonical way to write any range \(R\) potentials as a linear combination of monomials of maximum degree \(R\). This includes the GLM potential which can be embedded in the same framework [104]. As emphasised above, the Hammersley Clifford decomposition is analogous to the expression of thermodynamic potentials as a sum of products of an intensive quantity (e.g., temperature) with an extensive one (e.g., the energy). Depending on the physical constraints of the problem, one defines a thermodynamic ensemble, where the average value of extensive quantities (energy, number of particles, volume, magnetisation) is prescribed. Whereas, the first principles allow for guessing the form of the potential in thermodynamics, there is no such recipe in neuroscience. Moreover, one cannot use the complete expansion (22) on practical grounds, simply because large degree monomials have a vanishing empirical probability. More precisely, the average value of a monomial of degree \(d\) decays exponentially fast with \(d\). This leads to two problems. (i) How to determine (from data) the constraints which are necessary to correctly characterise the spike train statistics? (ii) Are there constraints that are equivalent? (i) can be addressed in the context of information geometry [108] while (ii) can be approached using cohomology [107]. We do not further develop these aspects here, but rather refer the reader to the cited articles.