10

Click here to load reader

An adaptive stochastic model for financial markets

Embed Size (px)

Citation preview

Page 1: An adaptive stochastic model for financial markets

Chaos, Solitons & Fractals 45 (2012) 899–908

Contents lists available at SciVerse ScienceDirect

Chaos, Solitons & FractalsNonlinear Science, and Nonequilibrium and Complex Phenomena

journal homepage: www.elsevier .com/locate /chaos

An adaptive stochastic model for financial markets

Juan Antonio Hernández ⇑, Rosa Marı́a Benito, Juan Carlos LosadaGrupo de Sistemas Complejos, ETSI Agrónomos, Universidad Politécnica de Madrid Ciudad Universitaria s/n, Madrid 28040, Spain

a r t i c l e i n f o

Article history:Received 16 November 2011Accepted 9 March 2012Available online 5 April 2012

0960-0779/$ - see front matter � 2012 Elsevier Ltdhttp://dx.doi.org/10.1016/j.chaos.2012.03.005

⇑ Corresponding author.E-mail addresses: jantonio.hernandez@iberbanda

[email protected] (R.M. Benito), juanc(J.C. Losada).

a b s t r a c t

An adaptive stochastic model is introduced to simulate the behavior of real asset markets.The model adapts itself by changing its parameters automatically on the basis of the recenthistorical data. The basic idea underlying the model is that a random variable uniformlydistributed within an interval with variable extremes can replicate the histograms of assetreturns. These extremes are calculated according to the arrival of new market information.This adaptive model is applied to the daily returns of three well-known indices: Ibex35,Dow Jones and Nikkei, for three complete years. The model reproduces the histograms ofthe studied indices as well as their autocorrelation structures. It produces the same fat tailsand the same power laws, with exactly the same exponents, as in the real indices. In addi-tion, the model shows a great adaptation capability, anticipating the volatility evolutionand showing the same volatility clusters observed in the assets. This approach providesa novel way to model asset markets with internal dynamics which changes quickly withtime, making it impossible to define a fixed model to fit the empirical observations.

� 2012 Elsevier Ltd. All rights reserved.

1. Introduction

A huge number of works aimed at describing the finan-cial market dynamics have been presented over the lastdecades. Although many models have been proposed,using different approaches, they usually can only repro-duce a subsample of the characteristics observed in realmarket. The complexity of market dynamics has led thescientific community to divide the problem into severallines of research, such as the study of the probability distri-bution of the asset returns or the mechanisms governingwhy such returns show certain autocorrelations. Hence,many aspects of financial markets remain undiscoveredand new models should be proposed in order to completeits understanding.

From a statistical point of view, several probability dis-tributions have been introduced as candidates to fit the as-set returns histograms of financial markets: Lévy [1],Normal Inverse Gaussian [2] and KR [3] distributions

. All rights reserved.

.es (J.A. Hernández),[email protected]

among others. Besides that, other probability distributionshave been proposed for internal processes related to priceformation which might induce the heavy tailed distribu-tions of asset returns. Such is the case of the student distri-bution assigned to the order placement process in theorder book [4,5]. An important problem arises when tryinga theoretical probability distribution to fit with an asset re-turns histogram, since the latter usually shows fat tailsallocating excessive probability to large returns. This mis-match with the theoretical tails led to one of the most ac-tive lines of research: the search for more suitabledistributions and the underlying mechanisms which in-duce those empirical large tails [6,7]. In this direction animportant conclusion is that the empirical histogramsseem to be described by power laws with very similarexponents for different types of markets [8,9].

On the other hand there are additional facts which can-not be explained from a statistical point of view. While theAutocorrelation Function of returns decays rapidly withtime, the Autocorrelation Function of absolute returns re-mains significant indicating positive autocorrelation [7],which has been related to another well-known effect:volatility clustering [7,10]. It consists in bursts of highvolatility located within precise time intervals, diverging

Page 2: An adaptive stochastic model for financial markets

900 J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908

considerably from the average behavior. Volatility clustersare a typical characteristic of financial markets.

Many models, with different approaches, have beenproposed with the aim of reproducing some of the previouscharacteristics in order to identify the basic precursormechanisms for them. Next, a general review of the mostimportant kinds of models is shown.

A relevant group of models is the so-called ‘‘Agent mod-els’’, which attempt to explain a financial market as anaggregation of single agents, or clusters of agents, with spe-cific roles assigned. Every role would be a basic investmentbehavior. A good overview of agent models can be found in[11]. While belonging to the same group, a variety of differ-ent models have been introduced, depending on the rolesassigned to the involved agents [12–14]. Some of theseworks are focused on how an agent-based model can repro-duce some real market characteristics [15,16]. It is worthmentioning the so-called ‘‘herd behavior’’ i.e. of the appear-ance of imitation patterns among the investors whichmight be responsible for the observed autocorrelation insome periods of an asset evolution [17–19]. Although herdbehavior is usually related to agent-based models othertypes of models may incorporate this concept.

The order-book models form another active line of re-search. The order-book, in a rough view, is a computingsystem which gathers all the incoming sell and buy limitorders, placing them along a price axis according to theirprice targets. Along with these limit orders, market andcancellation orders are already introduced in the book.The former consist in orders to be matched with the bestprice at the moment, while the latter are cancellations ofprevious limit orders. The interactions among all these or-ders constitute the basic dynamics of price formation.Thereby the models of the order-book aim to capture theessence of how the price of an asset is built [4,20–22].

Modeling by means of stochastic processes is a naturalapproach, since the asset returns evolution seems to be arandom result of the combination of the decisions of manythousands of investors. Several works have introduced sto-chastic models [23,24]. As commented previously, somephenomena related to autocorrelation have been found infinancial markets. Hence, a pure stochastic process withoutinducing any degree of autocorrelation would not be real-istic enough. So, these stochastic models are usually testedon whether they reproduce those phenomena of the realmarkets.

In addition to those models grouped together in theprevious paragraphs, other approaches have been pro-posed such as the ‘‘microscopic spin model’’ [25] or modelsbased on the ‘‘quantum field theory’’ [26], among others.

This work introduces an adaptive stochastic modelwhich can change its parameters endogenously by usingthe recent historical data, in order to assimilate the newinformation incorporated in an asset market. The basicidea underlying the model is that the multiplication oftwo different uniform probability distributions can repli-cate any empirical histogram when the parameters of bothdistributions are fitted appropriately. The idea of this mul-tiplication of two uniform distributions resulted from ageneral Dynamics of Resource Density which is also pre-sented in this work.

In one sense, the Dynamics of Resource Density is amacroscopic view of the order-book state over a timeinterval, after aggregating all the single orders receivedalong such an interval. However, it is not a microscopicview of how the processes interact in the order-book, buta sequence of macroscopic equivalent states resulted fromthe combination of the microscopic processes. So, theDynamics of Resource Density is not an order-book model,but a high level model of the evolution of supply anddemand.

The first goal of this work is to demonstrate that a gen-eral simulator of probability distributions is derived from ageneric Dynamics of Resource Density, consisting in themultiplication of two uniform distributions with parame-ters depending on the specific system under study. Thesecond goal is to build an adaptive stochastic process withthe previous simulator, fitting automatically its parametersaccording to the historical evolution of the asset.

This model is applied in the paper to three well-knownindices: the Spanish Ibex35, the American Dow Jones andthe Japanese Nikkei, thereby covering European, Americanand Asian markets. The time series used are the daily re-turns of every index from 2008 to 2010. It is found thatthe histograms produced by the model and the real onesare really close, showing the same fat tails and power laws.Moreover, the model replicates correctly the real autocor-relation structure and volatility clustering.

The work is organized as follows. The Dynamics of Re-source Density is presented in Section 2, introducing thedynamics itself and obtaining a general probability simula-tor, based on the multiplication of two uniform distribu-tions. In the same section it is demonstrated that theprevious multiplication is equivalent to only one uniformdistribution defined in an interval with random limits.The adaptive stochastic model is introduced in Section 3.Applications of the model to Ibex35, Dow Jones and Nikkeiindices are shown in Section 4. Finally, the conclusions ofthe work are summarized in Section 5.

2. Dynamics of Resource Density

The dynamics of a distributed resource with borderconstraints, affected by an external demand, is studiedin this section. This is a specific case of the most generalsituation in which a distributed resource evolves whenexternal demands can take place in any part of its distri-bution. An example of the general case is a predator feed-ing on a specimen in an ecosystem. Here, the resourcedensity is the distribution of the specimen within the eco-system, that is a function of two or three dimensions,depending of the ecosystem in question. The external de-mand is the predator’s need for feeding, inducing a re-source consumption within the whole surface or volumeof the ecosystem. In this example there is not any kindof constraint, since the resource can be consumed inany part of the ecosystem. On the other hand, the growthprocesses can be represented as resource densities withborder constraints. For example, the tumoral growth ina patient is a process in which the tumoral cells, belong-ing to the border of the tumor, demand space in the

Page 3: An adaptive stochastic model for financial markets

Fig. 1. Resource density evolution. Basic process for the time interval[kdt, (k + 1)dt].

J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908 901

surrounding healthy area in order to continue with thegrowing process. Thereby this process is in fact a compe-tition between healthy and tumoral cells for space [27]. Inthis example the resource density is the volumetric den-sity of surrounding space and the external demand isthe need for space in the tumoral surface. It is clear that,in this case, there is a constraint since the resource(space) is only consumed in the border of the resourcedistribution.

It will be seen in subsequent sections that the evolutionof the price of a financial asset can be described as thedynamics of a linear resource density with a border con-straint, being the price of the asset the boundary of thedensity. In this section, a general study of the dynamicsof a linear density with a border constraint is carried outwithout any reference to financial markets. The applicationof the obtained results to financial markets is done in Sec-tion 3.1.

2.1. General dynamics of a linear resource density with aborder constraint

Let us consider a generic resource distributed along aone-dimensional variable x. This resource is distributedaccording to a linear density

qtðxÞ ¼dmtðxÞ

dx; ð1Þ

which is a function of time, being mt(x) the quantity of re-source allocated in x for time t. This density has a boundaryin x0 in such a way that qt(x) = 0 if x < x0 and qt(x) – 0 ifx P x0. Let us consider now an incoming demand for thisresource which starts consuming from the boundary x0.Hence, as the resource is consumed the boundary movesin the increasing direction of the variable x until all the de-mand has been satisfied, setting the new boundary inx1 > x0. Afterwards, the dynamics of qt(x) continues modi-fying the resource allocation along the axis while newquantities of demand come into the system. So, the evolu-tion of the boundary xt is resulted from the interaction be-tween two processes: the dynamics of qt(x) as a generatorof the distributed resource and the incoming demandwhich consumes that resource starting always from thecurrent boundary xt.

The evolution of the boundary within a short time inter-val [kdt, (k + 1)dt] is described by the next ‘‘Resource Den-sity Law’’:

Ak ¼Z xkþ1

x�k

q�kðxÞdx ð2Þ

where q�kðxÞ and x�k are respectively the density and theboundary just at the beginning of the interval, while Ak isthe incoming demand within the same interval. So, the un-known quantity is xk+1 which is the position of the bound-ary once the incoming demand Ak has interacted with theinitial conditions q�kðxÞ; x�k

� �.

When applying Eq. (2) to successive time intervals adiscrete time evolution of the boundary: xt = xdt, . . . , xNdt

is obtained. The process can be visualized as a series of dis-crete steps:

1. The density dynamics originates q�kðxÞ at t = kdt withboundary in x�k.

2. The density dynamics remains ‘‘frozen’’ within dt, whilethe incoming demand along the time interval consumesresource in the increasing direction of the axis, begin-ning in x�k and ending in xk+1.

3. The density dynamics acts again making the distribu-tion evolve until reaching a new state q�kþ1ðxÞ, movingthe boundary from xk+1 to x�kþ1.

The process is shown in Fig. 1. Notice that the resourcegeneration and the resource consumption do not takeplace at the same time, but the former acts at the begin-ning of the time interval whereas the latter does it alongthe whole interval. A second consideration is that whendensity dynamics acts again, at the beginning of the nexttime interval, the boundary is shifted from xk+1 to x�kþ1,which means that the final boundary in [kdt, (k + 1)dt] cannot be taken as the initial boundary in [(k + 1)dt, (k + 2)dt].Although in a real process both, generation and consump-tion take place at the same time, it will be shown in nextsections that this simplification of short time intervalswith all the generation concentrated at the beginning ofthe interval leads to results compatible with those of thereal systems.

2.2. A special case. Constant density

Once the processes q�t ðxÞ and At, which are specific of thesystem under consideration, are known, the evolution ofthe boundary xt can be described by Eq. (2). In order to de-fine these processes, let us consider the evolution of theboundary xt = x1, x2, . . . , xN, along the time periods [0,dt],[dt,2dt], . . . , [(N � 1)dt,Ndt]. The resource densities involvedin the whole period [0,Ndt] are qt ¼ q�0ðxÞ;q�1ðxÞ; . . . ;

q�N�1ðxÞ, which are the ones formed just at the beginningof every single period. According to Eq. (2) only the densityarea between x�k and xk+1 plays a role. Let us consider now anaveraged constant density qa

0 gathering the effect of all thesingle density pieces involved in the time period [0,Ndt]. Byapplying Eq. (2) to this averaged density within the interval[0,Ndt] a handy expression is obtained

Page 4: An adaptive stochastic model for financial markets

Fig. 2. Scheme of the external and internal demands in a dynamics of alinear resource density. (a) Working in opposite directions. (b) Working inthe same direction.

902 J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908

xN � x�0 ¼A0

qa0; ð3Þ

where xN is the boundary at the end of the period [0,Ndt],x�0 the boundary just at the beginning of the same period,A0 the incoming demand for resources and qa

0 the averageddensity which summarize the effect of the real densitydynamics of the process. Notice, as already commentedfor the general dynamics of single periods, that xN is theboundary at the end of its period, but is not the one atthe beginning of the next period, since a new density q�Nwill be reconfigured with a new boundary x�N .

The generalization of Eq. (3) for an arbitrary time step s

xkþ1 � x�k ¼Ak

qak

ð4Þ

is applicable over the ‘‘macroscopic’’ time interval[ks, (k + 1)s].

From Eq. (4) follows

xkþ1 � ðxk þ �kÞ ¼Ak

qak

ð5Þ

where �k is the evolution of the boundary from xk to x�k int = ks. Let us call �k ‘‘border effect’’. Notice that �k can bepositive or negative, since the resource distribution mayreorganize itself moving to either the positive or the nega-tive directions of the axis.

Once Eq. (5) is reorganized the final law is

Dxk ¼bAk

qak

ð6Þ

being Dxk = xk+1 � xk and bAk ¼ Ak þ qak�k.

Let us call bAk ‘‘Compound Demand’’ since it is equiva-lent to a mixed demand for resource, consisting of Ak andqa

k�k, which are the external and internal demands respec-tively. The latter is fictitious and generated internally bythe resource dynamics since both, qa

k and �k, are parame-ters related to the evolution of the resource distribution.qa

k�k corresponds to an area in the distribution equivalentto the external demand needed to move the boundary fromxk to x�k. Notice that this quantity may be positive ornegative, acting for or against the external demand,respectively.

Fig. 2 shows that qak�k can be considered as an addi-

tional demand in a scenario with a static resource distribu-tion. This quantity can be either positive or negative,contrary to Ak which is always positive, thereby externaland internal demands can add or counteract their effects.This idea, of translating the internal dynamics of the re-source distribution into an equivalent external demandfor the distribution itself, may seem a little bit strange,but it allows to reduce a system with an internal dynamicsaffected by an external force to two different forces actingagainst a static resource distribution.

2.3. A generic simulator of probability distributions

Although Eq. (6) provides a simple and clear relationamong the variables involved in the evolution of a resourcedistribution interacting with an external demand, suchrelation is still more qualitative than quantitative.

For practical purposes both bAk and 1=qak are proposed to

be random variables distributed according to an uniformprobability distribution, defined within the intervals½bAm; bAM� and [1/qM,1/qm] respectively, where ‘‘m’’ indicatesthe minimum possible value of the variable and ‘‘M’’ themaximum one. According to this definition, Dxk becomesa random variable in Eq. (6), resulted from the multiplica-tion of two random variables uniformly distributed wherebAk 2 ½bAm; bAM � and 1=qa

k 2 ½1=qM ;1=qm�.It will be shown in next sections that the multiplica-

tion of two random variables uniformly distributed is ageneric simulator of empirical histograms, when the lim-its of the intervals are fitted appropriately. Notice thatthis multiplication of two uniform variables with staticintervals is equivalent to a unique variable distributeduniformly within an interval with random extremes.Once the variable bAk takes a value, let us say f, the var-iable Dxk will be distributed uniformly within the inter-val [f/qM,f/qm]. On the other hand, if 1=qa

k takes thevalue u the variable Dxk will be distributed uniformlywithin ½ubAm;ubAM �. Hence, Eq. (6) becomes the followingexpression

Dxk ¼ hk ð7Þ

where hk 2 ½bAk=qM ; bAk=qm� or bAm=qak;bAM=qa

k

h iwhich are

equivalent intervals with random extremes.

Page 5: An adaptive stochastic model for financial markets

J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908 903

3. Adaptive stochastic model

3.1. Dynamics of resource density applied to asset markets

The equivalence between the dynamics of a resourcedensity and the one of an asset market is really intuitive:the resource density qk(x) is the available volume of the as-set distributed within a logarithmic price axis x, accordingto the sellers expectations, and the incoming demand Ak isthe volume of buyers wanting to acquire an asset at thecurrent price. In other words, while qk(x) is the distributionof the supply of an asset along the price axis Ak is the de-mand of that asset at the current market price. Hence,the left boundary of the density is the current price sincethe flow of buyers always buy at the cheapest availableprice. This is why the incoming demand Ak always startsconsuming the resource from the boundary, starting atthe best offered price and continuing in the increasingdirection of the price axis (border constraint).

According to the study carried out in Section 2, the formof the real asset density qk is substituted with an averagedensity qa

k. The combination of such average density withthe demand Ak is finally described as a random variablehk in Eq. (7). According to this equation, and taking into ac-count that Dx is the return in a logarithmic price axis, thereturn of an asset would be described by a random variableuniformly distributed within an interval with variableextremes.

3.2. Relationship between the resource density and the realdensities in the order book

The real price formation takes place in the order book asa result of the interaction between two different densities,the buyer and seller ones. The dynamics in the boundarybetween both densities determines the price. Many effortshave been done to find out the real form of those densitiesand their dynamics [4,5]. While the model proposed in thiswork only takes into account one density, the seller oneqk(x), the incoming demand Ak can be considered as thepart of the buyer density which plays a role in k. So in asense, the model is also considering two densities,although only the one belonging to the resource (asset)distribution is visualized as a density. Hence, the modelintroduces a model of supply and demand instead of amodel of order book.

In any case, the model does not try to set the real formof the asset distribution, since the part of such distributionwhich is involved in the price formation in k is combinedwith the current demand in order to be substituted witha random variable, according to Eq. (7). Thereby, the modeldoes not manage real densities, but it measures the effectof the interaction between them.

3.3. An adaptive model

The evolution of an asset return in terms of a stochasticprocess of uniform random variables defined within aninterval with variable extremes can be described by Eq.(7). These extremes depend on specific parameters of the

system under study: the maximum and minimum valuesof bAk and qa

k. The approach to be followed in this work isthe calculation of the interval extremes by using the recenthistorical data of the asset evolution, instead of trying toevaluate the internal parameters of the system.

Let us consider the evolution of an asset return rk = r1,r2, . . . , rN and its moving average mh(rk), calculated withthe last h returns {rk�(h�1), . . . ,rk}. The interval in which isdefined every random variable hk from Eq. (7) is

hk 2 ½mhðrkÞ � cr̂k;mhðrkÞ þ cr̂k� ð8Þ

where r̂k is the estimate of the asset volatility in k, and c isa scale factor. The volatility is estimated as follows

r̂k ¼ rLker̂r

k ð9Þ

where rLk is the typical deviation in k, calculated with the

last L values of the asset returns {rk�(L�1), . . . ,rk}, and r̂rk is

the averaged volatility return in k:

r̂rk ¼ mh rr

k

� �ð10Þ

being mh rrk

� �the moving average of the volatility returns,

where the volatility has been calculated with the last L val-ues of the asset returns.

Finally, the evolution of the asset returns is described bythe following stochastic process

rk ¼ hk ð11Þ

where hk is a set of random variables uniformly distributedin the intervals given in (8).

Notice that rk was defined as lnxk+1 � lnxk, so the inter-val in t = k is built with the data available in t = k and deter-mines the simulation of the price in t = k + 1.

4. Application to real markets

In this section the adaptive stochastic process definedby Eqs. (11) and (8), with parameters c, h and L, is appliedto three well-known indices: the American Dow Jones, theJapanese Nikkei and the Spanish Ibex35. The historical datato be tested correspond to the daily returns for three com-plete years: 2008–2010.

The parameters of the model, L and h, define theamount of historical values to be taken into account, andc is a scale parameter. According to this, the same modelwith identical parameters, builds different intervals of def-inition since the historical data of each asset are com-pletely different.

According to Eq. (11), the interval of definition of hk isbuilt with the available information in t = k in order to sim-ulate the next return rk = lnxk+1 � lnxk. Once the intervalhas been fixed, the uniform random variable hk can gener-ate as many executions of the model as needed to be com-pared with the real value of the asset in k + 1.

4.1. Adjustment of the parameters of the model anddistribution of returns

The distribution of returns belonging to the real indicesare compared with those produced by the model by usingthe Shannon entropy or information [28]. The possible val-

Page 6: An adaptive stochastic model for financial markets

Fig. 3. Absolute error of the Shannon entropy as a function of theparameter c.

Fig. 4. Absolute error of the Shannon entropy as a function of theparameter h.

Fig. 5. Absolute error of the Shannon entropy as a function of theparameter L.

Fig. 6. Comparison of cumulative probability distributions of returns(top) and Information (bottom) for Ibex35 and three executions of thecorresponding adaptive model.

Fig. 7. The same as Fig. 6 for index Dow Jones.

904 J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908

ues of the variable return rk are divided into N subdivisionsin order to obtain a discrete variable with values{x1, . . . ,xN}. The information of the event rk = xi is

HðxiÞ ¼ �log2ðpðxiÞÞ ð12Þwhere p(xi) is the probability of rk = xi.

The average entropy, H, is given by

H ¼ �PNi¼1

pðxiÞlog2ðpðxiÞÞ ð13Þ

In order to get a measure of the entropy of the index wecomputed H for the real returns rk of the index by using Eq.(13). On the other hand Hj

model correspond to the computa-tion of H for a single execution of the process given by Eq.(11). Finally, Hmodel is calculated by averaging Hj

model overthousands of process executions

Page 7: An adaptive stochastic model for financial markets

Fig. 8. The same as Fig. 6 for index Nikkei.

Fig. 9. Power laws in the probability distributions of absolute returns.Comparison of the results of the indices (black dots): Ibex35 (a), DowJones (b) and Nikkei (c) with those of their corresponding adaptivemodels (blue dots). (For interpretation of the references to colour in thisfigure legend, the reader is referred to the web version of this article.)

J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908 905

Hmodel ¼PM

j¼1Hjmodel

Mð14Þ

where M is the number of model executions.The absolute error of the averaged entropy � = jHindex �

Hmodelj provides a measure of how close both distributionsare.

The values of the parameters of the model are adjustedto minimize this error, using a partition with N = 60 in Eq.(13) and setting M = 2000 in Eq. (14). We have found thatthe parameter which leads to larger variations in the abso-lute error is c, hence we proceed to first adjust this scaleparameter, letting h and L take values randomly withinthe intervals [1,10] and [2,10], respectively.

The absolute error as a function of c is shown in Fig. 3. Itcan be seen that there is a clear minimum in 1.5 for all theindices. These minimum in c is found independently fromthe values of h and L since they have been randomly cho-sen for each single model execution. Therefore, the scaleparameter is set to c = 1.5 for all the indices.

Once adjusted the scale parameter we proceed to adjustthe parameter h, letting L take again random values within[2,10]. Fig. 4 shows that there are minima in h = 7, h = 7and h = 5 for Ibex35, Dow Jones and Nikkei respectively.So, h is set to the corresponding minimum for each indexfrom now forth.

Finally, the adjustment of the parameter L is carried outby calculating the absolute error as function of L, once theprevious parameters c and h have been set for each index.It can be seen in Fig. 5 that the optimal values are reachedin L = 5, L = 4 and L = 5 for Ibex35, Dow Jones and Nikkei,respectively.

Hence, the final models are Ibex35 (c = 1.5, h = 7, L = 5),Dow Jones (c = 1.5, h = 7, L = 4) and Nikkei (c = 1.5, h = 5,L = 5). However, notice that a unique model could havebeen chosen for the whole indices with values (c = 1.5,h = 6, L = 4), since these values produce the same absoluteerror in all the cases and are set very close to the minimumof every single index. In any case, from now forth, all thesimulations of the models are carried out with the valueswhich optimize every single asset.

Now the probability distributions of returns produced bythe models, with their parameters adjusted according to theprevious paragraphs, are compared with those produced by

the real indices. The top panels in Figs. 6–8 show the cumu-lative distributions of the index and three model execu-tions. The bottom ones show the information H(xi) (Eq.(12)) for the index and the model executions. It can be seenthat the executions of the models fit accurately both, thecumulative probability and the information distributions.

The absolute error of the averaged entropy � = jHindex �Hmodelj indicates how close both distributions are. This

Page 8: An adaptive stochastic model for financial markets

Fig. 10. Fat tails in the cumulative probability distributions of absolutenormalized returns. Comparison of the fat tails in Ibex35 (a), Dow Jones(b) and Nikkei (c) with those of their corresponding adaptive models andstandard normal distribution.

Fig. 11. Autocorrelation Function of Ibex35 (blue line) and the simulationresults of its adaptive model (red line). Normalized returns (top).Absolute normalized returns (bottom). (For interpretation of the refer-ences to colour in this figure legend, the reader is referred to the webversion of this article.)

Fig. 12. The same as Fig. 11 for Dow Jones.

Fig. 13. The same as Fig. 11 for Nikkei.

906 J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908

error is very small, 0.03 for all cases, indicating that themodel produces distributions really close to the real ones.

Page 9: An adaptive stochastic model for financial markets

J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908 907

4.2. Power laws

In order to find out whether the probability of absolutereturns can be written as a power law, p(jrj) = jrja, it hasbeen depicted ln(p(jrj)) as a function of ln(jrj) in Fig. 9, forthe indices under study and their corresponding adaptivemodels. It can be seen that real markets show power lawsof their absolute returns and that their models fit very wellthose power laws, with exponents �2.2, �2.2 and �2.1 forIbex35, Dow Jones and Nikkei, respectively.

These results are in good agreement with previousstudies which have already found power laws in financialmarkets [8,9].

4.3. Fat tails

As already commented in Section 1, an important char-acteristic of the returns histograms is that they show fattails, which indicates that large returns have a considerableprobability of appearance. The search for the underlyingmechanisms which induce those empirical large tails isan active line of research [6,7].

In order to visualize the fat tails, the cumulative proba-bilities of the indices and their adaptive models are

Fig. 14. Volatility adaptation. Comparison of the time evolution of Ibex35(black) with the time evolution of the extreme values in the correspond-ing adaptive model (red). (For interpretation of the references to colour inthis figure legend, the reader is referred to the web version of this article.)

Fig. 15. The same as Fig. 14 for Dow Jones.

depicted as function of their absolute normalized returnsin Fig. 10. The absolute normalized return is r�k ¼jrk � rmj=r, being r the standard deviation of rk and rm itsmean value. The cumulative probability of the standard nor-mal distribution is added to the graphic to show how far theindex and model tails are from those of the normaldistribution.

A detail of the tails is shown in the insets of the figure,confirming that the indices tails are much bigger than theones of a normal distribution. On the other hand, the gra-phic shows that the models generate the same fat tails asthe real indices.

4.4. Autocorrelation

Some of the market characteristics cannot be explainedonly from a statistical point of view. As commented in Sec-tion 1, a certain degree of autocorrelation has been foundfor returns. While the Autocorrelation Function of returnsdecays rapidly with time, the Autocorrelation Function ofabsolute returns remains significant indicating positiveautocorrelation [7].

In Figs. 11–13 the Autocorrelation Functions (ACF) ofeach index and the simulations of their correspondingadaptive models are presented, both for normalized andabsolute normalized returns. In the case of the models,the ACF corresponds to an average over fifteen executions.It can be seen that the model shows the same autocorrela-tion patterns as the real index, that is to say, there is noautocorrelation for normalized returns, but the autocorre-lation of absolute normalized returns keeps significant fora period of time.

4.5. Adaptation capabilities of the model and volatility clusters

The evolution of the daily returns, as well as the ex-treme values of the model, along three complete yearsare shown in Figs. 14–16 for Ibex35, Dow Jones and Nikkeirespectively. A single execution of the model might be anyreturn value between the extremes, with equal probability.The figures show that the model adapts quite well itsparameters to follow the real evolution of the asset. Theextreme values for certain value of t are the extremes ofthe interval in which the uniform variable is defined for

Fig. 16. The same as Fig. 14 for Nikkei.

Page 10: An adaptive stochastic model for financial markets

908 J.A. Hernández et al. / Chaos, Solitons & Fractals 45 (2012) 899–908

that moment, so the adaptation of the extreme values inthe figures is in fact the adaptation of the interval defini-tion. On the other hand, it can be seen in the figures thatthis adaptation leads to reproduce the same volatility clus-ters observed in the real asset.

5. Conclusions

An adaptive stochastic model is introduced to simulatethe behavior of real asset markets. It changes its parame-ters automatically by using the recent historical data ofthe asset. The basic idea underlying the model is that a ran-dom variable uniformly distributed within an interval withrandom extremes can replicate the histograms of asset re-turns. This basic idea is derived from a Dynamics of Re-source Density, which is a model of the evolution ofsupply and demand, also presented in this work. The pro-posed stochastic process not only explains the empiricalobservations, but it also has an important theoretical sup-port. The adaptive model is applied to daily returns ofthree well-known indices, Ibex35, Dow Jones and Nikkei,for three complete years (2008–2009).

The model can reproduce the histogram of the indicesas well as their autocorrelation structures. Specially inter-esting is how the model produces the same fat tails as inthe real asset histograms. It is also observed that the samepower laws found in the indices are obtained with themodel, having exactly the same exponents. On the otherhand, the model shows a great adaptation capability, antic-ipating the volatility evolution and showing the same vol-atility clusters observed in the indices.

Acknowledgements

Support from MICINN – Spain under contracts No.MTM2009-14621, and i-MATH CSD2006-32, is gratefullyacknowledged.

References

[1] Chiang TC, Yu H-C, Wu M-C. Statistical properties, dynamicconditional correlation and scaling analysis: evidence from DowJones and Nasdaq high-frequency data. Physica A2009;388(8):1555–70.

[2] Krichene N. Crude oil prices: trends and forecast. IMF Workingpaper; 2008.

[3] Kim YS, Rachev ST, Bianchi ML, Fabozzi FJ. Financial market modelswith Lévy processes and time-varying volatility. J Bank Finance2008;32(7):1363–78.

[4] Mike S, Farmer JD. An empirical behavioral model of liquidity andvolatility. J Econ Dynam Control 2005;32(1):200–34.

[5] Gu G-F, Zhou W-X. On the probability distribution of stock returns inthe Mike–Farmer model. Eur Phys J B 2008;67(4):585–92.

[6] Kirchler M, Huber J. An exploration of commonly observed stylizedfacts with data from experimental asset markets. Physica A2009;388(8):1631–58.

[7] Kirchler M, Huber J. Fat tails and volatility clustering in experimentalasset markets. J Econ Dynam Control 2007;31(6):1844–74.

[8] Gabaix X, Gopikrishnan P, Plerou V, Stanley HE. A theory of power-law distributions in financial market fluctuations. Nature2003;423(6937):267–70.

[9] Kitt R, Skki M, Kalda J. Probability of large movements in financialmarkets. Physica A 2009;388(23):4838–44.

[10] Vodenska-Chitkushev I, Wang FZ, Weber P, Yamasaki K, Havlin S,Stanley HE. Comparison between volatility return intervals of theS&P 500 index and two common models. Eur Phys J B2008;61(2):217–23.

[11] Samanidou E, Zschischang E, Stauffer D, Lux T. Agent-based modelsof financial markets. Rep Prog Phys 2007;70(3):409–50.

[12] Dong L. Volatilities and desires of the agent clusters drive togethermarkets. Physica A 2007;380:512–8.

[13] Pastore S, Ponta L, Cincotti S. Heterogeneous information-basedartificial stock market. New J Phys 2010;12(5):053035.

[14] Amilon H. Estimation of an adaptive stock market model withheterogeneous agents. J Empir Finance 2008;15(2):342–62.

[15] Shimokawa T, Suzuki K, Misawa T. An agent-based approach tofinancial stylized facts. Physica A 2007;379(1):207–25.

[16] Alfarano S, Lux T. A noise trader model as a generator of apparentfinancial power laws and long memory. Macroecon Dynam2007;11(S1):80–101.

[17] Chiang TC, Zheng D. An empirical analysis of herd behavior in globalstock markets. J Bank Finance 2010;34(8):1911–21.

[18] Dong L. A self-adapting herding model: the agent judge-abilitiesinfluence the dynamic behaviors. Physica A 2008;387(23):5868–73.

[19] Tedeschi G, Iori G, Gallegati M. The role of communication andimitation in limit order markets. Eur Phys J B 2009;71(4):489–97.

[20] Slanina F. Critical comparison of several order-book models forstock-market fluctuations. Eur Phys J B 2008;61(2):225–40.

[21] Cristelli M, Alfi V, Pietronero L, Zaccaria A. Liquidity crisis,granularity of the order book and price fluctuations. Eur Phys J B2009;73(1):41–9.

[22] Ni X-H, Jiang Z-Q, Gu G-F, Ren F, Chen W, Zhou W-X. Scaling andmemory in the non-poisson process of limit order cancelation.Physica A 2009;389(14):2751–61.

[23] Gontis V, Kaulakys B, Ruseckas J, Macucci M, Basso G. Nonlinearstochastic differential equation as the background of financialfluctuations. Aip Conf Proc 2009;1129:563–6.

[24] Zhang J, Wang J. Modeling and simulation of the market fluctuationsby the finite range contact systems. Simulat Model Pract Theory2010;18(6):910–25.

[25] Krawiecki A. Microscopic spin model for the stock market withattractor bubbling on regular and small-world lattices. Int J ModPhys C 2008;19(07):1035–45.

[26] Dupoyet B, Fiebig HR, Musgrove DP. Gauge invariant lattice quantumfield theory: implications for statistical properties of high frequencyfinancial markets. Physica A 2010;389(1):107–16.

[27] Bru A, Albertos S, Luis Subiza J, Garcia-Asenjo JL, Bru I. The universaldynamics of tumor growth. Biophys J 2003;85(5):2948–61.

[28] Shannon CE. A mathematical theory of communication. At&t Tech J1948;27:379–423.