# 1 Introduction:

## 1 Introduction:

The mathematical modelling of economic phenomena in stock- and currency-markets has been going on for one century \[1-4\]. However, recently physicists have begun applying the concepts and techniques of statistical physics to understand the dynamical behaviour of these ”complex adaptive systems” by developing models which are similar, at least in spirit, to the statistical mechanical models of interacting microscopic constituents of macroscopic samples of matter. The constituent elements in these ”microscopic” models of markets represent the individual investors and investment agencies \[5-11\].

Cont and Bouchaud (CB)  have suggested one of the simplest models of financial markets; this model has led to interesting conclusions regarding the ”microscopic” origin of the ”herd behaviour”, ”bubbles” and ”crashes” at the stock markets. There exists a close relation between this theory and the theory of percolation  (see also ; for a short review of microscopic models see ). By simplifying the CB model through a reformulation and, then, extending it further, in this paper we develop a more detailed model of stock market; this is formulated in terms of interacting super-spins, which are maintained at a fictitious temperature and which evolve with time following a stochastic dynamics, in the presence of time-dependent local fields. We explain the motivations for these reformulations and extensions of the CB model and examine the corresponding consequences by analyzing the temporal fluctuations in the changes of stock prices.

## 2 The Models:

### 2.1 The CB Model:

In the CB model , pairs of individual investors are linked randomly with probability $`p`$ and the clusters of linked individuals thus formed are identified as ”coalitions” of investors; all the members of each coalition make the same investment decision (i.e., whether to buy or to sell or not to trade). Therefore, each cluster may correspond, for example, to funds managed by the same portfolio manager.

Since, in the original formulation of this model , a link is allowed to form between any pair of investors, the clustering corresponds to bond percolation in infinite-dimensional space . Isolated individual investors may be viewed as clusters of size one. Once the individual investors form the clusters, the time-evolution of the clusters proceeds as follows: each cluster randomly decides to buy (with probability $`a`$), to sell (with probability $`a`$) or not to trade (with probabilty $`12a`$) during each unit time interval. The change of the stock price is defined to be proportional to the difference between the demand and supply. If $`n_s^+`$ is the number (per investor) of the buying clusters and $`n_s^{}`$ is the number (per investor) of the selling clusters then the price change $`\mathrm{\Delta }`$ is given by $`\mathrm{\Delta }[_ssn_s^+_ssn_s^{}]`$.

### 2.2 The super-spin model:

In this paper we first reformulate the CB model in terms of ”superspins”. The system consists of super-spins $`S_i`$; the magnitude $`|S_i|`$ of the super-spins are drawn from a pre-determined probability distribution $`P(|S|)`$ and each spin can be in one of the three possible states, viz., $`+|S_i|,0,|S_i|`$. These superspins are analogues of the clusters in the CB model and the magnitude of the spin corresponds to the cluster size in the CB model. At every discrete time step, each of the super-spins choses the state $`+|S_i|`$ with probability $`a`$, the state $`|S_i|`$ with probability $`a`$ and the state $`0`$ with probability $`12a`$; this is identical to the rule of time evolution of the clusters of investors in the CB model. The total number of individual investors is $`_{i=1}^N|S_i|`$ and the price change, which is defined to be proportional to the difference in the total demand and total supply, is thus proportional to the total magnetization $`M=_{i=1}^NS_i`$ where $`N`$ is the total number of super-spins (i.e., the total number of clusters of investors).

## 3 Results and Discussion:

Using this reformulated version of the CB model, together with the distribution

$$P(|S|)|S|^{(1+\alpha )},$$
(1)   
we have computed the distributions of stock price variations for several different values of $`a`$ and $`N`$. This distribution is non-Gaussian, irrespective of the number of investment agencies (see fig.1a; $`\alpha =3/2`$ in fig.1).

The super-spin model, as formulated above, is closely related to Levy flights. By Levy flight one means a random walk where the the probability $`p(\mathrm{})`$ of a jump of size $`\mathrm{}`$ is given by the distribution 

$$p(\mathrm{})\mathrm{}^{(1+\alpha )}with0<\alpha <2.$$
(2)   
Since the form (1) of $`P(|S|)`$ in our model is identical to that of $`p(\mathrm{})`$ for a Levy flight, the magnetization of $`N`$ super-spins (i.e., the price change of the stocks) is the analogue of the total displacement after $`N`$ steps of a particle performing Levy-flights; this is similar to the concepts introduced originally by Mandelbrot  and also to the stochastic multiplicative process of Levy and Solomon . Therefore, $`P(M)`$, the distribution of the stock price variations in our model may appear to be the distribution $`P_{LF}^{(N)}(x)`$ of the total displacements $`x`$ of $`N`$-step Levy flights. However, that is not true as there is a subtle difference between the two processes arising from the fact that, in our model, the spin configuration $`\{S\}`$ (analogue of the $`N`$ displacements of the Levy flight) is generated from another configuration by using the rule that a spin $`S_i`$ decides to be in the state $`\pm |S_i|`$ and $`0`$ with the probabilities $`a`$ and $`12a`$, respectively. Therefore , if $`n`$ is the number of non-zero superspins in a configuration $`\{S\}`$,

$$P(M)=\underset{n=0}{\overset{N}{}}\left(\genfrac{}{}{0pt}{}{N}{n}\right)(2a)^n(12a)^{Nn}P^{(n)}(M),$$
(3)   
where $`P^{(1)}(M)`$ is identical to the distribution (1) for $`P(|S|)`$ and $`P^{(n)}(M)`$ represents the distribution obtained by $`n`$ convolutions of $`P(|S|)`$ with itself. Taking Fourier transform of both sides of (3) we get

$$\widehat{P}(k)=\underset{n=0}{\overset{N}{}}\left(\genfrac{}{}{0pt}{}{N}{n}\right)(2a)^n(12a)^{Nn}\widehat{P}^{(n)}(k)$$
(4)   
where $`\widehat{P}(k)`$ and $`\widehat{P}^{(n)}(k)`$ are the Fourier transforms of $`P(M)`$ and $`P^{(n)}(M)`$, respectively. Now,

$$\widehat{P}^{(n)}(k)=[\widehat{P}^{(1)}(k)]^n$$
(5)   
where $`\widehat{P}^{(1)}(k)`$ is nothing but the Fourier transform of (1). Inserting (5) into (4) we get a series that can be summed analytically and, hence,

$$\widehat{P}(k)=[2a\widehat{P}^{(1)}(k)+(12a)]^N$$
(6)   
The expression of $`\widehat{P}^{(1)}(k)`$ is known exactly. For the simplicity of analysis we consider the case where $`\alpha <1`$. Then, for small $`k`$ (i.e., large price variations)

$$\widehat{P}^{(1)}(k)=1C|k|^\alpha +\mathrm{higher}\mathrm{order}\mathrm{terms}.$$
(7)   
Inserting (7) into (6) we get

$$\widehat{P}(k)=12aNC|k|^\alpha +\mathrm{higher}\mathrm{order}\mathrm{terms},$$
(8)   
which implies that the tail of the distribution of $`M`$ has the same exponent $`1+\alpha `$ as our input in equation (1). Next, we consider the case where $`1<\alpha <2`$. In this case, (7) is replaced by

$$\widehat{P}^{(1)}(k)=1ikgC|k|^\alpha +\mathrm{higher}\mathrm{order}\mathrm{terms}.$$
(9)   
Inserting (9) in to (6) now we get

$$P(k)=\mathrm{exp}[2Na[ikg+C|k|^\alpha +\mathrm{higher}\mathrm{order}\mathrm{terms}]]$$
(10)   
which also implies that the tail of the distribution of $`M`$ has the same exponent $`1+\alpha `$ as our input in equation (1). This is, indeed, consistent with our numerical data obtained from computer simulation (see fig.1(b)) and is trivial in the limit $`a0`$.

Moreover, from the above analysis one would expect the tail of the distribution of the stock price variations in our super-spin model to have the same exponent $`1+\alpha `$ as our input in equation (1) for all velues of $`a`$. This is, indeed, what we observed by replotting our data on a log-log plot (not shown in any figure) after scaling the widths of all the non-Gaussian distributions of fig.1c to unity. In contrast to these features of $`P(M)`$ in our super-spin formulation, the distribution of price variations in the CB model is close to a Gaussian for sufficiently large $`a`$, at least when formulated on finite-dimensional lattices (see fig.1c) although it is non-Gaussian with a power-law tail for small $`a`$.

Furthermore, equation (10) also suggests that, if the distribution $`P(|S|)`$ is given by the equation (1) then, in the asymptotic regime of large $`M`$, the amplitude of the tails in the distribution $`P(M)`$ should scale linearly with $`a`$ for small $`a`$ on a semi-log plot. The lack of good agreement between this theoretical prediction and our numerical data is most probably caused by the fact that the true asymptotic regime may be far beyond the largest $`M`$ plotted in this figure. It is also worth pointing out here that for small $`k`$ (i.e., for large variation of the prices) the dependence of $`P(M)`$ on $`a`$ and $`N`$ enters through the product $`aN`$ and this is consistent with our observation.

In order to model the tendency of traders (individual as well as portfolio management agencies) getting influenced by the opinion of other traders, we now ”switch on” interactions among the super-spins. The super-spins are not located on the sites of any lattice. We define the ”total opinion ” $`H_i`$ gathered by the $`i`$-th trader, because of all the other traders, as

$$H_i=\underset{ji}{}J_{ij}S_j$$
(11)   
where $`J_{ij}`$ is a measure of the strength of the mutual influence between the pair of traders (individual or investment agencies) labelled by $`i`$ and $`j`$; the sum on the right hand side of (11) is to be carried out over all the $`N1`$ super-spins excluding $`i`$. If $`J_{ij}>0`$ ($`J_{ij}<0`$), then a buying $`j`$-th trader would encourage the $`i`$-th trader to buy (sell), and vice versa. Note that, in the language of the spin models of magnetism, $`J_{ij}`$ is the strength of the exchange interaction between spin-pairs and $`H_i`$ is the Weiss molecular field (or, internal field).

For our discussion here, we consider only the natural choice, namely, $`J_{ij}>0`$ for all pairs $`(ij)`$. Moreover, for simplicity, we consider $`J_{ij}=J`$, a constant independent of $`i`$ and $`j`$, for all the spin-pairs, so that the ”total opinion” gathered by the $`i`$-trader can be written as

$$H_i=J\underset{ji}{}S_j.$$
(12)   
Note that $`H_i=0`$ describes a balance of optimistic and pessimistic traders whereas $`H_i>0`$ ($`H_i<0`$) correspond to predominant optimism (pessimism). The motivation for including not only the sign of $`S_j`$ , but also its magnitude on the right hand side of (12) comes from the fact that, usually, the larger is a trading agency the stronger is its effect on shaping the market opinion. Although, in real markets, this effect of $`S_j`$ may be nonlinear, i.e., not proportional to the first power of the size of the trading agency, we assume a linear dependence for the sake of simplicity.

At this stage of formulation of our model, every trader may be regarded as a ”noise trader” who has no own opinion and would decide whether to buy or sell depending on whether the ”total opinion” gathered is positive or negative. Besides, the larger is the magnitude of $`H_i`$ the stronger will be the corresponding opinion influencing the decision of the $`i`$-th ”noise trader”. We define the ”disagreement function” $`E_i`$ of the $`i`$-th noise trader as

$$E_i=S_iH_i=J\underset{ji}{}S_iS_j;$$
(13)   
all ”noise traders” would like to minimize the corresponding disagreement function. In the language of spin models of magnetism, $`E_i`$ is the energy of the $`i`$-th spin because of its interactions with the other spins.

If all the spins minimized their energies the system of super-spins would end up in a ferromagnetic state. Equivalently, if all the traders mimimized their disagreement defined above, i.e., if all the investors make decision only depending on what other investors are doing (and minimize their own disagreement accordingly) the market will end up in either of two possible states where all the traders will either like to buy or sell. However, this does never happen in any real financial markets because the traders neither blindly follow the market opinion nor can always manage to follow the market opinion (even if they wanted to) because of so many reasons other than the influence of all other traders. In order to model these random influences, which are not explicitly included in our model, we introduce a fictitious temperature $`T`$. Since, in reality, the average price change usually vanishes, and since price change corresponds to the total magnetization in our model, we choose a sufficiently large magnitude of $`T`$ so that the magnetization fluctuates in time about the zero mean value. Therefore, we modify the dynamics of the model as follows: a super-spin picks up the states $`+|S_i|,|S_i|`$ and $`0`$ with the probabilities $`a,a`$ and $`12a`$, respectively and, then it is allowed to make a transition from its current state to the state it has picked up with the probability $`e^{\mathrm{\Delta }E_i/(k_BT)}`$ where $`\mathrm{\Delta }E`$ is the change in its energy (i.e., the change of disagreement in the language of economics) associated with this transition.

Finally, we further extend this reformulated model to incorporate ”fundamentalist traders” who form at least a part of their opinion (i.e., optimistic or pessimistic bias) towards the stocks of a company on the basis of an analysis of the fundamentals of that company. If $`h_i`$ is the ”individual bias” of the $`i`$-th investor, then the corresponding ”disagreement function” is given by

$$E_i=S_i(H_i+h_i);$$
(14)   
where a positive $`h_i`$ corresponds to optimism while a negative $`h_i`$ indicates pessimism of the trader. The dependence of $`h_i`$ on $`i`$ implies that different fundamentalist trading agencies can have different evaluations of the fundamental value. However, in contrast to the time-independent local fields considered usually in spin models, both the magnitude as well as the sign of the ”individual bias” $`h_i`$ of the traders can change with time. We study the effects of this time-dependent ”individual bias” on the price variations.

When every super-spin is subjected to a random local field which is positive and negative with equal probability but has the same magnitude, the system represents a market where every trading agent is a fundamentalist but the biased opinion of the agents happen to be randomly optimistic or pessimistic with equal probability. In such a situation we find that the fluctuations in the price variation can be much stronger even when $`|h_i|`$ is not too strong (merely comparable to $`T`$). Nevertheless, the qualitative nature of the price variations in a market where all the traders are fundamentalist is no different from that in a market where every trading agent is a ”noise trader” so long as the fundamentalists have rigid opinions which do not change with time (see fig.2).

We now consider a market where $`50\%`$ of the trading agents are fundamentalists (all with very strong bias towards the stocks of the company under consideration) while the other trading agents are all noise traders. In other words, to begin with, each of the randomly chosen $`50\%`$ of the agencies is subject to a positive local field of sufficiently high magnitude. In this case, we also impose the condition that when the price variation becomes too high or too low (i.e., cross a tolerance window) the fundamentalists reverse their bias. This is implemented in our super-spin model by ”flipping” the direction of each of the local fields. Thus, the local fields switch from positive to negative when $`M`$ rises above a positive value which is chosen apriori, say $`0.4`$, and reverse switching from negative to positive local fields take place when $`M`$ falls below $`0.4`$. The occurrence of larger values of $`|M|`$ in this situation (see fig.3) implies that the fundamentalist traders with apparently very strong optimistic bias can push up the demand for the stocks of a company, even if they represent a fraction of all traders, but when they reverse their opinion, it triggers a rush for selling the stocks. In this way the nearly periodic variation of fig.3b is produced, showing that this last variant of the model is unrealistic. The qualitatively different distribution of price variations observed in such cases (fig.4) indicates that the statistics of bubbles and crashes created by the strong bias of a few fundamentalists would be very different from those of commonly encountered ones which are, thus, dominated by less rational behaviour.

## 4 Summary and conclusion:

In this paper we have developed a model of stock market which may be viewed as a model of interacting super-spins which are maintained at a fictitious temperature and are subjected to time-dependent local fields, where the stochastic dynamics of the super-spins describes the temporal evolution of the decisions (i.e., whether to buy, or sell or not to trade) of individual investors and investment agencies; this dynamics, in turn, leads to the temporal fluctuations of the stock price. We have studied the nature of these fluctuations of the stock price and the phenomena of bubbles and crashes.

In the CB model the probability $`p`$, with which individual traders are linked to form clusters, is tuned to be identical with (or very close to) the corresponding percolation threshold thereby guaranteeing a power-law distribution of the cluster sizes which, in turn, leads to the desired behaviour of the price variations. In our model the distribution of the superspins is directly tuned to a power law. It would be interesting to develop a model which can ”self-organize” so as to produce coalitions whose sizes are distributed according to the desired power law.

We thank D. Sornette and T. Lux for communicating useful informations and the Alexander von Humboldt Foundation for support.

Figure Captions:

Fig.1:   
(a) After rescaling the heights of the distributions of the price changes to unity, the distributions are shown on a semi-log plot. The symbols $`\mathrm{},`$ and $`\times `$ correspond to $`N=10^2,10^3`$ and $`5000`$, respectively (all for $`\alpha =3/2`$) while the symbol $`+`$ correspond to $`\alpha =7/2,N=10^3`$. For all the curves, $`a=0.05`$.   
(b) After rescaling the widths of the distributions in fig.1a also to unity, the distributions are shown on a log-log plot using the same symbols as in fig.1a. The input distribution (1), with $`\alpha =3/2`$, has been represented by the straight line.   
(c) After rescaling the heights of the distributions of the price changes to unity, the scaled distributions are shown on a semi-log plot. The symbols $`\mathrm{},`$ and $`+`$ correspond to $`a=0.5,0.33,0.05`$, respectively (all for $`N=1000`$). For comparison, the data for a CB model system of $`71\times 71`$ traders, run up to $`1000`$ iterations with $`a=1/3`$ and averaged over $`10^6`$ samples, are shown with a line similar to fig.3 of Stauffer and Penna .

Fig.2: The continuous line corresponds to our simplified model before switching on the temperature and local fields. The symbol $``$ corresponds to a situation where all the super-spins, subjected to time-independent random local fields of magnitude $`NJ`$, are maintained at a fictituous $`T(NJ)`$ so that the time-averaged $`M`$ vanishes. Both the height and width of the distributions have been scaled to unity. The common parameters are $`N=10^3`$ and $`a=0.05`$.

Fig.3:   
The fluctuations of the price changes (a) in the CB model and (b) in a situation where all of the randomly chosen $`50\%`$ of the super-spins are subjected to time-dependent local fields (whose magnitude is much larger than $`T`$ but sign is same everywhere) which flip when price change per individual investor goes out of the window $`0.4M0.4`$.

Fig.4: The distribution of the price changes, corresponding to the the situation in fig.3(b), are shown, after scaling the probability for zero price change to unity.