scieee AI-readable full text Open interactive document viewer

Microscopic models applied to financial markets

Riu Vicente, Jordi

Abstract

We use the dynamical Ising model, with stochastic dynamics for the coupling, in order to try to reproduce financial markets indexes. Specifically, the coupling follows an Ornstein-Uhlenbeck process. Regarding the employed dynamics for the Ising model, we first utilize the Metropolis algorithm, obtaining encouraging results. We later consider the more sophisticated Wolff algorithm, which to the best of our knowledge has never been applied to financial markets before. We find that this model is able to reproduce qualitatively, and in some cases quantitatively, the stylized facts, previously computed for real EUR/USD currency data. Finally, we construct a much simpler subordinated stochastic process, based on the Ising mean-field theory, which turns out to encapsulate in a simple way most of the features of the previously studied dynamical Ising models.

Full text

Universitat Polit` ecnica de Catalunya Physics Engineering Bachelor’s Thesis Microscopic Models Applied To Financial Markets Author: Jordi Riu Vicente Supervisor: Rossend Rey Oriol Escola T`ecnica Superior d’Enginyeria de Telecomunicaci´o de Barcelona June 22, 2015 Universitat Polit` ecnica de Catalunya ABSTRACT We use the dynamical Ising model, with stochastic dynamics for the coupling, in order to try to reproduce financial markets indexes, with the coupling following an Ornstein- Uhlenbeck process. Regarding the employed dynamics for the Ising model, we first utilize the Metropolis algorithm, obtaining encouraging results. We later consider the more sophisticated Wolff algorithm, which to the best of our knowledge has never been applied to financial markets before. We find that this model is able to reproduce qualitatively, and in some cases quantitatively, the stylized facts, previously computed for real EUR/USD currency data. Finally, we construct a much simpler subordinated stochastic process, based on the Ising mean-field theory, which turns out to encapsulate in a simple way most of the features of the previously studied dynamical Ising models. 2 Acknowledgements I would like to thank Prof. Xavier Vil`a, from the Economics and Economic History Department (UAB), for his help in understanding the required economic concepts, and Prof. Joan Del Castillo, from the Mathematics Department (UAB), for providing me with valuable insight on financial markets from a mathematical point of view. Finally, I would like to express my sincere gratitude to my supervisor, Prof. Rossend Rey who has contributed to the project with fantastic ideas and has given me very valuable advise on my career future development. From him I have learned that in research, one can always go one step further. 3 Contents 1 Introduction 5 2 State Of The Art 6 3 Stylized Facts 9 3.1 ReturnsandLogReturns .............................. 9 3.2 Stylizedfacts ..................................... 10 3.2.1 Heavy Tails of The PDF of Returns . . . . . . . . . . . . . . . . . . . . 10 3.2.2 Autocorrelation of returns . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.3 Autocorrelation of absolute returns . . . . . . . . . . . . . . . . . . . . . 14 3.2.4 ScalingofPeaks ............................... 16 3.2.5 Aggregational Gaussianity . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2.6 Multifractality................................. 18 4 The Ising Model And Financial Markets 20 4.1 MetropolisAlgorithm................................. 21 4.1.1 FixedT .................................... 22 4.1.2 Ornstein–Uhlenbeck process . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2 WolffAlgorithm.................................... 33 4.2.1 Ornstein–Uhlenbeck process . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.2.2 Variable Number of Agents for time step. . . . . . . . . . . . . . . . . . 40 4.3 Subordinated Stochastic Process . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5 Conclusions and Future Research 51 4 1 Introduction The modern trend for physicists to work on problems in finance and economics began in the early 90s and has gained momentum ever since. The reason behind this interest in the field may be closely related to a series of significant changes that took place in the world of finance. First, in 1973, currencies began to be traded 24 hours a day worldwide in a financial market called the foreign exchange market. Since that time, the volume of foreign exchange trading has been growing at an impressive rate. Secondly, and most relevant, the appearance of electronic trading (80s), allowing the electronic storage huge amounts of data available for study. Such data characterized by being high-frequency, nowadays reach up to the millisecond precision [1]. With the arrival of Physics to the world of finance, new approaches to already established problems emerged. Most of them relied on concepts of Statistical Mechanics as tools for the study of this large amount of data such as scaling, self-similarity, stochastic dynamics or correlation effects, providing a deeper understanding of financial markets at various scales. Furthermore, these concepts combined with Agent-Based models, that are commonly used for the study of complex systems and are based in the decision of multiple agents conditioned to a certain feedback, yield promising results [2]. Critics to these kind of approaches argue that obtaining universal laws for systems in which their components are so different from one another (in this case human beings), relying on theory for identical subjects (particles), seems unlikely. Although it may seem reasonable to think that the ”microscopic equations of motion” of economic and financial markets, if existent, won’t arise from physical models, the behaviour of the system at a macroscopic scale can be reproduced to a considerable extent. Specifically for the case of financial markets, the so called stylized facts have been successfully reproduced by the use of complex Agent- Based models (for example in [16] or [17]). The concept of “stylized facts” was introduced in macroeconomics by Khaldor (1961) [3], who isolated several statistical facts characterizing macroeconomic growth over long periods and in several countries, and took these robust patterns as a starting point for theoretical modelling. Reproducing the real stylized facts of financial markets from a theoretical model is precisely one of the most active areas of research in Econophysics and the objective of the present work. We look at this research as an exploratory project aimed at deepening our knowledge on financial markets while simultaneously learning new physical models with potentially wide application. It is important to mention that most models usually contain a variety of contributions based on financial properties, resulting in the number of parameters in the model to escalate rapidly, which at the same time hinders the interpretation of the results. To avoid this, we establish as an objective of our approach to stay as close to the physical theory (in our case, the Ising model) as possible, in order to try to unambiguously link associate each parameter in the model with its influence on the behaviour of the model. 5 2 State Of The Art The Ising model is a widely used tool in social sciences modelling, specially when studying the imitation phenomenon between agents under the simultaneous effect of noise. For financial markets, many generalizations of the Ising model have been used, and we just give here a short list of works more directly related to our present approach, reference [17] contains an exhaustive and updated review. One of the most cited articles, which illustrates the complexity used in these models, is from Zhou &Sornette [29]. In this model, the spin dynamics is defined through the following equation, si(t+δ) = sign(F(t) + ξi(t) + K(t) N X j=1 ωijsj(t)),(1) where δ=1/N is the unit of micro time, i.e. N updates are equivalent to one macro-unit of time. In this model, the new value of siresults from the competition of three contributions. F(t) is an external forcing term (news) and ξi(t), that is specific for each unit, would model the investor idiosyncratic opinion. Finally, the third term is an interaction term between units and is controlled by the amplitude K(t) (social impact). It is worth mentioning the fact that for F(t)=0 and ξi(t) distributed according to a Logistic distribution, Eq. (1) is equivalent to the Ising model with Glauber dynamics. It is possible to justify, based on the economic concept of utility, that this is a reasonable model in the financial field [17], but we will not focus on that, as there might be some arbitrariness on the definition of the utility function [18]. Returning to the complexity of the model, in the same publication, a formula for the evolution of the coupling term is proposed, K(t)ωij =Ki(t) = bi+αKi(t−1) + βr(t−1)F(t−1).(2) The idiosyncratic imitation tendency biof agent i is uniformly distributed in (0,bmax) and frozen. The coefficient αquantifies the persistence of past influences on the present. Eqs. (1) and (2) should make clear the potential complexity of models constructed upon the Ising ferromagnet. A particularly interesting case is when the coupling follows an stochastic dynamics, as mentioned in [22]. In that case, all units of the lattice were connected and the evolution of the coupling was restricted in a supercritical region. In general, and unlike for the previous model, the coupling term between spins is maintained constant while F(t) and ξi(t) are time varying. This formulation is found in [18], and it is commonly known as the random field Ising model. Another interesting area of research, also arising from the Ising Model, aims to reproduce the stylized facts by introducing non-linear modifications to the Hamiltonian [7], an approach to some physics problems as well. The dynamics is governed by interactions which are frustrated across different scales: while ferromagnetic couplings connect each spin to its local neighbourhood, an additional coupling relates each spin to the global magnetization. This new coupling is allowed to be anti-ferromagnetic. The resulting frustration causes a 6 metastable dynamics with intermittency and phases of chaotic dynamics. The Hamiltonian fo particle i is Hi(t) = X j∈n.n. JijSj(t)−αCi(t) N X j=1 Sj(t),(3) where the sign of this new coupling Cichanges according to a certain rule. In this model, financial returns and magnetization are related in a different way that for the first model (the usual one, that will be defined in the project). We now turn to models for which, unlike the previously described, the focus is on a time varying coupling. They are characterized by usually allowing this coupling to be either positive or negative (ferromagnetic or anti-ferromagnetic) following stochastic dynamics. An example is found in [6], where Jij(t) = Jξ(t) + aνij(t),(4) with ξ(t) and νij(t) being uniformly distributed random variables in (-1,1) with no correlation in space and time. It is relevant that for this model all spins are connected. The last spin-based model presented, is the one developed by Bouchaud and Cont[8] and later reformulated by Chowdhury and Stauffer [9]. We find this model interesting because it is not focused on the individual spins but on groups of spins (clusters). In [9] clusters of linked individuals 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). Alternatively, each cluster may correspond, for example, to funds managed by the same portfolio manager. This model, as the authors point out, suffers from the limitation that the distribution of the superspins is directly tuned to a power law and it would be desirable that this distribution emerges naturally from the dynamics. As we will explain later, one of the models we have used fulfils this desideratum. Finally, it is necessary to point out that all these models have had extensions/modifications in order to reproduce more accurately the stylized facts. It should be clear by now that reproducing all stylized facts is not a simple task starting from a physical model, what explains that other physical approaches to financial markets have been studied. An illustrative example is the work of Parisi et al. (2013) [16] who used an analogy between the dynamics of granular counterflows in the presence of bottlenecks or restrictions and financial price formation processes. Using extensive simulations, they found that the counterflows of simulated pedestrians through a door display most of the stylized facts observed in financial markets when the density around the door is compared with the logarithm of the price, although the existence of long memory for absolute returns demands the additional inclusion of decision-making capabilities. We end this section describing our objectives in more detail. The project will be divided in 2 parts. In the first one, we will study the stylized facts developing a code capable of computing them from a real time series. We consider this to be essential in order to gain some intuition on this financial time series (which seem to have very special properties), as well as to check the results of the models under study. Additionally, it will allow us to learn about the implementation of mathematical tools with wide range of applications. The second part of the project focuses on the capabilities of the Ising model, in its simplest version, to reproduce the stylized facts using well-known methodologies in the field of Statis- 7 tical Physics but that, to the best of our knowledge, have not been completely exploited in this context. Thus, and since we can benefit from a certain level of freedom in the dynamics of the Ising model, we will try different algorithms with a time varying coupling following a stochastic dynamics within a certain supercritical restricted range. Specifically, we will use 2 Ising dynamics: Metropolis dynamics [20], and Wolff dynamics [19] which is much more recent and solves the bottleneck of critical slowing down. The main difference between both is that the first one acts locally while the second does it globally (by flipping clusters of spins). We especially hope for the Wolff dynamics to provide relevant results since it is reminiscent of the stochastic model of Bouchaud and Cont. Finally, and to conclude the second part of t he project, we will try to describe the behaviour of these dynamics by the use of a est of stochastic equations dependent on only 2 variables. 8 3 Stylized Facts Modelling requires the existence of some previously known properties of the system under study, which will be used to check its correctness. In physics, these ”testing” properties could be energy conservation and linear momentum conservation among many others. On the other hand, financial markets behaviour lacks of these governing laws as a consequence of its randomness (or at least they are still unknown). From the study of its statistical properties though, it is possible to determine the existence of some Stylized Facts,i.e., empirical (and usually qualitative) findings that are consistent across a wide range of time periods, financial markets and assets. In this section of the project, some of the most relevant stylized facts of the function of returns of an asset will be defined and reproduced by using real data of the EURUSD currency pair in the foreign exchange market (forex of FX), which is by far the largest market in the world. 3.1 Returns and Log Returns Before proceeding further, the quantities required to study financial time series have to be introduced. Let S(t) be the time series of the price of an asset, that is, the function which value in a certain time t0is the price of the asset at that same time. Then, given a certain time lag ∆t, the return function of the asset price at ∆t is defined as[2]: r∆t(t) = S(t+ ∆t)−S(t) S(t).(5) Furthermore, its log return function can be defined as well in the following way log r∆t(t) = log S(t+ ∆t)−log S(t).(6) Also, it is important to note that when the ratio S(t+ ∆t)/S(t) is close to 1 (and thus the difference between both values is close to 0), the Taylor expansion of the function log(x), defining x as S(t+ ∆t)/S(t), is: log r∆t(t) = log(x)≈log(1) + x−1 = r∆t(t).(7) Thus, when the variation of the time series of the asset price is small, it is possible to work with both definitions of the returns indistinctly. Why do we study returns and log returns instead of the price of the asset or the variation of that price? That is due to the problem of price scales. In finance, the scales used are often given in units (currencies) that are themselves fluctuating in time (due to inflation, economic growth or recession and fluctuations in the global currency market)[1]. In this regard, returns and specially log returns are less sensitive to scale changes, since the first are relative variations and the second are in logarithmic scale (for which a factor of 10 variation is transformed into a variation of 1). Since asset price data is discrete, from now on we will work with discretized time series. Multi-period returns, that will be used shortly, are returns calculated such that the temporal 9 w(rad/h) 0.2 0.4 0.6 0.8 1 1.2 1.4 Spectral Density 0 100 200 300 400 500 600 700 Figure 7: Spectral density of EURUSD-1HOUR data. w(rad/hour)=2π t. 3.2.4 Scaling of Peaks The third stylized fact of financial time series is related to the peaks of the PDFs. The peaks for the multi-compound returns (rk+n,n) PDFs as a exhibit a power-law behaviour as a function of k. Typically, the exponent αof the power-law falls in the environ of -0.70 [15]. For the EURUSD-1HOUR data the value is α=-0.57. To compute αa linear regression has been applied to the equation: log(PDFr=0(k)) = αlog(k) + C. (19) log k 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 log(PDF(r=0)) 3.5 4 4.5 5 5.5 6 6.5 Figure 8: In blue crosses, logarithm of the PDF peak values as a function of log k. In red, logarithm of the associated power-law with α=-0.57. 16 3.2.5 Aggregational Gaussianity The fourth stylized fact under study is the tendency of the PDF of multi-period returns, rk+n,n, to converge to a Gaussian distribution when k increases. This property is shown in Figure 9. It is important to note that since the amount of real data is rather small, the resolution of the PDF is limited. rN -5 -4 -3 -2 -1 0 1 2 3 4 5 PDF(rN) 10-3 10-2 10-1 100 101 Figure 9: In orange crosses, EURUSD-1HOUR single-period normalized returns PDF. In yellow crosses, EURUSD-1HOUR multi-period normalized returns PDF (k=80). In blue, the associated Gaussian distribution with the same mean and variance. The same evolution but without semi-logarithmic scale is plotted in Figure 10. rN -4 -3 -2 -1 0 1 2 3 4 PDF(rN) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Figure 10: In black, EURUSD-1HOUR single-period normalized returns PDF. EURUSD-1HOUR multi-period normalized returns PDF (red k=20, green k=100). In blue, the associated Gaussian distribution with the same mean and variance. 17 3.2.6 Multifractality A fractal is mathematical set (which models certain natural phenomena) that exhibits a repeating pattern at every scale. If the replication is exactly the same at every scale, it is called a self-similar pattern. This behaviour is characterised by its fractal dimension, a ratio providing a statistical index of complexity comparing how detail in a pattern (strictly speaking, a fractal pattern) changes with the scale at which it is measured. That is, if the pattern is described by sticks of length L, and we reduce the unitary length” of the stick by a factor of the number of sticks (N) required to describe the pattern scales like N∝−Dwhere D is the fractal dimension. Figure 11 displays the first 4 iterations of the Koch Snowflake. Observe that for the second one (the star), the sticks have length L’=L/3 where L is the length of a side of the triangle. Note that by reducing the length of the stick the resolution of the pattern is higher, and what was a triangle becomes a star. For this reason, what was a side of the triangle (of length 3L’) now has length 4L’ due to the change in the pattern. Then logN=−D=log N log =log 4 log 1/3=−1.2619 (20) Figure 11: Koch snowflake. A multifractal system is a generalization of a fractal system in which a single exponent (the fractal dimension) is not enough to describe it; instead, a continuous spectrum of exponents (singularity spectrum) is needed. Multifractality of the time series of returns can be tested by examining the ratio <|rk+n,n|q> <|rk+n,n|>q for multi-period returns calculated for different k. This ratio is constant for a simple fractal but not for a multifractal [16]. In Figure 12 these ratios are shown for different values of q (1.5, 2, 2.5 and 3). As expected, the ratios are not constant. 18 k 100101102 <jrk+n;njq> = < jrk+n;nj>q 100 101 Figure 12: Ratio <|rk+n,n|q> <|rk+n,n|>qas a function of k, for different values of q: 1.5 (blue), 2 (orange), 2.5 (yellow), 3 (purple). 19 4 The Ising Model And Financial Markets Financial markets are complex systems in which the disordering forces of asymmetric/private information and uncertainty are in competition with the ordering force of imitation/learning of its agents [17]. Nowadays, there exist multiple models aiming to describe the behaviour of these systems, but finding an equilibrium between complexity and fidelity is by no means easy. In this regard, Agent Based models (in which rational agents interact under certain imposed rules) seem to reproduce well enough the previously stated stylized facts, but the impact of each parameter is hard to interpret due to the large quantity of parameters used in these models. The Ising model on the other hand, is a rather simple physically originated model where an order-disorder equilibrium exists. Originally, this model was used in statistical mechanics to describe ferromagnetism, but nowadays it is used in a wide range of social and physical problems. The Ising model consists of a large number of spins interacting within a lattice. Each spin can only take the value +1 or -1 (depending on the direction in which it points) and is only allowed to interact with its nearest neighbours, tending to align with them (see Figure 13). Therefore, it combines the effect of temperature (disordering force) and the tendency of a physical system to reach its most stable (lowest energy) state, which for the ferromagnetic Ising model coincides with the state in which all spins are aligned (ordering force). Thus, it is a strong candidate to model financial markets. The Hamiltonian of the system is the following: Hising =−JX n.n. σiσj,(21) where n.n. stands for nearest neighbours and J>0 (since we want to favour imitation between spins and not the other way around) and σiis the value of the ith spin of the lattice. Figure 13: Graphical representation of the 2D-Ising lattice. An spin from the lattice (red spin) can only interact with the ones that are closer to him (black spins). In 2D the number of nearest neighbours is 4. In this section of the project, the dynamic Ising model will be used to try to reproduce the previously studied stylized facts of financial time series by allowing the coupling (J/KBT) to 20 follow a random motion. It is important to note that the Ising model does not have any specific dynamics, only an established behaviour at equilibrium. For this reason, there exist multiple possibilities to model its dynamical behaviour. We will particularly focus on the Wolff dynamics, which has never been used in financial markets studies. It only rests to explain how the dynamics of the Ising model can be related to price dynamics. Consider N traders (N sites) in a social network whose links represent the communication channels between the traders (in the Ising model only nearest neighbours are linked). The traders buy or sell at price p(t) (t is assumed to be discrete). Each agent can either buy (spin up, σi=+1) or sell (spin down,σi= -1) one unit of the asset. Then, asset returns are assumed to be determined by [17], r∆t(t) = λ N· N X i=1 σi,(22) where λwill be used to normalize its value. Returns are thus proportional to the magnetization or aggregated decisions of the agents. Regarding the decision of an agent to buy or sell, there exist multiple and arbitrary ways of defining the condition to be satisfied. In this project we will make no attempt to justify the choices taken in terms of utility functions, etc. Instead we will focus on several dynamical algorithms well-known to the physics community and investigate to which extent they are able to mimick the stylized facts we have just discussed. 4.1 Metropolis Algorithm The first dynamics under study is Metropolis Dynamics. In the Metropolis algorithm spins are selected one at a time in random order. Then, the selected spin is flipped with a probability that depends on the variation of the energy of the system. The Metropolis algorithm is a Markov process governed by the following Master Equation, ∂p({σi}, t) ∂t =X i6=j{p({σ0 i})Wi0i−p({σi}, t)Wii0},(23) where Wii0is the probability of transitioning from state {σi}to state {σ0 i}, and P({σi}, t) the is the probability for the system to be at state iat time t. Starting from any initial condition, in order for p({σi}, t → ∞) to be equal to the Boltzmann weight of {σi}, P({σi}) = e−βH({σi}) Z,(24) it is sufficient that the algorithm satisfies the following conditions [21] W({σi} −→ {σ0 i})≥0∀{σi},{σ0 i},(25) P({σi})W({σi} −→ {σ0 i}) = P({σ0 i})W({σ0 i} −→ {σi}).(26) Property (25) is necessary in order to ensure that all possible configurations are reachable from any initial condition. Property (26) is called detailed balance and implies that at equilibrium, each elementary process should be equilibrated by its reverse process. 21 In the Metropolis algorithm W represents the probability of flipping the previously selected spin and is defined in the following way W({σi} −→ {σ0 i}) = min{1, e−β∆E},(27) where ∆E=E{σ0 i}−E{σi}. From this definition (25) is directly accomplished. The verification of the detailed balance condition is straightforward: if E{σ0 i}≤E{σi}, we get e−βE{σi} Z=e−βE{σ0 i} Z·e−β(E{σi}−E{σ0 i}).(28) If E{σi}≤E{σ0 i}, then the left hand side and the right hand side of (28) are just swapped. Finally, if both energies are equal, detailed balance is also accomplished since it is reduced to e−βE{σi} Z=e−βE{σ0 i} Z.(29) Once the ability of this type of dynamics to achieve equilibrium has been demonstrated, we would like to highlight a few relevant points in what concerns the modelization of time series. First, to decide whether a proposed update should be accepted or not, one draws a uniformly distributed random number r∈[0,1), and if W≤r, the new state is accepted. Otherwise the previous configuration is maintained. Secondly, the concept of time in the Metropolis algorithm is unclear, but at the same time, it is crucial in order to generate the asset returns time series. In this project, each value of the time series is taken every N iterations (being N the number of sites in the lattice), as in [22]. Finally, although spins are chosen randomly, sequential order picking is permissible as well [23]. In the following sections the Metropolis Algorithm, with some modifications, will be used to try to reproduce stylized facts of asset time series. 4.1.1 Fixed T We will first compute the returns by applying (22) to the magnetization of an 60x60 Ising lattice, with J/KB=1 and maintaining the Temperature constant and at equilibrium. This will serve the double purpose of re-obtaining the well-known equilibrium properties, and of showing that it is not trivial to reproduce financial stylized facts. It is well known that for a ferromagnetic Ising system, there exists a phase transition between an ordered and a disordered phase for a certain value of T (called critical temperature). That is, hMi/Ntransitions from being 0 to 1 (without the existence of a magnetic field). This transition happens when KBTC/J=2/log(1+√2)≈2.2692. In Figure 14 the transition is clearly reproduced, with deviations due to the finite size of the lattice. 22 KBT/J 0.5 1 1.5 2 2.5 3 3.5 4 jhMij=N 0 0.2 0.4 0.6 0.8 1 Figure 14: Absolute value of mean magnetization as a function of KBTC/J. . Since financial series have mean value 0 or close to it (except for financial crises), only T greater than 2.2692 can be used (supercritical regime). The closer we work to the critical temperature the bigger the displacement from mean equal to 0. Results for T=2.5, and 3.5 are presented below. Both time series contain 100000 values, and the Ising system is in equilibrium. The normalization parameter (λin (22)) is different for each time series. It has been chosen in such a way that the range of its price evolution is close to the EURUSD-1HOUR. For T=2.5 λ=100 and for T=3.5 λ=10. Time Steps #104 0 1 2 3 4 5 6 7 8 9 10 rT=2:5(t) #10-3 -5 0 5 Time Steps #104 0 1 2 3 4 5 6 7 8 9 10 rT=3:5(t) -0.02 0 0.02 Figure 15: Top, returns for T=2.5. Bottom, returns for T=3.5. Note that for T=2.5 returns evolve more slowly than for T=3.5 23 Time Steps #104 0 1 2 3 4 5 6 7 8 9 10 PriceT=2:5(t) 0.5 1 1.5 2 Time Steps #104 0 1 2 3 4 5 6 7 8 9 10 PriceT=3:5(t) 0 1 2 Figure 16: Top, price for T=2.5. Bottom, price for T=3.5. In Figures 15 and 16 the time series of returns and prices are shown. It is clear that there are no ”bursts” of volatility (present in Figure 2)) and thus fat tails are not likely to be found. This is confirmed in Figure 17. Also, it is relevant that multi-period returns maintain its Gaussianity, with some deviation in the tails, Figure 18. Furthermore, both time series show the same behaviour for the autocorrelation of absolute returns than for the returns (Figure 19). There is a slight difference though, for T=2.5 both autocorrelations disappear more slowly than for T=3.5. This means that the closer we are to the critical temperature the slower the magnetization (returns) evolves. This corresponds to the well-known critical slowing down phenomenon for the Ising Metropolis algorithm. rN -5 -4 -3 -2 -1 0 1 2 3 4 5 f(rN) 10-5 10-4 10-3 10-2 10-1 100 Figure 17: In red crosses, PDF of normalized returns for T=2.5. In black crosses, PDF of normalized returns for T=3.5. In blue, the associated Gaussian with the same mean and variance. . 24 rN -5 -4 -3 -2 -1 0 1 2 3 4 5 f(rN) 10-5 10-4 10-3 10-2 10-1 100 Figure 18: In red crosses, PDF of normalized multi-period returns for T=2.5. In black crosses, PDF of normalized multi-period returns for T=3.5. In blue, the associated Gaussian with the same mean and variance. . #104 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 AUTOCORRELATION -0.5 0 0.5 1 Time Steps #104 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -0.5 0 0.5 1 Figure 19: Top, T=2.5. In blue, autocorrelation of returns. In red, autocorrelation of absolute returns. Bottom, same for T=3.5. . The scaling property of peaks of the PDF is tested at Figure 20. For T=2.5 a power-law behaviour is indeed observed but with an exponent equal to -1.1. For T=3.5 linear regression yields an exponent of value -0.68 but the lower the value of k, the bigger is the difference between the power-law and the real function of the scaling. 25 is shown for all sets of parameters. There does not seem to exist a clear dependence on the parameters since all functions remain approximately the same. The exponent value of the scaling is approximately -0.70 (-0.703 for black data, -0.707 for orange data and -0.714 for blue data) which is perfectly reasonable for a financial time series. log k 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 log(PDF(r=0)) 3 3.5 4 4.5 5 5.5 6 6.5 7 y = - 0.703*x + 6.46 Figure 29: log(PDF(r=0)) as a function of log(k). In blue, γ= 0.25 and τ= 100. In red, γ= 0.25 and τ= 1000. In black, γ= 0.40 and τ= 1000. In yellow, straight line of slope -0.7. Now we turn to test aggregational Gaussianity. In Figure 30 the PDF of multi-compound returns of k=100 (red crosses) is compared to the PDF of simple returns (for each set of parameters). Not only it is not Gaussian but its tails are heavier than the tails of simple returns. Aggregational Gaussianity is not accomplished by any set of parameters tested. -10 -8 -6 -4 -2 0 2 4 6 8 10 100 k -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 100 -10 -8 -6 -4 -2 0 2 4 6 8 10 100 Figure 30: In blue crosses, PDF of normalized simple returns. In red crosses, PDF of normalized multi-compound returns of k=100. In dark blue, the associated Gaussian distribution. Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. 32 Finally, in Figure 31 multifractality is tested. It is clear that the ratios increase instead of decreasing. Multifractality is not reproduced for any of these sets of parameters. 100101102 100 101 102 100101102 100 101 102 k 100101102 < rk+n;njq> = < jrk+n;nj>q 100 101 102 Figure 31: Ratio <|rk+n,n|q> <|rk+n,n|>qas a function of k, for different values of q: 1.5 (blue), 2 (orange), 2.5 (yellow), 3 (purple). Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. To sum up, Metropolis dynamics combined with the OU algorithm for T represents a substantial progress to the results provided by the constant temperature model. However, there is still room for improvement. 4.2 Wolff Algorithm In the physics context when the Ising model is studied for large networks, the Metropolis algorithm close to their critical points suffers from severe critical slowing down problems. This is due to its single-site updating procedure which tends to diffuse very slowly through the configuration space of the model [26]. Cluster algorithms are very recent in comparison to the Metropolis algorithm. They are characterized by the updating of whole sets of sites, or clusters, at a time, and in doing this they solve the problem of critical slowing down. Basically, they reduce the correlation of the magnetization function close to the critical temperature, what in the context of financial time series would solve the problem that for the OU Metropolis algorithm the correlation of returns was too long (about 500 time steps). In this section we will describe the Wolff algorithm [19] and show that it satisfies conditions (25) and (26). Afterwards, we will use it with the OU algorithm to try to reproduce the remaining stylized facts [27]. The basic idea of the algorithm will be to first built a cluster of sites according to certain rules, and then to flip the whole cluster. The cluster will be built by the “activation” of some of the links between two neighbouring sites, and requires that we classify the links according 33 to whether they connect two sites (i and j) where the spins have the same orientation (l+), or opposite orientations (l−). Taking that into account, the Wolff algorithm is given by the following sequence of steps: 1. Choose (randomly) a single site of the lattice as starting point to build the cluster. 2. Consider all the links connected to that initial site; the l−links won’t be activated; activate the l+links with probability p+= 1 −exp(−2Jσiσj/kBT), possibly forming a first cluster of sites. 3. Given the set of sites added to the cluster in the previous update (which is not the whole cluster), consider all the links that connect those sites to sites that are still outside the cluster; among these, activate the l+links with probability p+, thus enlarging (updating) the cluster. 4. Loop back to step 3 until it does not add new sites to the cluster. 5. Flip the cluster with probability equal to 1. During the cluster construction we keep a list of cluster sites, but also a list containing candidate sites that can still make it grow. Furthermore, note that during construction, a certain site may be approached by the growing cluster from two or more different directions, along different links. If that site does not get linked to the cluster on the first trial, it might still get linked at a later time. The algorithm implies that the same link is never tried more than once for activation, but a single site may be tried more than once if it has more than one link able to be activated. Regarding the way the algorithm works, it is easy to see that condition (25) is fulfilled, since there exists a probability different of zero for the cluster to be formed (and flipped with p=1>0). This means that the algorithm is able to diffuse through the whole space of possible configurations of the field, without leaving out any points or regions within it. Note that no statement is made here about how fast it is able to diffuse. Let us now show that this algorithm satisfies the condition of detailed balance [27]. In order to do this, given a certain cluster, we must calculate the probability that it will be built (since the probability of flipping it is 1). We will denote the cluster by C and the boundary of the cluster, that is, the set of links that connect the cluster with sites outside the cluster, by ∂C. Therefore, we have W({σi} −→ {σ0 i}) = P(C).(37) Now, the probability that a given cluster will be built is the product of the probabilities that each one of its internal links will be activated, times the product of the probabilities that each one of the links of its borders will not be activated and also multiplied by the probability of starting the cluster at site i. Recall that all the internal links are l+links (connect spins with same orientation), so the probability that they will be activated is given by p+. Therefore, its probability is equal to Ql+∈Cp+since each link activation is independent from others. The calculation of the probability of stopping the cluster at ∂C is a bit more difficult since there can be both types of links. If the link is l−then it will become a boundary link with probability=1. On the other hand, if the link is l+then it will become a boundary link with probability=1-p+. Since again all links are independent from each other we have that the probability of creating the boundary is equal to Ql+∈∂C (1 −p+)Ql−∈∂C 1. 34 If we consider all terms together, and being pithe probability of choosing site i (which is 1/N) we obtain: P(C) = piY l+∈C p+Y l+∈∂C (1 −p+).(38) Now, let C’ be the cluster that goes from {σi}to {σ0 i}. P(C0) = piY l+∈C0 p+Y l+∈∂C0 (1 −p+) = piY l+∈C p+Y l+∈∂C0 exp(−2Jσiσj KBT).(39) It has the same internal links, but the links on the boundary that were l+now are l−and vice versa, which also means that the product σiσjchanges its sign. For this reason, Y l+∈∂C0 exp(−Jσiσj KBT) = Y l−∈∂C exp(Jσiσj KBT),(40) Y l+∈∂C exp(−Jσiσj KBT) = Y l−∈∂C0 exp(Jσiσj KBT).(41) Finally, W({σ0 i} −→ {σi}) W({σi} −→ {σ0 i})=Ql+∈∂C0exp(−2Jσiσj KBT) Ql+∈∂C0exp(−2Jσiσj KBT)=Ql+∈∂C0exp(−Jσiσj KBT)Ql+∈∂C exp(−Jσiσj KBT) Ql+∈∂C exp(−Jσiσj KBT)Ql+∈∂C exp(−Jσiσj KBT)= Ql+∈∂C0exp(−Jσiσj KBT)Ql−∈∂C exp(Jσiσj KBT) Ql−∈∂C0exp(Jσiσj KBT)Ql+∈∂C exp(−Jσiσj KBT)=exp(Pl+,l−∈∂C Jσiσj KBT) exp(Pl+,l−∈∂C0 Jσiσj KBT),(42) and, since all the links inside both clusters are the same, the difference in energy of both configurations is directly the difference in energy in the boundary. Thus W({σ0 i} −→ {σi}) W({σi} −→ {σ0 i})= exp(−β(EC−EC0)) (43) which corresponds to the ratio of Boltzmann weights. Detailed balanced is thus demonstrated. Now we are going to apply it combined with the OU process as we did for the Metropolis algorithm. 4.2.1 Ornstein–Uhlenbeck process As we did for the OU Metropolis algorithm the variable kBT/J will follow an Ornstein- Uhlenbeck process. Since for the Wolff algorithm the number of spins of the cluster is likely to vary from one iteration of the algorithm to another, the number of iterations that correspond to a time step again corresponds to δt=1 for the OU algorithm and will be defined as the number of iterations required for the sum of the average number of sites of the clusters (computed at equilibrium) to be equal to N. To do so, the average number of sites per cluster for each value of T (with an 0.01 precision) is previously computed at equilibrium. Then, when T=Ti, we search for the closer T with a tabulated value for the average size of the cluster, and compute round(N/<cluster size >) Wolff iterations. 35 For the Metropolis iteration the evolution of the Temperature was shown for the first 10k iterations. Since for this model the range of evolution of T and the parameters of the OU process will be the same, the same properties of the evolution of T are to be expected. For this reason, in Figure 32 the whole evolution of T is shown. When representing the whole evolution, it is even more clear that for lower τthe system changes much faster. #105 0 1 2 3 4 5 6 7 8 9 10 2.5 3 3.5 4 #105 0 1 2 3 4 5 6 7 8 9 10 2.5 3 3.5 4 Time Steps #105 0 1 2 3 4 5 6 7 8 9 10 T 2.5 3 3.5 4 Figure 32: Temperature evolution. Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. The returns time series, as happened for the OU Metropolis algorithm, shows a larger correlation (duration) of periods with high volatility as τincreases, Figure 33. It is interesting at this point to compare with the real series of returns for EURUSD and notice the substantial similarities. #105 0 1 2 3 4 5 6 7 8 9 10 -0.01 0 0.01 #105 0 1 2 3 4 5 6 7 8 9 10 #10-3 -5 0 5 Time Steps #105 0 1 2 3 4 5 6 7 8 9 10 r(t) #10-3 -5 0 5 Figure 33: Returns time series. Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. Before studying the autocorrelation of the returns and absolute returns, it is important to make sure that fat tails are also reproduced. In Figure 34, the PDF of normalized returns is 36 represented. Heavy tails of exponent |α|=4.28 are observed, without a clear dependence on the τand γ. We recall that a value of 4.2 is found for EURUSD-1HOUR. rN -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 10-6 10-4 10-2 100 Figure 34: PDF of normalized returns. In blue crosses, γ= 0.25 and τ= 100. In red crosses, γ= 0.25 and τ= 1000. In black crosses, γ= 0.40 and τ= 1000. In green crosses, tails with |α|=4.35. In dark blue, the associated Gaussian distribution. As previously stated, the Wolff algorithm has a lesser correlation between the magnetization time series than the Metropolis algorithm, for the same number of updated spins. That is the reason we chose this algorithm, since it should solve the excessively large correlation of returns for the Metropolis algorithm. In Figure 35 the autocorrelation of returns is plotted, and as for EURUSD-1HOUR data, it disappears very fast, after the first time step is almost non existent, for all sets of parameters. Time Steps 0 1 2 3 4 5 6 7 8 9 10 AUTOCORRELATION 0 0.2 0.4 0.6 0.8 1 Figure 35: Autocorrelation of returns. In blue, γ= 0.25 and τ= 100. In red, γ= 0.25 and τ= 1000. In black, γ= 0.40 and τ= 1000. We have solved one of our problems, but does the large autocorrelation of absolute returns remain? From the time series of returns it seems that it does. In Figure 36 this fact is 37 confirmed. Again for larger τand smaller γthe correlation is longer. Thus, we can safely assume that the autocorrelation of returns strongly depends on the dynamics of the Ising model while the autocorrelation of absolute returns strongly depends on the evolution of temperature. Time Steps 0 5000 10000 15000 AUTOCORRELATION 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 36: Autocorrelation of absolute returns. In blue, γ= 0.25 and τ= 100. In red, γ= 0.25 and τ= 1000. In black, γ= 0.40 and τ= 1000. Regarding the scaling property of the peaks of the PDF of multi-compound returns, in Figure 37 it is clear that it follows a power-law behaviour of value -0.50, which is close to the value observed for EURUSD-1HOUR data (-0.57). log k 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 log(PDF(r=0)) 4 4.5 5 5.5 6 6.5 7 y = - 0.501*x + 6.76 Figure 37: log(PDF(r=0)) as a function of log(k). In blue, γ= 0.25 and τ= 100. In red, γ= 0.25 and τ= 1000. In black, γ= 0.40 and τ= 1000. In dark blue, straight line of slope -0.50. Finally, multifractality and aggregational Gaussianity are tested (Figures 38 and 39). Although none of them is properly reproduced by this model, there are slight improvements 38 in relation to the OU Metropolis algorithm. First, the tails of the PDF of normalized multi-compound returns do not become heavier, but remain the same. Regarding multifractality, although the ratio <|rk+n,n|q> <|rk+n,n|>qdoes not decrease, it does not increase either (it remains constant). -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 100 -10 -8 -6 -4 -2 0 2 4 6 8 10 100 rN -10 -8 -6 -4 -2 0 2 4 6 8 10 100 Figure 38: In blue crosses, PDF of normalized simple returns. In red crosses, PDF of normalized multi-compound returns of k=100. In dark blue, the associated Gaussian distribution. Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. 100101102 2 4 k 100101102 <jrk+n;njq> = < jrk+n;nj>q 2 4 6 100101102 2 4 Figure 39: Ratio <|rk+n,n|q> <|rk+n,n|>qas a function of k, for different values of q: 1.5 (blue), 2 (orange), 2.5 (yellow), 3 (purple). Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. Thus, this model (OU Wolff(N sites)) mimicks 4 of the stylized facts of time series of returns. Unfortunately, up until this moment, neither aggregational Gaussianity nor multifractality have been reproduced by any model. 39 4.2.2 Variable Number of Agents for time step. We saw in the previous section that the Wolff algorithm reproduces the same stylized facts (with some improvements specially for the autocorrelation function) as the Metropolis algorithm when the time step is defined such that N sites have renovated its decision of selling or buying. This might not be an accurate definition of the time step since it implies that during a time step the same number of traders decide once again whether to buy or sell. In this section of the project, each value of the time series of returns is taken after 1 cluster is flipped. Thus, the number of sites that take a decision vary every step, what would correspond, in a financial scenario, to some traders not participating. Again, results for the following 3 sets of parameters are shown: γ= 0.25 and τ= 1000, γ= 0.25 and τ= 100, γ= 0.40 and τ= 1000. Each time series consists of 1x106values (time steps). T changes every time step following the OU algorithm and thus, δT is defined as 1. Also, the evolution of temperature is restricted to the interval [2.4,4.4] with T0=3.4. As we have done for the previous models, the time series of returns (not T since it evolves in the same way that for the other models) will be plotted first in order to have a qualitative understanding of some of its properties (Figure 40). #105 0 1 2 3 4 5 6 7 8 9 10 #10-3 -5 0 5 #105 0 1 2 3 4 5 6 7 8 9 10 #10-3 -5 0 5 Time Steps #105 0 1 2 3 4 5 6 7 8 9 10 r(t) #10-3 -5 0 5 Figure 40: Temporal evolution of returns. Top, γ= 0.25 and τ= 100. Middle, γ= 0.25 and τ= 1000. Bottom, γ= 0.40 and τ= 1000. Once again, periods with high volatility are less frequent but last longer when τincreases. Thus, larger correlation of absolute returns is expected. The influence of γon the longevity of these periods is not clear from the time series of returns. In Figure 41, the PDF of returns is plotted. Heavy tails of exponent |α|=4.35 between the ranges [-6,2] and [2,6] are observed. Note that when |rN|>6 the tails lose their power-law behaviour and show signs that they might be better modelled with exponentially truncated power laws. 40 rN -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 10-6 10-4 10-2 100 Figure 41: PDF of normalized returns. In blue crosses, γ= 0.25 and τ= 100. In red crosses, γ= 0.25 and τ= 1000. In black crosses, γ= 0.40 and τ= 1000. In green crosses, tails with |α|=4.35. In dark blue, the associated Gaussian distribution. The next stylized fact under study is the autocorrelation of returns and absolute returns. In Figure 42 the autocorrelation function of returns is shown. A slightly larger correlation of returns in relation to the OU Wolff(N sites)/Metropolis models is observed. That is to be expected since now each value of the time series is separated by less than N iterations of the Metropolis algorithm. Time Steps 0 200 400 600 800 1000 1200 1400 1600 1800 2000 AUTOCORRELATION 0 0.2 0.4 0.6 0.8 1 Figure 42: Autocorrelation of returns. In blue, γ= 0.25 and τ= 100. In red, γ= 0.25 and τ= 1000. In black, γ= 0.40 and τ= 1000. In Figure 43 the autocorrelation of absolute returns is shown. Again, as τincreases and γ decreases, a longer correlation is observed, but it disappears slightly more rapidly than for OU Metropolis. Therefore, for the same set of parameters, the stylized facts regarding the autocorrelation of returns and absolute returns are deteriorated for this model. 41 rN -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 10-6 10-4 10-2 100 Figure 51: In orange crosses, PDF of normalized returns. In blue, the associated Gaussian distribution. Regarding the autocorrelation function of returns and absolute returns, the model perfectly reproduces the stylized facts (Figure 52). Time Steps #104 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 AUTOCORRELATION 0 0.2 0.4 0.6 0.8 1 Figure 52: In orange, autocorrelation function of absolute returns. In blue, autocorrelation function of returns. The scaling property of peaks is also reproduced by this model, with a power-law exponent of -0.48, Figure 53. The multifractality test yields decreasing ratios although not with the exact same curvature, Figure 54. 48 log k 0 1 2 3 4 5 6 log(PDF(r=0)) 3.5 4 4.5 5 5.5 6 6.5 7 y = - 0.484*x + 6.55 Figure 53: In blue crosses, logarithm of the peaks of the PDF for multi-compound returns as a function of log k. In red, a straight line with slope -0.47. k 100101102 <jrk+n;njq> = < jrk+n;nj>q 100 101 Figure 54: Ratio <|rk+n,n|q> <|rk+n,n|>qas a function of k, for different values of q: 1.5 (blue), 2 (orange), 2.5 (yellow), 3 (purple). rN -10 -8 -6 -4 -2 0 2 4 6 8 10 PDF(rN) 10-6 10-4 10-2 100 Figure 55: In blue crosses, PDF of normalized simple returns. In red crosses, PDF of normalized multi-compound returns of k=100. In dark blue, the associated Gaussian distribution. 49 Finally, the aggregational Gaussianity property of the PDF of multi-compound returns is plotted in Figure 55, as for the OU Metropolis and OU Wolff(N sites) this phenomenon is not fully reproduced. From the results, it seems reasonable to assume the returns obtained from the dynamical Ising model with coupling dynamics following an Ornstein-Uhlenbeck process behaves as a random variable with Gaussian conditional probability density function with time varying variance (according to an Ornstein-Uhlenbeck process). It is surprising that such a simple model (developed from the mean field approximation although with the insight obtained from the previous simulations) is able to reproduce qualitatively almost all the stylized facts. For this reason, we think that by modifying a bit the conditional PDF we could even improve the quantitative behaviour of these properties. 50 5 Conclusions and Future Research From the results obtained, it is clear that the capability for the Ising model to mimick financial markets strongly depends on the dynamics of the coupling. When this coupling follows an Ornstein-Uhlenbeck process, most of the stylized facts of the time series of returns are reproduced. Furthermore, each stylized facts seems to be strongly related with a parameter of the model. First, the range of evolution of T modifies the behaviour of the tails of the PDF. The reason behind this dependence is that for temperatures close to TC, higher variations in the magnetization of the system (and thus larger returns) are more probable than for bigger T. Thus, when the coupling varies within a certain range, the probability of obtaining a certain value M for the magnetization, computed as P(M) = X T∈[T0−a,T0+a] P(T)P(M|T),(61) increases. Secondly, the autocorrelation of returns strongly depends on the dynamics of the Ising model, as observed when we compare its behaviour for the Metropolis algorithm and the Wolff algorithm. Additionally, the autocorrelation of absolute returns is mainly governed to the chosen Temperature evolution. In particular, for the Ornstein-Uhlenbeck process, a larger autocorrelation of absolute returns is found when γdecreases and τincreases. Finally, aggregational Gaussianity and multifractality seem to be conditioned to the variability in the number of Agents in the model renovating its decision per time step. That could be due to the system not being able to reach equilibrium, but further studies have to be done. We have also developed a simpler stochastic process that allows us to understand how the Ising model with stochastic dynamics for the coupling works. From what we observed, for these model, the returns behave as a random variable with conditional Gaussian PDF (PDF(r|T)) characterized by 0 mean and a variance that depends on the Temperature. Regarding future developments to our research, there exist multiple possibilities. First, other stochastic processes for the coupling, like the Random Telegraph, could be used. For this model, the Temperature increases or decreases ∆ with previously defined probabilities. Besides, a more complex model involving personal preferences or the effect of news (by including a non-homogeneous magnetic field or a random term different for each agent) could be implemented for the Wolff dynamics. 51 References [1] R. Mantegna; E. Stanley. An introduction to Econophysics correlations and complexity in finance, (Cambridge University Press, Cambridge, England, 1999). [2] A. Chakraborti; I. Toke; M. Patriarca; F. Abergel. Econophysics Review: I. Empirical facts., Quantitative Finance 11:7, 991-1012 (2011). [3] N. Kaldor. Capital accumulation and economic growth. The Theory of Capital, Macmillan, London (1961). [4] T. Kaizoji; S. Bornholdt; Y. Fujiwara. Dynamics of price and trading volume in a spin model of stock markets with heterogeneous agents. Physica A 316, 441-452 (2002). [5] T. Kaizoji. Speculative bubbles and crashes in stock markets: an interacting-agent model of speculative activity. Physica A 287, 493-506 (2000). [6] A. Krawiecki; J. A. Holyst; D. Helbing. Volatility clustering and scaling for financial time series due to attractor bubbling. Phys.Rev. Lett. 89, 158701 (2002). [7] S. Bornholdt. Expectation bubbles in a spin model of market intermittency from frustration across scales. International Journal of Modern Physics C 12 (5), 667-674 (2001). [8] J.P. Bouchaud; M. Potters. Theorie des Risques Financiers. (Cambridge University Press, Cambridge, England, 2003) [9] D. Chowdhury; D. Staufferb. A generalized spin model of financial markets. Eur. Phys. J. B 8, 477–482 (1999) [10] R. Cont; J.P. Bouchaud. Herd behaviour and aggregate fluctuations in financial markets. Macroeconomic Dynamics 4, 170–196 (2000). [11] Y. Malevergne; V. Pisarenko; D. Sornette. Empirical Distributions of Stock Returns: between the Stretched Exponential and the Power Law? Quantitative Finance 5(4), 379- 401 (2005) [12] M. Allen; D. Tisley. Computer simulation of liquids, appendix d.3.. (Oxford Science Publications,England,1987). [13] W. Press; S. Teukolsky; W. Vetterling; B. Flannery. Numerical Recipes in Fortran 77: The art of scientific computing.(Cambridge University Press, Cambridge, England, 1986). [14] T. Andersen; T. Bollerslev. Intraday periodicity and volatility persistence in financial markets. Journal of Empirical Finance 4, 115-158 (1997). [15] R. Mantegna; E. Stanley. Scaling behaviour in the dynamics of an economic index. Nature 376, 46-49 (1995). [16] D. Parisi; D. Sornette; D. Helbing. Financial price dynamics and pedestrian counterflows: A comparison of statistical stylized facts. Physical Review E87, 012804 (2013). [17] D. Sornette. Physics and Financial Economics (1776-2014): Puzzles, Ising and Agent- Based models. Rep. Prog. Phys. 77, 062001 (2014). 52 [18] J.P. Bouchaud. Crises and collective socio-economic phenomena: simple models and challenges. Journal of Statistical Physics 151, 567–606,(2013). [19] U. Wolff. Collective Monte Carlo updating for spin systems. Phys. Rev. Lett. 62, 361 (1989) [20] N. Metropolis; A. Rosenbluth; M. Rosenbluth; A. Teller; E. Teller. Equation of state calculations by fast computing machines. J. Chem. Phys. 21, 1087 (1953) [21] W. Janke. Monte Carlo Methods in Classical Statistical Physics.Lecture Notes in Physics 739, 79-140 (2008). [22] G. Harras; C. Tessone; D. Sornette. Noise-Induced volatility of collective dynamics. Physical Review E85, 011150 (2012). [23] K. Binder; D. Heermann. Monte Carlo Simulations in Statistical Physics: An Introduction. (Springer, 2010). [24] A. Longtin. Stochastic dynamical systems. Scholarpedia, 5(4):1619 (2010). [25] M. Allen; D. Tisley. Computer simulation of liquids.(Oxford Science Publications,England,1987). [26] W.Krauth. Cluster Monte Carlo algorithms in n New Optimization Algorithms in Physics. (Wiley-VCH Verlag GmbH & Co. KGaA, Weinheim, FRG, 2005) [27] J. de Lyra. The Wolff Algorithm with External Sources and Boundaries. (http://latt.if.usp.br/technical-pages/twawesab/Text.html/, 2006) [28] H.Gould; J. Tobochnik; W. Christian. An Introduction to Computer Simulation Methods. (Princeton University Press, Princeton, USA, 2010). [29] W.X. Zhou; D. Sornette. Self-organizing Ising model of financial markets. Eur. Phys. J. B55, 175–181 (2007). 53