Phase Transitions in Financial Markets Using the Ising Model: A Statistical Mechanics Perspective

Bruno Giorgio
Independent Researcher
London, United Kingdom
Abstract

This dissertation investigates the ability of the Ising model to replicate statistical characteristics, or stylized facts, commonly observed in financial assets. The study specifically examines in the S&P500 index the following features: volatility clustering, negative skewness, heavy tails, the absence of autocorrelation in returns, and the presence of autocorrelation in absolute returns. A significant portion of the dissertation is dedicated to Ising model-based simulations. Due to the lack of an analytical or deterministic solution, the Monte Carlo method was employed to explore the model’s statistical properties. The results demonstrate that the Ising model is capable of replicating the majority of the statistical features analyzed.

Introduction

Modeling financial markets is a complex task, as asset prices fluctuate due to various events. Economists, including Vilfredo Pareto and Paul Samuelson, have turned to the exact sciences to understand these dynamics. Louis Bachelier first modeled stock prices as a stochastic process following a Gaussian distribution (Bachelier, 1900), but this theory couldn’t explain market crashes like those in the 1990s and 2007-2008. Bachelier’s assumptions—statistical independence and normal distribution—were challenged by Benoit Mandelbrot’s discovery of fat-tailed distributions in the 1960s (Mandelbrot, 1963), which became a key stylized fact of financial markets. In 1999, Mantegna and Stanley introduced econophysics, which is an application of statistical mechanics to finance (Mantegna & Stanley, 2000). By viewing financial markets as complex systems, econophysics uses statistical mechanics and non-linear dynamics to explore how macroscopic market behaviors emerge from the microscopic interactions of financial agents.

Phase transition model

The phase transition model is in nature. Natural phenomena usually show this two-state evolution. In the world of physics, this phenomenon is a process of transition between two states identified by thermodynamic parameters. The classical example could be when we apply an external magnetic field to the ferromagnetic material. There, particles react in a way that it could be a collective behavior (Chang, 2010). The concept of magnetic materials inspires this essay. The Ising model, originally developed by Ernst Ising in 1925 to study magnetic moments and their two-state magnetization (+1, -1), serves as a simplified framework for identifying phase transitions. The Ising model and its extensions have proven effective in representing complex systems, such as organizational and social interactions. By simulating the phase transitions between ’buy’ and ’sell’ agent decisions, this model enables the study of market behavior through Spin-Based Agent interactions, analogous to the particles in a ferromagnetic system (Sinha et al., 2011).
In financial markets, phase transitions emerge from collective agent behavior, analogous to particles in physical systems. This research adopts an agent-based modeling approach, specifically Heterogeneous Agent Models (HAM) as described by Hommes (2006). This emphasizes diverse expectations/rules/information for the agent despite the fully rational and homogeneous standard economic model.

Bornholdt model

Several HAM models originated in the last decades by Challet & Zhang (1997), Lux & Marchesi (1998), Kaizoji et al. (2002), and Sieczka & Holyst (2007), but this research is focused on the Bornholdt model (2001). In economic terminology, the model with spin states (+1,1)11(+1,-1)( + 1 , - 1 ) can be interpreted as representing a buyer (+1)1(+1)( + 1 ) and a seller (1)1(-1)( - 1 ) in the financial market. In this context, the spin of a particle can be viewed as an agent’s decision. In addition to this, there are two major conflicting forces in the model that influence the final spin (i.e., buy or sell decision). The first is the phenomenon of herd behaviour, or ”do what your neighbours do,” as described in the Lux and Marchesi model. The second comes from the minority game, which follows the principle of ”do what the minority does.” Bornholdt combined these two forces in a simple spin-based model.

Let us consider Si(t)=±1subscript𝑆𝑖𝑡plus-or-minus1S_{i}(t)=\pm 1italic_S start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) = ± 1 as the spin orientation for each i𝑖iitalic_i-th agent in the lattice. In this model, we have i{1,,N}𝑖1𝑁i\in\{1,\ldots,N\}italic_i ∈ { 1 , … , italic_N }, where N𝑁Nitalic_N is the total number of agents. For simplicity, we assume that the dynamics of each agent are updated according to the following equations:

Si(t+1)=+1withp=11+e2βhi(t)formulae-sequencesubscript𝑆𝑖𝑡11with𝑝11superscript𝑒2𝛽subscript𝑖𝑡S_{i}(t+1)=+1\quad\text{with}\quad p=\frac{1}{1+e^{-2\beta h_{i}(t)}}italic_S start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t + 1 ) = + 1 with italic_p = divide start_ARG 1 end_ARG start_ARG 1 + italic_e start_POSTSUPERSCRIPT - 2 italic_β italic_h start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) end_POSTSUPERSCRIPT end_ARG
Si(t+1)=1with1psubscript𝑆𝑖𝑡11with1𝑝S_{i}(t+1)=-1\quad\text{with}\quad 1-pitalic_S start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t + 1 ) = - 1 with 1 - italic_p

In the equations, β𝛽\betaitalic_β is a coupling coefficient, hi(t)subscript𝑖𝑡h_{i}(t)italic_h start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) represents the local field acting on agent i𝑖iitalic_i at time t𝑡titalic_t, and p𝑝pitalic_p is the probability. According to Bornholdt’s definition, the local field is given by:

hi(t)=j=1NJijSjαSi|1Nj=1NSj|subscript𝑖𝑡superscriptsubscript𝑗1𝑁subscript𝐽𝑖𝑗subscript𝑆𝑗𝛼subscript𝑆𝑖1𝑁superscriptsubscript𝑗1𝑁subscript𝑆𝑗h_{i}(t)=\sum_{j=1}^{N}J_{ij}S_{j}-\alpha S_{i}\left|\frac{1}{N}\sum_{j=1}^{N}% S_{j}\right|italic_h start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) = ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT italic_S start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT - italic_α italic_S start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | divide start_ARG 1 end_ARG start_ARG italic_N end_ARG ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT italic_S start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT |
  • hi(t)subscript𝑖𝑡h_{i}(t)italic_h start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_t ) (Local field) is the ”influence” or pressure that agent i feels at time t to flip its spin or change the decision from buy to sell or vice versa.

  • j=1NJijSjsuperscriptsubscript𝑗1𝑁subscript𝐽𝑖𝑗subscript𝑆𝑗\sum_{j=1}^{N}J_{ij}S_{j}∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT italic_S start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT – Neighbour interaction (herding behavior). This reflects the tendency of agents to follow the majority or market trend (interaction with the j𝑗jitalic_j-th neighbour).

  • αSi|1Nj=1NSj|𝛼subscript𝑆𝑖1𝑁superscriptsubscript𝑗1𝑁subscript𝑆𝑗\alpha S_{i}\left|\frac{1}{N}\sum_{j=1}^{N}S_{j}\right|italic_α italic_S start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | divide start_ARG 1 end_ARG start_ARG italic_N end_ARG ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT italic_S start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT | – Global market feedback (Global Magnetization). This term penalizes the agent for aligning with the majority opinion.

Regarding the spin representation, in Fig. 1 & 2 there is the 2D lattice proposed by Wioland et al. (2016) showing ferromagnetic and antiferromagnetic behavior. Another more complete representation of lattice I prefer is the Torus made by Ruffini & Deco (2021) in Fig. 3. In this 3D model, we can see every spin is connected with no boundaries.

Refer to caption
Figure 1: A two-dimensional Ising lattice, showing ferromagnetic order (Wioland et al., 2016)
Refer to caption
Figure 2: A two-dimensional Ising lattice, showing antiferromagnetic order (Wioland et al., 2016)

The spin dynamics within the lattice follow a probabilistic update rule, where the parameter β𝛽\betaitalic_β governs the volatility of the system. A higher β𝛽\betaitalic_β value corresponds to increased sensitivity to changes in the local field, resulting in a steeper logistic response curve. This parameter is analogous to the inverse temperature in statistical physics. We empirically estimated the below parameters to get a good simulation of the model.

Refer to caption
Figure 3: The model is based on a torus geometry. In each of its two directions, the Torus has the same number of sites. On the Jijsubscript𝐽𝑖𝑗J_{ij}italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT, the lattice is square with periodic boundary conditions (Ruffini & Deco, 2021)
Minority effect α=10Minority effect 𝛼10\text{Minority effect }\alpha=10Minority effect italic_α = 10
Inverse temperature β=1.7Inverse temperature 𝛽1.7\text{Inverse temperature }\beta=1.7Inverse temperature italic_β = 1.7

At high values of β𝛽\betaitalic_β (i.e., low temperature), spin configurations tend to settle into low-energy states, such as all spins aligned (either all +11+1+ 1 or all 11-1- 1). In contrast, when β=0𝛽0\beta=0italic_β = 0 (i.e., infinite temperature), all configurations occur with equal probability, and the spins behave independently. In this regime, typical configurations resemble random noise.

Monte Carlo simulation

Due to the vast number of possible states, numerically evaluating the Ising model is computationally intensive and analytically intractable for large systems. While equations of motion can be formulated, solving them is impractical. This complexity motivates the use of Monte Carlo methods to simulate the model.
We collected daily financial data spanning the past forty years, specifically from February 1982 to February 2022. The dataset consists of the Adjusted Close prices of the S&P 500 index. Following Cont (2001), the logarithmic return over a time interval ΔtΔ𝑡\Delta troman_Δ italic_t is computed as:

rΔt(t)=ln(Pt)ln(PtΔt)subscript𝑟Δ𝑡𝑡subscript𝑃𝑡subscript𝑃𝑡Δ𝑡r_{\Delta t}(t)=\ln(P_{t})-\ln(P_{t-\Delta t})italic_r start_POSTSUBSCRIPT roman_Δ italic_t end_POSTSUBSCRIPT ( italic_t ) = roman_ln ( italic_P start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) - roman_ln ( italic_P start_POSTSUBSCRIPT italic_t - roman_Δ italic_t end_POSTSUBSCRIPT )

rΔt(t)subscript𝑟Δ𝑡𝑡r_{\Delta t}(t)italic_r start_POSTSUBSCRIPT roman_Δ italic_t end_POSTSUBSCRIPT ( italic_t ) denotes the logarithmic return at time t𝑡titalic_t over the interval ΔtΔ𝑡\Delta troman_Δ italic_t. Ptsubscript𝑃𝑡P_{t}italic_P start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT is the Adjusted Close price of the S&P 500 index at time t𝑡titalic_t. ΔtΔ𝑡\Delta troman_Δ italic_t is the time interval between two consecutive price observations.
Here we will be using the Metropolis-Hastings algorithm to generate a sequence of samples from a probability distribution. In our initial simulation, we employ a two-dimensional lattice composed of 32×32323232\times 3232 × 32 agents. Time plays a crucial role in the model, as it evolves over multiple time steps. Specifically, the system runs through a loop of 1,000,00010000001,000,0001 , 000 , 000 iterations. Starting from a random spin configuration, we apply the Bornholdt update rule to compute the local field for each agent. Subsequently, we calculate the probability of the agent’s state S(t)𝑆𝑡S(t)italic_S ( italic_t ) based on this local field. This process is repeated for each time step t{0,1,,106}𝑡01superscript106t\in\{0,1,\ldots,10^{6}\}italic_t ∈ { 0 , 1 , … , 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT }.
A randomized matrix was used to initialize the simulation with a warm-up period of approximately t<100,000𝑡100000t<100{,}000italic_t < 100 , 000 cycles to allow the system to stabilize before collecting data. The returns rΔtsubscript𝑟Δ𝑡r_{\Delta t}italic_r start_POSTSUBSCRIPT roman_Δ italic_t end_POSTSUBSCRIPT are computed at intervals of Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100, which is sufficient for observing meaningful patterns in the return distribution.
During the simulation, two snapshots were captured in different time. Figure 4 represents a market state evolving steadily with minimal or no external information influx. In contrast, the right image illustrates a volatile, intermittent regime in which the influence of neighboring agents becomes ambiguous, and global magnetization reaches severe levels.

Refer to caption
Figure 4: Monte Carlo Simulation of Ising model with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100. Left snapshots taken during stable phase and the right one taken during intermittent phase.

Analysis of Results

Volatility Clustering

Volatility clustering was the first criterion used to evaluate whether the model exhibited behavior consistent with real financial markets. According to Mandelbrot (1963), large price changes tend to be followed by large changes (of either sign), and small changes tend to be followed by small changes. This phenomenon, known as volatility clustering, can be observed in the return time series of financial assets like the S&P500 index.
In the Monte Carlo simulation of the Bornholdt Ising model, we perform 106superscript10610^{6}10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT iterations with a lag time of Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100, as this interval is sufficient to observe patterns in the return distribution. By computing returns with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100, we obtain a total of 106100=10,000superscript10610010000\frac{10^{6}}{100}=10{,}000divide start_ARG 10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT end_ARG start_ARG 100 end_ARG = 10 , 000 return values. The figure below illustrates the standardized returns obtained after the full set of iterations.

Refer to caption
Figure 5: S&P 500 index daily returns from (1982 – 2022)

For comparison, Figure 6 shows the returns generated by the Ising model simulation. By visually inspecting the return series, it can be observed that the simulated dynamics do not fundamentally differ from those in Figure 5, which illustrates the real S&P 500 index returns. The model exhibits a memory effect, characterized by clusters of large fluctuations followed by other large changes. This behavior allows us to confidently exclude the hypothesis of a purely random process (television static).

Refer to caption
Figure 6: Monte Carlo Simulation of Ising model with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100

Autocorrelation of Returns

We begin by analysing the autocorrelation coefficients for various lag times τ𝜏\tauitalic_τ in both the S&P 500 index and the Ising model. This is followed by an analysis of the absolute returns to investigate the decay behaviour of autocorrelation. The time lag is defined as τ={0,,150}𝜏0150\tau=\{0,\dots,150\}italic_τ = { 0 , … , 150 }.

Refer to caption
Figure 7: Autocorrelation function of S&P500 index and the Ising model with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100

The figure below illustrates the differences between the autocorrelation of returns in the S&P 500 index and those generated by the Ising model. It can be seen that the autocorrelation in the Ising model data gradually approaches that of the S&P 500, suggesting convergence in their return distributions. This decay implies that price changes are not significantly autocorrelated, except over short time scales.

Refer to caption
Figure 8: Autocorrelation of absolute returns function of S&P500 index and the Ising model with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100

The autocorrelation of absolute returns remains positive and decays slowly. The decay is asymptotically consistent with a power-law function (Cont, 1997), expressed as:

ρA(τ)=Aτηsubscript𝜌𝐴𝜏𝐴superscript𝜏𝜂\rho_{A}(\tau)=A\cdot\tau^{-\eta}italic_ρ start_POSTSUBSCRIPT italic_A end_POSTSUBSCRIPT ( italic_τ ) = italic_A ⋅ italic_τ start_POSTSUPERSCRIPT - italic_η end_POSTSUPERSCRIPT

where A𝐴Aitalic_A and η𝜂\etaitalic_η are parameters, with η𝜂\etaitalic_η empirically found to lie within the range [0.2,0.4]0.20.4[0.2,0.4][ 0.2 , 0.4 ]. Cont found η=0.37𝜂0.37\eta=0.37italic_η = 0.37 (based on S&P 500 data up to 1997). Our analysis of the Ising model yields a power regression with η0.3𝜂0.3\eta\approx 0.3italic_η ≈ 0.3, which lies within the same empirical range.
As shown in Figure 8 & 9, both the S&P 500 index and the Ising model exhibit slow-decaying autocorrelation in the absolute returns. This provides quantitative evidence of the well-documented phenomenon of volatility clustering, in which large price changes tend to be followed by further large changes, either positive or negative.

Refer to caption
Figure 9: Power Regression of Autocorrelation of absolute returns function of the Ising model with Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100

Inferential Statistics

We evaluated the Ising model simulation and the S&P 500 index using statistical measures. As previously discussed, skewness and kurtosis were employed to assess distribution asymmetry and tail heaviness, acknowledging that financial returns often deviate from the Gaussian Distribution.
The Shapiro-Wilk and Jarque-Bera tests have been applied under the null hypothesis that the data follow a normal distribution. Both tests returned p𝑝pitalic_p-values well below the 0.05 threshold, leading to rejection of the null hypothesis.

p-value (Ising)0.0p-value (Ising)0.0\text{p-value (Ising)}\approx 0.0p-value (Ising) ≈ 0.0
p-value (S&P 500)0.0p-value (S&P 500)0.0\text{p-value (S\&P 500)}\approx 0.0p-value (S&P 500) ≈ 0.0

The Jarque-Bera test evaluates consistency with normal skewness and kurtosis, while the Shapiro-Wilk test assesses the normality of distribution.

Refer to caption
Figure 10: Statistics and Hypothesis Tests of the S&P500 index and Ising model Δt=100Δ𝑡100\Delta t=100roman_Δ italic_t = 100

As shown, Monte Carlo simulations of the Ising model produce return distributions characterized by significant skewness and heavy tails. Both normality tests confirm deviation from Gaussian behaviour. Similar results were found when applying the same analysis to the S&P 500 index.
The skewness and kurtosis values indicate that the return distribution is leptokurtic, exhibiting heavy tails. All simulations and statistical computations were carried out using Python. Statistical measures such as skewness, kurtosis, as well as normality tests including the Jarque-Bera and Shapiro-Wilk tests, were implemented using the StatTools library.

Conclusions

This research explored financial markets through the lens of complex systems, leveraging the Ising model, specifically Bornholdt’s adaptation, as a novel approach to replicate real-world financial dynamics. By simulating agent interactions within an agent-based framework, the model successfully reproduced key stylized facts observed in financial data, particularly from the S&P 500 index.

The Ising model proved to be effective under appropriate parameter configurations, generating return distributions with realistic statistical properties. The autocorrelation of absolute returns demonstrated long-memory behavior, decaying according to a power-law—a significant departure from the independence assumed in random walk models.

Statistical analysis further confirmed the presence of leptokurtic distributions with heavy tails and negative skewness in both the Ising simulations and actual market data. These findings were supported by inferential tests (Jarque-Bera and Shapiro-Wilk), which consistently rejected the null hypothesis of normality, aligning with the heavy-tailed, asymmetric nature of financial return distributions.

Overall, the Ising model offers a compelling framework for modeling market complexity and emergent behavior, successfully bridging physics-based models with empirical financial phenomena.

References

Bachelier, L. (1900) Théorie de la spéculation. Annales Scientifiques de l’Ecole Normale Supérieure. III: 17. 21-86

Bornholdt, S. (2001). Expectation bubbles in a spin model of markets: Intermittency from frustration across scales. International Journal of Modern Physics A 12(5): pp. 5-59

Challet, D. & Zhang, Y. (1997). Emergence of Cooperation and Organization in an Evolutionary Game. Physica A: Statistical Mechanics and its Applications 246(3-4): pp. 407-418

Cont. R. (1997) Scaling and correlation in financial time series. arXiv:cond-mat/9705075

Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues. Quantitative Finance, Volume 1, pp. 223-236.

Chang, Y. & An S. & Kim, S. (2010). Can a Representative-Agent Model Represent a Heterogeneous-Agent Economy. American Economic Journal: Macroeconomics. Vol. 1, No. 2, pp. 29-54

Hommes, C.H. (2006). Heterogeneous Agent Models in Economics and Finance. Handbook of Computational Economics Vol 2, chapter 23, pp. 1109-1186, Elsevier

Ising, E. (1925). Beitrag zur Theorie des Ferromagnetismus. Z. Phys., 31 (1): 253–258

Kaizoji, T. & Bornholdt, S. & Fujiwara (2002). Dynamics of Price and Trading Volume in a Spin Model of a Stock Markets with Heterogeneous Agents. Physica A 316: pp. 441-452

Lux, T. & Marchesi, M. (1998). Volatility Clustering in Financial Markets: A Micro-Simulation of Interacting Agents. Discussion Paper Series B 437, University of Bonn, Germany

Mandelbrot, B. (1963). The Variation of Certain Speculative Prices. The Journal of Business, Vol. 36, No. 4, pp. 394-419

Mantegna, R. & Stanley, H. (2000). An Introduction to Econophysics. Correlations and Complexity in Finance. Cambridge University Press.

Ruffini, G. & Deco, G. (2021). The 2D Ising model, criticality and AIT. bioRxiv 2021.10.21.465265

Siecka, P. & Holyst, J. (2007). A threshold model of financial markets. Acta Physica Polonica A 114 (3): 458-648

Wioland, H., Woodhouse, F., Dunkel, J. et al. (2016). Ferromagnetic and antiferromagnetic order in bacterial vortex lattices. Nature Phys 12, 341–345