# Thermodynamic Formalism in Neuronal Dynamics and Spike Train Statistics
## 2 Mathematical Setting of Thermodynamic Formalism
### Correlations
#### 2.3.1 Properties of the Pressure  
From the pressure (2), important statistical information regarding the system can be obtained, in particular, correlations. A distinguished case corresponds to the potentials of the form (5). When the corresponding pressure is differentiable to any order, taking the successive derivatives of the pressure with respect to their conjugate parameters gives the average values of the observables, their correlations, and their high-order cumulants with respect to the Gibbs measure. That is, in general:  
\[\frac{\partial^{n}F(U_{\lambda})}{\partial\lambda_{k}^{n}}=\kappa_{n}\quad \text{ for all }\;k\in\{1,...,K\}, \tag{6}\]  
where \(\kappa_{n}\) is the cumulant of order \(n\) with respect to \(\mu_{\lambda}\). In particular, \(\kappa_{1}\) is the mean of \(f_{k}\), \(\kappa_{2}\) is its variance, \(\kappa_{3}\) the skewness, and \(\kappa_{4}\) the kurtosis. Partial derivatives with respect to pairs of parameters can also be considered [82]:  
\[ \begin{split}\frac{\partial^{2}F(U_{\lambda})}{\partial\lambda_{ k}\partial\lambda_{j}}&=C_{f_{k},f_{j}}(0)+\sum_{n=1}^{\infty}C_{f_{k}, f_{j}}(n)+\sum_{n=1}^{\infty}C_{f_{j},f_{k}}(n)\\ &=\frac{\partial\mu\left[\,f_{k}\right]}{\partial\lambda_{j}}= \frac{\partial\mu\left[\,f_{j}\,\right]}{\partial\lambda_{i}}.\end{split}  \tag{7}\]  
Observe, we differentiate \(C_{f_{k},f_{j}}\) from \(C_{f_{j},f_{k}}\) as the dynamics may be irreversible in time. For an example of application of these formulas in the context of spike train statistics, see Section 2.6. **Remark 1**. : _The last two equations are fundamental. They establish a link between the variations in the average of the observable \(f_{k}\), when slightly varying the parameter \(\lambda_{j}\) and the sum of time correlations between the pair of observables \(f_{j},f_{k}\). This result is known, in statistical physics as the fluctuation-dissipation theorem [83; 84]. It relates, for example, in a ferromagnetic model, to the variation of the magnetisation of the spin \(k\) to the variations of the local magnetic field \(h_{k}\), via the magnetic susceptibility, which is the second derivative of the free energy. This is also the context of the linear response theory, which quantifies how a small perturbation of a parameter affect the average values of observables in terms of the unperturbed measure. Equation (7) can also be used to extend results of Thermodynamic Formalism to non-stationary situations, as we discuss in Section 4.5._  
Now, in the classical formulation in statistical physics and the Maximum Entropy models, only the correlation \(C_{f_{k},f_{j}}(0)\) appears in (7), because successive times are independent (correlations \(C_{f_{k},f_{j}}(n),C_{f_{j},f_{k}}(n),n>0\) vanish). When handling memory (thus, potentials with range \(R>1\)), there is an infinite sum (series) of correlations appearing in the linear response. This infinite sum converges whenever correlations are decaying sufficiently fast with time \(n\) (exponentially). In contrast, when they do not converge fast enough (e.g., power-law with a small exponent), the series diverges, leading to a divergence of the second derivative of the pressure, corresponding to a second-order phase transition. Here, follow the [PERSON] classification of phase transitions [85]. There is a phase transition of order \(k\) if the pressure (free energy) is \(C^{k-1}\) but not \(C^{k}\). The known examples are first-order, second-order, or infinite order (Kosterlitz-Thouless) phase transitions. Note that phase transitions in memory-less models can also happen if the instantaneous correlation function \(C_{f_{k},f_{j}}(0)\) diverges, e.g., when the number of degrees of freedom in the system (number of spins, neurons) tends to infinity. Therefore, in the present setting, second-order phase transitions can arise either when the number of degrees of freedom tends to infinity, or (not exclusive), when time correlations decay slowly.