Price Dynamics in an Order-Driven Market with Bayesian Learning

In this paper, we have developed a model of limit order book with learning mechanism and investigated its price dynamics. In this model, continuous Bayesian learning is introduced to describe the dynamics of self-adjusting learning mechanism of agents, which can result in some important stylized facts of limit order markets. This study also provides some behavioral explanations for these well-known stylized facts that are commonly observed in the financial markets.


Introduction
In order-driven markets investors can submit either market or limit orders.Market orders will be immediately executed against the quoted bid or ask, whereas limit orders are stored in the limit order book, which is the list of all buy and sell limit orders with their corresponding price and size.Buy and sell orders are matched continuously subject to price and time priorities.Nowadays, most of the security exchanges around the world are considered to be purely electronic limit order markets, and hence it is obviously important to understand the dynamics of the limit order book [1][2][3].
However, the decision-making rules of the investors are so complicated that it is very difficult to derive the asset prices analytically as well as to evaluate the mechanism of market empirically in behavioral finance.Complex phenomena on asset prices emerge from the interactions between the microrules of the behavior of investors [4,5].In the last two decades, a number of interesting agent-based models have been proposed to explain the origin of some phenomena in order-driven markets [6][7][8][9][10][11][12].Agent-based modeling has provided a powerful tool to investigate the effect of the mechanism of market.These models successfully describe the statistical properties of asset prices and some important stylized facts of financial markets, such as fat tails for the distribution of returns and volatility clustering [10,.
In stock markets, heterogeneous traders exhibit different investment behaviors that lead to the time evolution of market prices.Research on heterogeneous agents is an important area in behavioral finance and in the agent-based modeling [36][37][38][39][40][41][42][43][44].Many agent-based models focus on analyzing the impact of heterogeneous traders on the fluctuations in price.Chiarella and Iori [43] classified different trading strategies into three parts: noise trading, fundamentalism, and Chartism, which defined all the three trading strategies, and employed heterogeneous agent models to investigate how different traders may affect the dynamics of price, bid-ask spread, trading volume, and volatility.Furthermore, Chiarella et al. [37] continued to modify their models by introducing the utility function.Takahashi et al. [44] employed an agentbased approach to analyze how the asset prices are affected by the investors and investment systems that are based on behavioral finance.Maskawa [45] considered the mimetic behavior of traders in a continuous double auction market and studied the fluctuations in the stock price and the power-law tail of the distribution of returns.LeBaron et al. [46] introduced an order-driven market with heterogeneous investors, analyzed the markets with and without learning and adaptation, and showed that the interaction of purely fundamentalist agents with heterogeneous estimates is sufficient to generate fat tails and volatility clustering.
In order to track the dynamic demands and supplies in order-driven markets and to clarify the rational and irrational 2 Complexity behaviors of heterogeneous investors, this study introduced few new assumptions from the psychological views into the microstructure modeling and tested them in an artificially built market.A model of limit order book has been proposed with learning mechanism which was developed using the concept of Chiarella et al. [37].First, the agents are supposed to be able to update their orders, including the prices, volumes, and trading sides, when their arrival in the market is modeled as a Poisson's process; second, in our model, the Bayesian learning process is introduced to distribute the strategic elements rationally for each investor along with the running time of market; third, the trading characteristics of each agent are not static after applying the Bayesian learning mechanism.Thus, this paper provides all the agents equal access to enter into the market and to update their orders according to their expectations, which could dramatically increase the efficiency of artificial market.
We have employed an agent-based framework to simulate the market prices and returns time series for examining different properties of the market.In the framework, we construct an artificial market, and we assume that each agent comes into the market randomly and then submits orders according to their past experiences and market feedback.After running the market for some time, we examine the overall performance of the system to see if the initial settings of agents' learning pattern are capable of generating many interesting stylized facts we observed in high frequency financial series of the real world.
The paper is organized as follows.Section 2 describes the main model considered in this study which gives the detailed decision-making rules of the agents; Section 3 presents the simulated results of the model which include the parameters, market and mid-point prices/returns series, and the market depth, and a discussion related to the stylized facts is also considered in each subsection; Section 4 gives a conclusion of this study and provides some prospects for future research work.

The Model
As discussed by Chiarella et al. [37], we assume that every agent in the market knows the public information, the fundamental value of the risky asset which is assumed to follow the geometric Brownian motion (GBM), and submits their orders based on their own past trading history.Each order contains volume and price that the agent plans to buy or to sell.There are only three options for the agent: sell order, buy order, or do not do anything.The number of agents is finite, and the agent arrival in the market is modeled as a Poisson's process.The market price is set as follows: it is the past trading or quoted price when a real transaction occurs; the average of best bid or ask is considered if no real deal occurs.
Additionally, we assumed that each agent makes their investment decisions according to the combination of three pieces of information: the fundamental information, the technical information or price charts, and the market noise.Therefore, we can describe each agent by the combination of three investing styles: fundamental, chartist, and noise investors.If an agent is a fundamentalist, then there is a greater possibility for him to enter the market if the fundamental price is higher than the market price, irrespective of the intensity of market volatility.Based on the assumption, the expected rate of return of the risky asset that the agent i considers is set as follows: r ,+ where    ,    ,    represent the weights of fundamental, chartist, and noise components, respectively, and all the three weights were set to be greater than or equal to zero.  and    are the market and fundamental prices of the asset, respectively, at time "t";   is the noise part with zero mean and variance   ;    is the time horizon of the agent "I" at time "t" and for every agent.   could be estimated by the time interval between time "t" and the next time at which the agent i arrives at the market.(This approximation is easy to understand as follows: when an agent arrives in the market, his expectation about the future price always focuses on comparing the trading results between that time and last time.Thus, the time horizon is set to be the interval between the latest two times at which the agent arrived.)  , as discussed by Chiarella et al. [37], is the time scale over which the fundamentalist component for the mean reversion of price to the fundamental is calculated;    is defined as follows: where T is the total number of time steps before the time point t.
For the initialization of the market, the three weights were set to spread across the agents with a normal distribution, which indicates that when the market starts, the fundamentalist (f), chartist (c), and noise (n) agents are normally distributed in the market.For convenience, it has been set as follows: where   ,0 has mean,   , and variance,  2  , and all the three weights are equal to or larger than zero.The probability density function,   ,0 , could be expressed as follows.
After the initiation, the agents who arrive at the market will adjust their expectation based on their trading history, which could be described as an information set,    , that includes the history of fundamental rates,  ,  = ln(   /  ), chartist rates,    ( = 1, 2 . . . −    ), and the noise rates,   , whose continuous distribution could be assumed as normal.(This assumption is consistent with the assumption of geometric Brownian motion for the fundamental value of the asset.)Thus, from the historical information of the three types about agent i, the continuous distribution could be easily estimated based on the experience of the agent for  ,  and    as shown in the following.
From ( 5), it could be seen that the information set  should present the past trading experience of agent "i" by time "t" and the normal distributed form of each random rate's pdf could also be easily inferred from the previous assumption.(For convenience, the experimental distribution of  ,  and    could also be assumed as normal, and from the assumption of geometric Brownian motion, it could be easily inferred that the difference in the price is also log normally distributed.)Following this, ( 6), (7), and ( 8) could be set as below.
In ( 6)-( 8),   (k=f, m, n) denotes the standard deviation of the time series of  ,  ,    ,    ; r  represents the mean of all the history values of r ,+   by time "t" which is defined by (1); and   [  +   +   ] denotes the expectation of the sum of the three random weights by time "t".
Based on    at time "t", it could be assumed that agent  will adjust the investing strategy through the following Bayesian equations: where The initial distribution of the three components has been assumed as normal by (4).
Theorem 1.Based on the assumption of ( 4), the three random weights (  ,   , and   ) after Bayesian adjustment, which are defined by ( 10)-( 12), will still follow the normal distribution at any point of time line.The mean and volatility after the adjustment are (k=f, m, n) where   denotes the volatility of weight before Bayesian adjustment.
(In the appendix a proof has been given.)Theorem 1 provides the specific formulation of the distribution of three random weightings after each time of Bayesian leaning, which assists in easily simulating the weightings during the process.
Based on the assumption of compound interest, given the expected rate of return, the following equation for the expected price could be obtained.
Following the assumption used by Chiarella et al. [37] and the constant absolute risk aversion (CARA) utility function, the number of shares that the agent "" wishes to hold at time "t" could be obtained as follows: where   is the market price at time "t", var   is the variance at time "t", and    is the risk aversion coefficient which is adjusted from the initial setting of  as given below so, the volume that each agent wants to trade is given as where    is the risky asset share that the agent "i" holds at time "t",    and    are the trading volumes of a buy order and a sell order, respectively, and   −   is the risky asset share that an agent holds before trading at time "t".Besides, the price at which the agent submits orders to buy or to sell the risky asset is a uniformly distributed random variable as follows.
The two bounds of    are set as follows.
We can get another bound,   *  , as follows: where the  function is determined by (15).Table 1 presents the summary of the trading mechanism of agent "i" at time "t".

Simulation Results
3.1.Parameters.Tables 2 and 3 present all the used exogenous parameters during the simulation process as well as their economic meaning.By running the sensitivity analysis program, an initial value fitted for every parameter could be found out (Table 4).

Stylized Facts.
With the settling of all the exogenous parameters, the model of limit order book has been presented and evaluated as "Bayes-EUT model".As clarified in the introduction, some statistical properties of order books, in particular, the following four well-known stylized facts in the order-driven markets, were investigated: (1) heavy-tailed return distribution; (2) the absence of autocorrelation of returns; (3) volatility clustering; (4) nontrivial Hurst exponent.
According to the observations of Cont and Bouchaud, "the unconditional distribution of mid-price returns displays tails that are heavier than a normal distribution (i.e. they have positive excess kurtosis), but thinner than a stable Pareto-Levy distribution" [47].Chakraborti et al. [11] and Cont [48] found that "Except on very short timescales, when it exhibits weak negative autocorrelation, the time series of midprice returns does not display any significant autocorrelation".Cont et al. [19,33] found that "time series of absolute or square mid-price returns displays positive autocorrelation that persists up to timescales of weeks or even months.The observed autocorrelation is slowly decaying (i.e.decays like a power-law function of time lag)", which is defined as the consequence of periods with large price movements clustering together in time and periods with small price movements clustering together in time.Bouchaud and Potters [49] and Genc ¸ay et al. [50] found that "In a variety of different markets, including the S&P 500, foreign exchange markets, and interest rate markets, the mid-price return series was found to be sub-diffusive on timescales of up to months, and diffusive on longer timescales", where a time series with a Hurst exponent, H = 0.5, is said to be diffusive, and H < 0.5 is said to be subdiffusive, whereas H > 0.5 is said to be superdiffusive.
It has been found that the focus of all the four stylized facts is on the analysis of the time series of mid-price, which is the average of the largest bid and the smallest ask and could be a little different from the market price.The price may not be the mid-point between the best ask and bid, though the smallest ask and the largest bid could change after each transaction.Therefore, both the characteristics of the return series of mid-price and the market price were explored to evaluate whether the outcome of the Bayes-EUT Model could depict the four important features of the order-driven markets.From these figures, it could be observed that the return has a heavier tail and larger kurtosis than the normal distribution.Table 5 gives the descriptive statistics of the return series.Since the kurtosis of the return series is 8.1401, which is larger than the kurtosis of standard normal distribution, it could be concluded that the Bayes-EUT market's return has a heavy tail.Then, the autocorrelation of the return series was calculated to check whether there is any significant existence of autocorrelation.

Market Price and Return
Figure 4 presents the varying process of the autocorrelation and partial correlation related to the market return series.From this figure, it becomes obvious that the absence of autocorrelation is perfectly satisfied for the market generated by the Bayes-EUT model.Figures 5 and 6 show the autocorrelation of the square return and absolute value of the return series, respectively.From these figures it could be   concluded that the volatility clustering of the return series is also satisfied for the Bayes-EUT market.

Market Price Return
To test whether the return series is subdiffusive on short timescales and diffusive on longer timescales, the Hurst exponent of the market return along with different timescales was computed.
From Figure 7, it could be noted that for return on small timescales, the Hurst exponent of the market return series is obviously smaller than 0.5, which indicates that the return series is subdiffusive on short timescales, whereas for long timescales, the Hurst exponent is varying around 0.5.In general, the return could be diffusive on long timescales.Thus, the market return series based on the assumptions of Bayes-EUT model satisfies the fourth stylized facts.

Mid-Point
Price and Return.Furthermore, in the Bayes-EUT market, the smallest ask and largest bid price are described as shown in Figure 8.
From Figure 8, it could be found that the bid and ask price become gradually closer to each other along with the time.After this, the mid-price, the mid-point of the smallest ask and largest bid, was considered.Figure 9 presents the mid-price and market price series in one coordinate plane.
It could be noted that the trend of mid-price is similar to the market price, though the market price could vary much more significantly than the mid-price.Figure 10 is the logarithmic return series of the mid-price.It could be observed that the standard deviation of normal distribution is the same as that of the mid-price return series as noted from Figures 11(a) and 11(b).Table 6 shows the descriptive statistical analysis for the mid-price return series.Since the kurtosis of the mid-price return series is dramatically larger than that of the standard normal distribution, it could be concluded that the mid-price return series has a stylized "heavy tail".
Considering the autocorrelation of the mid-price return, as observed in Figure 12, it could be seen that there are significant autocorrelation which exists on long timescales and on short timescales, and the negative autocorrelation is  Figure 12 not significant.This result reveals that the mid-price return series generated by the Bayes-EUT model does not satisfy the stylized fact as reported by Chakraborti et al. [11] and Cont [48].
Figure 13 is the autocorrelation of the absolute value of the mid-price return and the square of the mid-price return values.It could be noticed that the absolute return has the positive return persisting to long timescales, with a trend of gradual decay, which is consistent with the findings of Cont [33] and Liu et al. [19].However, the square return does not display the persisting long time autocorrelation, where the positive autocorrelation of that series only appears in a very short time interval at the beginning of market's initialization.Therefore, the mid-price return does not satisfy volatility clustering.
From Figure 14, it could be observed that no matter it is a short or long timescales, the Hurst exponent is always larger than 0.5, which indicates that the mid-price return series is superdiffusive under the assumption of this model.Thus, the mid-price return generated by the Bayes-EUT model does not satisfy the fourth fact too.
Overall, for the market generated by the Bayes-EUT model, the return series of market price satisfies all the stylized facts found out by the empirical studies, but for the return of mid-price series, except for the first fact having a heavy tail, it does not satisfy all of the other three facts.
3.5.Market Depth.Figure 15 (log-log scale) and Figure 16 (log-linear scale) give the general shape of market depth distributed along with the distance from the mid-point price in the Bayes-EUT limit order book.Figure 15 displays an obvious decreasing trend along with the increasing the price distance, whereas Figure 16 displays an obvious hump shape and the depth is relatively higher in the middle of the graph.Both phenomena indicate that the simulated limit order book has some important features in the order-driven markets.

Conclusions
In this study, a model of limit order book has been proposed following the idea of Chiarella et al. [37].By incorporating a Bayesian learning mechanism into the decision-making  process of agents and replacing the original time horizon with a random interval between the two time points when each agent arrives in the market, the proposed model from this study could give rise to some important stylized facts of limit order markets.It has been found that the market price and return series totally satisfy the four stylized facts, but the series of mid-point price and return have only a stylized heavy tail.Besides, the simulated market prices are far smaller than the fundamental values but have a much higher volatility, which reflects the evaluation activity of each agent regarding their own ideal value of the risk asset through their learning process.Moreover, the vast difference between the behaviors of market price and mid-point price indicates that many transactions occur at a price far from the best ask and bid.
Generally speaking, our experimental results have two significant meanings: (1) the model successfully outputs the market price and return series similar to that of the real word, which means our assumption of the Bayesian learning mechanism could be somewhat reasonable; (2) according to our model, the market price of risky asset could dramatically deviate from its underlying fundamental value, and this case also happens in the real world.Therefore we could say that we find some reason regarding the deviation of market price in the real equity market.
Further research could focus on introducing other selfadjusting mechanisms to describe the statistical properties of order books, and the application of some behavioral theories could provide more valuable insights into the dynamics of the order-driven markets.

Figure 1 :
Figure 1: Varying curve of the market price considering the assumptions of Bayes-EUT model.

Figure 1
presents the varying curve of the market price considering the assumptions of Bayes-EUT model, and Figure2presents the logarithmic return of market.Furthermore, Figures3(a) and 3(b) demonstrate the distribution of return in the Bayes-EUT market.

Figure 4 :
Figure 4: Varying process of the autocorrelation and partial correlation related to the market return series.

Figure 5 :
Figure 5: Autocorrelation of the square return.

Figure 6 :Figure 7 :
Figure 6: Absolute value of the return series.

Figure 8 :Figure 10 :
Figure 8: Smallest ask and largest bid price in the Bayes-EUT market.

Figure 11 :
Figure 11: Standard deviation of normal distribution (the std of normal distribution is the same as that of the mid-price return series).

Table 1 :
Summary of the trading mechanism of agent "i" at time "t".

Table 4 :
Values of the parameters.

Table 5 :
Descriptive statistics of the return series.

Table 6 :
Descriptive statistical analysis for the mid-price return series.