Kirman’s ant colony model, previously presented on our website as agent based (based on 1) and stochastic (based on 2, 3) model, has become classical example of herding modeling. Application of this model towards economic, financial or other social scenarios might seem doubtful as human society is far more complex than ant colony, but methodologically it is more useful to start from very simple and stylized model and later add complexity on top of it. Furthermore we have already shown that Kirman’s herding dynamics could be applicable in agent based marketing (see comparison of Kirman’s and Bass diffusion model). In this text we will consider financial market scenario and obtain stochastic differential equations similar to the existing stochastic models considered in 4, 5.
Discussion and model presented in this text is the main topic of our paper on Microscopic reasoning for the non-linear stochastic models of long-range memory 6.
Introduction of variable event time scale
Original Kirman’s model assumes constant agent meeting rate. In financial market scenario one could draw analogy between these events and trades, as trade is pair-wise interaction of traders, or agents in modelic case, and also a great opportunity to reconsider available options. Thus we rewrite original one-step transition probabilities as
where is characteristic inter-event time, which now depends on system state. Note that in the above transition probabilities we have already assumed that one group of agent is rational, , while another is not, . For this reason transition rate, , of has remained constant.
In this, more general, case derivation of stochastic differential equation in the manner it was done in 2 (also discussed on our website) is rather troublesome. Though alternatively we can use one-step process formalism 3, 7. In such case we compactly express Master equation using one-step operators, and :(1)
where are probability fluxes related to the transitions probabilities as . Evidently is continuous system state variable, defined as (large values can be assumed to secure continuity of the new system state variable).
As one-step operators act on continuous functions they can be expanded using Taylor series up to the second order terms:
where is smallest possible increment of the continuous system state variable, . After this expansion Master equation, Eq. 1, becomes Fokker-Planck equation:(2)
where and are custom functions:
The above Fokker-Planck equation, 2, can be rewritten as Langevin equation:
To simplify model we can introduce dimensionless time, :(3)
where are accordingly rescaled original model parameters, .
Introducing price and return
While introducing variable time scale we assumed that there are at least two types of traders – some are rational, while some are not so. In recent agent based modeling 8 it is also very common to assume that there are two types of traders in the market – fundamentalists and noise traders. By definition fundamentalists are assumed to be rational investors aiming for the long term profits, while noise traders rely on technical trading strategies aiming for short term profits.
Fundamentalists base their decision on information about the stock’s value in the market. This information is quantified via so-called fundamental price, . Fundamentalists expect that in long-run market will tend towards correct estimate of the stock’s value. If fundamentalists will expect growth of prices, thus placing buying orders. In the opposite case they’ll attempt to sell stock, as they will expect decrease of price. These ideas are mathematical put down as 2:
where is fundamentalists’, entities, excess demand at a given time.
Contrary noise traders attempt to forecast future prices based on previous price movements. As they are using price charts to make forecast, they are also called chartists. As very is a wide selection of very different chartist trading strategies, chartists are likely to make very different forecasts. Difference in forecasts would lead to difference in bids. This intrinsic disagreement might be macroscopically seen as irrational mood of noise traders. Thus theirs’ excess demand can mathematical be expressed as 2:
where is an average noise traders’ mood, is scaling term, which might also be seen as relative impact of chartists’ trades on the market.
Now one can use Walras law in order to obtain definition of price and, later, return. Original Walras law 9 assumes that trading in the market occurs trough the market maker, who stabilizes the market. Market is consider to be stable if all agents’ excess demands equal zero:
here one can assume that fundamental price remains constant (i.e. it is not a function of time). As we have definition of price, now we can obtain definition of return:(4)
Note that in the above we have expressed and using , which we have defined previously as a systems state variable of Kirman’s model. As fundamentalists are rational we have set that , while chartists are thus directly related to .
In 2 definition of return, 4, is simplified by using adiabatic approximation. Namely it is assumed that noise traders’ change their mood very quickly, if compared with . This gives simpler definition of return:(5)
where is a change of noise traders’ mood, . This change can be modeled in different ways, in 2 it is modeled using spin noise. In such case can be seen as absolute return, for which we will derive stochastic model in the next section of this text.
Derivation of stochastic model for absolute return, y
Eqs. 3 and 5 were derived in 2 (stochastic model was derived in a bit different way), but Alfarano et al. stopped there and did not derive stochastic differential equation for absolute return. In order to obtain stochastic model for absolute return we use Ito variable substitution formula 10:
to obtain stochastic model for :(6)
If we consider , this selection might be backed by the positive correlation between trading activity and absolute return and also by the similarity of statistical properties, and a limit of large values Eq. 6 becomes:(7) (8)
which is known to give power law statistics:
The above comparison is very important as stochastic differential equation 8 is a more general case of our stochastic model of return 11. Working on this approach further we might be able to create agent based model providing more sophisticated statistical features reproduced by the model consider in 11.(9)
Eq. 9 is noted to be a special case of Eq. 8, when exponential diffusion restriction is applied 4. Though comparison with generalized CEV process is important on its own, as generalized CEV process encompass many stochastic models used in risk management. In order to obtain similar stochastic differential equation we have to linearize drift function of Eq. 6 (i.e. set ). Similarity is once again obtained in the limit of large values:
In case of generalized CEV process we can’t reproduce noise in three distinct cases, but we can still obtain three different power law spectral densities in three distinct cases (in each cases giving precise prediction). In Fig 2., this figure is featured in 6, we have shown that theoretical predictions for CEV process are also valid for defined by Eq. 6.
where is numerical precision parameter (numerical solution tends to improve with smaller values of the parameter), while is normally distributed (zero mean, unit variance) random variable. Precision and quality of numerical results are also influenced by the enforced restrictions (in applet one must define range of possible values).
Model time series is formed from the numerical solutions of the above difference equations. These time series are used to obtain power spectral density and probabilistic distribution of values (both are ploted on logarithmic scales). Obtained time series mark values each time units (this is not to be confused with the one in transition probabilities).
Applet allows to calculate number of time series (or alternatively realizations). Generally speaking the more realizations, the better, as noisy fluctuations are removed through averaging over all calculated realizations. If your computer’s processor has multiple cores you can easily increase number of realizations being obtained without significant slowing down – you just have to tell applet to use more cores for numerical calculations. In such case numerical calculations will be distributed over selected number of cores.
Above you should see Java applet. If you do not see it, then please make sure that you have JRE installed and that your browser has Java enabled. Also make sure that you are running newest available JRE version. Newest JRE version can be downloaded from http://java.com/getjava.
- Ants, rationality and recruitment. Quarterly Journal of Economics 108, 1993, pp. 137-156..
- Estimation of Agent-Based Models: The Case of an Asymmetric Herding Model. Computational Economics 26 (1), 2005, pp. 19-49..
- Time variation of higher moments in a financial market with heterogeneous agents: An analytical approach. Journal of Economic Dynamics and Control 32, 2008, pp. 101-136..
- Interplay between positive feedback in the generalized CEV process. Physica A 390 (8), 2011, pp. 1393-1401. arXiv: 1008.0568 [physics.data-an]. Download..
- 1/f noise from nonlinear stochastic differential equations. Physical Review E 81, 2010, pp. 031105. arXiv: 1002.4316 [nlin.AO]..
- Agent based reasoning for the non-linear stochastic models of long-range memory. Physica A 391 (4), 2012, pp. 1309-1314. doi: 10.1016/j.physa.2011.08.061. arXiv: 1106.2685 [q-fin.ST]. Download..
- Stochastic process in Physics and Chemistry. North Holland, Amsterdam, 2007..
- Critical Overview of Agent-Based Models for Economics. Proceedings of the School of Physics "E. Fermi", Course CLXXVI, ed. F. Mallnace, H. E. Stanley, pp. 235 - 282. SIF-IOS, Bologna-Amsterdam, 2012. doi: 10.3254/978-1-61499-071-0-235..
- Handbook of stochastic methods. Springer, Berlin, 2009..
- A Non-linear Stochastic Model of Return in Financial Markets. In: Stochastic Control, ed. C. Myers. InTech, 2010. doi: 10.5772/9748..
- Numerical Solution of Stochastic Differential Equations. Springer, Berlin, 1999..