Have you ever wondered what makes magnets magnetic? Or why people sell their stock when everyone else is selling? This blog post will introduce you to a model from physics that explains magnetism in solids and can also serve as an agent-based market simulation. The model in question is a a well-known model from statistical physics: the Ising Model.

The Ising Model is a lattice model where electrons are located on each site of the lattice (see Figure 1). Electrons have an intrinsic angular momentum called spin. Together with their negative charge, this creates a magnetic momentum which explains the magnetic properties of solids.

Each spin can interact with its nearest neighbors on the lattice and has two possible orientations: up or down (+1 or -1), i.e. the direction of its magnetic momentum. The configuration/lattice probability is given by the Boltzmann distribution. In the case of ferromagnetism (), it is energetically more reasonable for the spins to align themselves parallel to their neighbors. Next to the interactions with its neighbours, the overall temperature has a big influence on the probability (which is captured in the model by ). That is why magnets lose their magnetisation permanently at high temperature, for example Neodymium magnets which have a wide variety of applications will lose its magnetic properties at around 80°C.

## Over to Finance

The research area of behavioral finance is concerned with the influence of human behavior on markets. Herd mentality bias (or herding behavior) refers to investors’ tendency to copy what other investors are doing. Therefore, we now replace spins with agents, i.e. market participants that can perform two possible actions: Buy/Long (+1) and Sell/Short (-1).

According to the model definition, agents now strive to make sure that they mimic the behavior of their neighbors. In this way, cascading changes can occur on the lattice, as can also be observed during financial crises on the markets.

The Bornholdt Model is an extension of the Ising Model, which attempts to relate more directly to a traditional market. In addition to the nearest neighbor interaction, another term is added to the model.

This describes the coupling of each agent with respect to the entire grid and/or market. Furthermore, in addition to its alignment, each agent receives a so-called strategy value , which can also take the value +1 or -1. Agents with a strategy value +1 are called chartists, they are willing to follow the basic trend of the market. Whereas fundamentalists with the value -1 tend to join the minority. Moreover, the strategy can change during the simulation which is described in detail in the original paper.

The mathematical description of the full model is shown in Equation (1) which defines the local field of the agent. The first term describes the interaction with its neighbours and the second term the coupling mechanism to the whole market. During the simulation, the agents’ alignment is updated with the probabilties:

The simulation is performed using the Metropolis-Hastings algorithm, a so-called Markov Chain Monte Carlo (MCMC) method.

## The Results

The lattice configuration is steadily changing and evolving during the simulation as can be seen in Figure 1. Figure 2 shows the model price () and calculated returns from the simulation. From the returns time series, it can be directly observed that the simulation is able to mimic periods of high volatility (volatility cluster).

Such observations can also be observed in real markets, Figure 3 illustrates the daily returns of the S&P 500 index between 1981 and 2021, clearly showing the highly volatile periods and excess returns during Black Monday 1987, the 2008 financial crisis and the COVID crisis 2020.

To gauge how well this model is able to emulate a real market, I’ve organised a few descriptive metrics as well as results of statistical tests in the table below. These include skewness and kurtosis of the return distributions as well as autocorrelation coeffcients for lags and . The assumption of normal distributed returns can be rejected for both time series (see result of Jarque-Bera and Shapiro Wilk tests, respectively).

The goal of this writeup is to give a brief look into the research area of econophysics and show the parallels that exist between physical models and financial markets.

Model Returns | S&P 500 Returns | |
---|---|---|

Skewness | -0.009 | -0.751 |

Kurtosis | 3.763 | 20.57 |

Shapiro-Wilk (p-value) | 0.000 | 0.000 |

Jarque-Bera (p-value) | 0.000 | 0.000 |

ACF(1) | 0.033 | -0.062 |

ACF(2) | 0.055 | -0.016 |

Resources

- S. Bornholdt (2001). Expectation bubbles in a spin model of markets: Intermittency from frustration across scales. International Journal of Modern Physics C 12: 667-674.
- Singh, Satya Pal. (2020). The Ising Model: Brief Introduction and Its Application. 10.5772/intechopen.90875.
- Robert C.P., Casella G. (1999) The Metropolis—Hastings Algorithm. In: Monte Carlo Statistical Methods. Springer Texts in Statistics. Springer, New York, NY.