Abstract
We introduce the simulation tool SABCEMM (Simulator for Agent-Based Computational Economic Market Models) for agent-based computational economic market (ABCEM) models. Our simulation tool is implemented in C++ and we can easily run ABCEM models with several million agents. The object-oriented software design enables the isolated implementation of building blocks for ABCEM models, such as agent types and market mechanisms. The user can design and compare ABCEM models in a unified environment by recombining existing building blocks using the XML-based SABCEMM configuration file. We introduce an abstract ABCEM model class which our simulation tool is built upon. Furthermore, we present the software architecture as well as computational aspects of SABCEMM. Here, we focus on the efficiency of SABCEMM with respect to the run time of our simulations. We show the great impact of different random number generators on the run time of ABCEM models. The code and documentation is published on GitHub at https://github.com/SABCEMM/SABCEMM, such that all results can be reproduced by the reader.
Similar content being viewed by others
Notes
Cross herding mechanism: https://github.com/SABCEMM/SABCEMM/blob/v0.1-alpha/src/Agent/AgentCross.cpp#L138-L140.
min. version 2.8.12; https://cmake.org.
References
Abar, S., Theodoropoulos, G. K., Lemarinier, P., & O’Hare, G. M. (2017). Agent based modelling and simulation tools: A review of the state-of-art software. Computer Science Review, 24, 13–33.
Ackerman, F. (2002). Still dead after all these years: Interpreting the failure of general equilibrium theory. Journal of Economic Methodology, 9(2), 119–139.
Adam, K., Marcet, A., & Nicolini, J. P. (2016). Stock market volatility and learning. The Journal of Finance, 71(1), 33–82.
Alfarano, S., Lux, T., & Wagner, F. (2005). Estimation of agent-based models: The case of an asymmetric herding model. Computational Economics, 26(1), 19–49.
Alfarano, S., Lux, T., & Wagner, F. (2008). Time variation of higher moments in a financial market with heterogeneous agents: An analytical approach. Journal of Economic Dynamics and Control, 32(1), 101–136.
Allan, R. J. (2010). Survey of agent based modelling and simulation tools. London: Science & Technology Facilities Council.
Andersen, J. V., & Sornette, D. (2003). The $-game. The European Physical Journal B-Condensed Matter and Complex Systems, 31(1), 141–145.
Beikirch, M., Cramer, S., Frank, M., Otte, P., Pabich, E., & Trimborn, T. (2018). Simulation of stylized facts in agent-based computational economic market models. arXiv preprint arXiv:1812.02726.
Beja, A., & Goldman, M. B. (1980). On the dynamic behavior of prices in disequilibrium. The Journal of Finance, 35(2), 235–248.
Bernanke, B. (2010). Interview with the international herald tribune, 5.
Bouchaud, J.-P. (2002). An introduction to statistical finance. Physica A: Statistical Mechanics and its Applications, 313(1), 238–251.
Bouchaud, J.-P. (2008). Economics needs a scientific revolution. Nature, 455(7217), 1181–1181.
Bouchaud, J.-P., & Cont, R. (1998). A langevin approach to stock market fluctuations and crashes. The European Physical Journal B-Condensed Matter and Complex Systems, 6(4), 543–550.
Brock, W. A., & Hommes, C. H. (1997). A rational route to randomness. Econometrica: Journal of the Econometric Society, 65, 1059–1095.
Brock, W. A., & Hommes, C. H. (1998). Heterogeneous beliefs and routes to chaos in a simple asset pricing model. Journal of Economic dynamics and Control, 22(8), 1235–1274.
Butcher, J. C. (2016). Numerical methods for ordinary differential equations. New York: Wiley.
Campbell, J. Y., Lo, A. W.-C., MacKinlay, A. C., et al. (1997). The econometrics of financial markets (Vol. 2). Princeton, NJ: Princeton University Press.
Chakraborti, A., Toke, I. M., Patriarca, M., & Abergel, F. (2011). Econophysics review: Ii. agent-based models. Quantitative Finance, 11(7), 1013–1041.
Challet, D., & Marslii, M. (2002). Criticality and finite size effects in a simple realistic model of stock market. Working paper Department of Theoretical Physics, Oxford University, INFM, Trieste-SISSA Unit, Trieste.
Challet, D., Marsili, M., & Zhang, Y.-C. (2001). Stylized facts of financial markets and market crashes in minority games. Physica A: Statistical Mechanics and its Applications, 294(3), 514–524.
Chen, S.-H., Chang, C.-L., & Du, Y.-R. (2012). Agent-based economic models and econometrics. The Knowledge Engineering Review, 27(02), 187–219.
Chiarella, C., Dieci, R., & Gardini, L. (2002). Speculative behaviour and complex asset price dynamics: A global analysis. Journal of Economic Behavior & Organization, 49(2), 173–197.
Chiarella, C., Dieci, R., & Gardini, L. (2005). The dynamic interaction of speculation and diversification. Applied Mathematical Finance, 12(1), 17–52.
Chiarella, C., Dieci, R., & Gardini, L. (2006). Asset price and wealth dynamics in a financial market with heterogeneous agents. Journal of Economic Dynamics and Control, 30(9), 1755–1786.
Chiarella, C., Dieci, R., & He, X.-Z. (2007). Heterogeneous expectations and speculative behavior in a dynamic multi-asset framework. Journal of Economic Behavior & Organization, 62(3), 408–427.
Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues.
Cont, R., & Bouchaud, J.-P. (2000). Herd behavior and aggregate fluctuations in financial markets. Macroeconomic Dynamics, 4(2), 170–196.
Corporation, I. Intel math kernel library.
Cowan, R., & Jonard, N. (2002). Heterogenous agents, interactions and economic performance (Vol. 521). Berlin: Springer.
Cross, R., Grinfeld, M., & Lamba, H. (2006). A mean-field model of investor behaviour. Journal of Physics Conference Series, 55, 55–62.
Cross, R., Grinfeld, M., Lamba, H., & Seaman, T. (2005). A threshold model of investor psychology. Physica A: Statistical Mechanics and its Applications, 354, 463–478.
Cross, R., Grinfeld, M., Lamba, H., & Seaman, T. (2007). Stylized facts from a threshold-based heterogeneous agent model. The European Physical Journal B, 57(2), 213–218.
Da Silva, M. A., Lima, G. T., et al. (2015). Combining monetary policy and prudential regulation: An agent-based modeling approach. Banco Central Do Brasil working papers (394).
Day, R. H., & Huang, W. (1990). Bulls, bears and market sheep. Journal of Economic Behavior & Organization, 14(3), 299–329.
De Grauwe, P., & Grimaldi, M. (2005). Heterogeneity of agents, transactions costs and the exchange rate. Journal of Economic Dynamics and Control, 29(4), 691–719.
Debreu, G. (1974). Excess demand functions. Journal of Mathematical Economics, 1(1), 15–21.
Dieci, R., Foroni, I., Gardini, L., & He, X.-Z. (2006). Market mood, adaptive beliefs and asset price dynamics. Chaos, Solitons & Fractals, 29(3), 520–534.
Dijkstra, E. W. (1982). On the role of scientific thought. In Selected writings on computing: A personal perspective (pp. 60–66). Springer.
Egenter, E., Lux, T., & Stauffer, D. (1999). Finite-size effects in monte carlo simulations of two stock market models. Physica A: Statistical Mechanics and its Applications, 268(1), 250–256.
Ehrentreich, N. (2007). Agent-based modeling: The Santa Fe Institute artificial stock market model revisited (Vol. 602). Berlin: Springer.
Evans, L. C. (2012). An introduction to stochastic differential equations (Vol. 82). Providence: American Mathematical Society.
Fama, E. F. (1965). The behavior of stock-market prices. The Journal of Business, 38(1), 34–105.
Farmer, D. (1997). Seminar presented at université de paris vi.
Farmer, J. D., & Foley, D. (2009). The economy needs agent-based modelling. Nature, 460(7256), 685–686.
Farmer, J. D., & Joshi, S. (2002). The price dynamics of common trading strategies. Journal of Economic Behavior & Organization, 49(2), 149–171.
Farmer, J. D., Patelli, P., & Zovko, I. I. (2005). The predictive power of zero intelligence in financial markets. Proceedings of the National Academy of Sciences of the United States of America, 102(6), 2254–2259.
Franke, R., & Westerhoff, F. (2012). Structural stochastic volatility in asset pricing dynamics: Estimation and model contest. Journal of Economic Dynamics and Control, 36(8), 1193–1211.
Gode, D. K., & Sunder, S. (1993). Allocative efficiency of markets with zero-intelligence traders: Market as a partial substitute for individual rationality. Journal of Political Economy, 101(1), 119–137.
Google test. https://github.com/google/googletest. Accessed 2017-08-24.
Granger, C. W. J., & Morgenstern, O. (1970). Predictability of stock market prices. Heath Lexington Books.
Harras, G., & Sornette, D. (2011). How to grow a bubble: A model of myopic adapting agents. Journal of Economic Behavior & Organization, 80(1), 137–152.
He, C. C. R. D. X.-Z. (2011). The dynamic behaviour of asset prices in disequilibrium: a survey. International Journal of Behavioural Accounting and Finance, 2(2), 101–139.
Heertje, A. (2002). Recent criticism of general equilibrium theory. In Equilibrium, markets and dynamics (pp. 51–60). Springer.
Hellekalek, P. (1998). Good random number generators are (not so) easy to find. Mathematics and Computers in Simulation, 46(5), 485–505.
Hellthaler, T. (1996). The influence of investor number on a microscopic market model. International Journal of Modern Physics C, 6(06), 845–852.
Hommes, C. H. (2006). Heterogeneous agent models in economics and finance. Handbook of Computational Economics, 2, 1109–1186.
Iori, G., Porter, J., et al. (2012). Agent-based modelling for financial markets. Chapter prepared for the Handbook on Computational Economics and Finance.
Kahneman, D. (2003). Maps of bounded rationality: Psychology for behavioral economics. The American Economic Review, 93(5), 1449–1475.
Kaizoji, T. (2000). Speculative bubbles and crashes in stock markets: an interacting-agent model of speculative activity. Physica A: Statistical Mechanics and its Applications, 287(3), 493–506.
Kaizoji, T., Bornholdt, S., & Fujiwara, Y. (2002). Dynamics of price and trading volume in a spin model of stock markets with heterogeneous agents. Physica A: Statistical Mechanics and its Applications, 316(1), 441–452.
Kempf, A., & Korn, O. (1999). Market depth and order size. Journal of Financial Markets, 2(1), 29–48.
Kim, G.-R., & Markowitz, H. M. (1989). Investment rules, margin, and market volatility. The Journal of Portfolio Management, 16(1), 45–52.
Kirman, A. (1993). Ants, rationality, and recruitment. The Quarterly Journal of Economics, 108(1), 137–156.
Kirman, A. P., Teyssiere, G., et al. (2001). Microeconomic models for long-memory in the volatility of financial time series. Technical report, Society for Computational Economics.
Knuth, D. E. (1997). The art of computer programming: Seminumerical algortihms (3rd ed., Vol. 2). London: Pearson Education.
Kohl, R. (1997). The influence of the number of different stocks on the levy-levy-solomon model. International Journal of Modern Physics C, 8(06), 1309–1316.
LeBaron, B. (2000). Agent-based computational finance: Suggested readings and early research. Journal of Economic Dynamics and Control, 24(5), 679–702.
LeBaron, B. (2006). Agent-based computational finance. Handbook of Computational Economics, 2, 1187–1233.
L’Ecuyer, P., & Simard, R. (2007). Testu01: Ac library for empirical testing of random number generators. ACM Transactions on Mathematical Software (TOMS), 33(4), 22.
Levy, M., Levy, H., & Solomon, S. (1994). A microscopic model of the stock market: Cycles, booms, and crashes. Economics Letters, 45(1), 103–111.
Levy, M., Levy, H., & Solomon, S. (1995). Microscopic simulation of the stock market: The effect of microscopic diversity. Journal de Physique I, 5(8), 1087–1107.
Levy, H., Levy, M., & Solomon, S. (2000). Microscopic simulation of financial markets: From investor behavior to market phenomena. London: Academic Press.
Lux, T. (1995). Herd behaviour, bubbles and crashes. The Economic Journal, 105, 881–896.
Lux, T. (2008). Stochastic behavioral asset pricing models and the stylized facts. Technical report, Economics working paper/Christian-Albrechts-Universität Kiel, Department of Economics.
Lux, T. (1998). The socio-economic dynamics of speculative markets: Interacting agents, chaos, and the fat tails of return distributions. Journal of Economic Behavior & Organization, 33(2), 143–165.
Lux, T., & Marchesi, M. (1999). Scaling and criticality in a stochastic multi-agent model of a financial market. Nature, 397(6719), 498–500.
Lux, T., & Marchesi, M. (2000). Volatility clustering in financial markets: A microsimulation of interacting agents. International Journal of Theoretical and Applied Finance, 3(04), 675–702.
Malkiel, B. G. (2003). The efficient market hypothesis and its critics. The Journal of Economic Perspectives, 17(1), 59–82.
Malkiel, B. G., & Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The Journal of Finance, 25(2), 383–417.
Mandelbrot, B. B. (1997). The variation of certain speculative prices. Berlin: Springer.
Mantel, R. R. (1974). On the characterization of aggregate excess demand. Journal of Economic Theory, 7(3), 348–353.
Matsumoto, M., & Nishimura, T. (1998). Mersenne twister: A 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Transactions on Modeling and Computer Simulation (TOMACS), 8(1), 3–30.
Mill, J. S. (1994). On the definition of political economy and method of investigation proper to it (1836). Collected Works of John Stuart Mill, 4, 120–164.
Myers, G. J., Sandler, C., & Badgett, T. (2011). The art of software testing. New York: Wiley.
N. A. G. (NAG). Nag c library.
Nikolai, C., & Madey, G. (2009). Tools of the trade: A survey of various agent based modeling platforms. Journal of Artificial Societies and Social Simulation, 12(2), 2.
Palmer, R. G., Arthur, W. B., Holland, J. H., LeBaron, B., & Tayler, P. (1994). Artificial economic life: A simple model of a stockmarket. Physica D: Nonlinear Phenomena, 75(1–3), 264–274.
Pareto, V. (1897). Cours d’économie politique, professé à l’université de lausanne. tome second.
Rumbaugh, J., Blaha, M., Premerlani, W., Eddy, F., Lorensen, W. E., et al. (1991). Object-oriented modeling and design (Vol. 199). Englewood Cliffs, NJ: Prentice-Hall.
Samanidou, E., Zschischang, E., Stauffer, D., & Lux, T. (2007). Agent-based models of financial markets. Reports on Progress in Physics, 70(3), 409.
Schweitzer, F., Fagiolo, G., Sornette, D., Vega-Redondo, F., Vespignani, A., & White, D. R. (2009). Economic networks: The new challenges. Science, 325(5939), 422–425.
Simon, H. A. (1955). A behavioral model of rational choice. The Quarterly Journal Of Economics, 69, 99–118.
Simon, H. A. (1957). Models of man; social and rational.
Sonnenschein, H. (1972). Market excess demand functions. Econometrica: Journal of the Econometric Society, 40, 549–563.
Sornette, D. (2014). Physics and financial economics (1776–2014): Puzzles, ising and agent-based models. Reports on Progress in Physics, 77(6), 062001.
Sornette, D., & Zhou, W.-X. (2006). Importance of positive feedbacks and overconfidence in a self-fulfilling ising model of financial markets. Physica A: Statistical Mechanics and its Applications, 370(2), 704–726.
Teglio, A., Raberto, M., & Cincotti, S. (2012). The impact of banks’capital adequacy regulation on the economic system: An agent-based approach. Advances in Complex Systems, 15(supp02), 1250040.
Tesfatsion, L. (2002). Agent-based computational economics: Growing economies from the bottom up. Artificial Life, 8(1), 55–82.
Tesfatsion, L. (2006). Agent-based computational economics: A constructive approach to economic theory. Handbook of Computational Economics, 2, 831–880.
Timmermann, A. G. (1993). How learning in financial markets generates excess volatility and predictability in stock prices. The Quarterly Journal of Economics, 108(4), 1135–1145.
Tiwana, A., Wang, J., Keil, M., & Ahluwalia, P. (2007). The bounded rationality bias in managerial valuation of real options: Theory and evidence from it projects*. Decision Sciences, 38(1), 157–181.
Tobias, R., & Hofmann, C. (2004). Evaluation of free java-libraries for social-scientific agent based simulation. Journal of Artificial Societies and Social Simulation, 7(1), 1–6.
Trichet, J.-C. (2010). Reflections on the nature of monetary policy non-standard measures and finance theory, 11 2010. Introductory speech a the ECB Central Banking Conference, Frankfurt. Accessed 2016-05-13.
Trimborn, T., Otte, P., Cramer, S., Beikirch, M., Pabich, E., & Frank, M. Data set of sabcemm. https://publications.rwth-aachen.de/record/707265.
Walker, D. A. (2006). Walrasian economics. Cambridge: Cambridge University Press.
Walras, L. (1896). Éléments d’économie politique pure, ou, Théorie de la richesse sociale. Lausanne: F. Rouge.
Zhou, W.-X., & Sornette, D. (2007). Self-organizing ising model of financial markets. The European Physical Journal B, 55(2), 175–181.
Zschischang, E., & Lux, T. (2001). Some new results on the levy, levy and solomon microscopic stock market model. Physica A: Statistical Mechanics and its Applications, 291(1), 563–573.
Acknowledgements
T. Trimborn gratefully acknowledges support by Hans-Böckler Stiftung. T. Trimborn would like to thank the German Research Foundation DFG for the kind support within the Cluster of Excellence Internet of Production(Project-ID: 390621612). T. Trimborn gratefully acknowledges support by the RWTH Aachen University Start-Up grant. The work was partially funded by the Excel-lence Initiative of the German federal and state governments.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix
Appendix
1.1 Models
Cross Model We present the Cross model as defined in Cross et al. (2005).
We assume a fixed number of \(N\in {\mathbb {N}}\) agents. Each agent decides in each time step, whether he wants to be long or short in the market. Thus, the investment propensity \(\sigma _i,\ 1\le i\le N\) of each agent switches between \(\sigma _i=\pm 1\). The excess demand of all investors at time \([0,\infty )\) is then defined as:
Furthermore, the model introduces two pressures, the herding pressure and the inaction pressure, which control the switching mechanism.
The inaction pressure is defined by the interval
where \(m_i\) denotes the stock price of the last switch of agent i and \(\alpha _i>0\) is the so called inaction threshold. The herding pressure is given by:
The implementations of herding pressure and inaction pressure can be found in the Git repository,Footnote 7\(^{,}\)Footnote 8 respectively.
In addition, one defines the herding threshold\(\beta _i\). The thresholds are chosen once randomly from an i.i.d. random variable, which is uniformly distributed.
The constants \(B_1\) and \(B_2\) have to scale with time, since they correspond to the time units an investor can resist the herding pressure.
Switching Mechanism The switching is then induced if
After a switch the herding pressure is reset to zero and the inaction interval gets updated as well. The stock price is then driven by the excess demand:
where \(\kappa \) denotes the market depth and \(\Delta t >0\) the time step.
In SABCEMM, the price evolutionFootnote 9 is implemented as
with suitable FFootnote 10 and G.Footnote 11
Cross Model Extensions One alternative pricing function is given by:
Furthermore, we have added the wealth evolution, for a fixed interest rate \(r>0\) and fixed investment fraction \(\gamma \in (0,1)\):
LLS Model We have implemented the model as defined in Levy et al. (1994, 1995). In comparison to the original model, we introduce one possible time scaling. In order to obtain the original model one needs to set \(\Delta t=1\).
The model considers \(N\in {\mathbb {N}}\) financial agents who can invest \(\gamma _i\in [0.01, 0.99],\ i=1,\ldots ,N\) of their wealth \(w_i\in {\mathbb {R}}_{>0}\) in a stocks and have to invest \(1-\gamma _i\) of their wealth in a safe bond with interest rate \(r\in (0,1)\). The investment propensities \(\gamma _i\) are determined by a utility maximization and the wealth dynamic of each agent at time \(t\in [0,\infty )\) is given by
The dynamics is driven by a multiplicative dividend process. Given by:
where \({\tilde{z}}\) is a uniformly distributed random variable with support \([z_1,z_2]\). The price is fixed by the so called market clearance condition, where \(n\in {\mathbb {N}}\) is the fixed number of stocks and \(n_i(t)\) the number of stocks of each agent.
The utility maximization is given by
with
The constant \(m_i\) denotes the number of time steps each agent looks back. Thus, the number of time steps \(m_i\) and the length of the time step \(\Delta t\) defines the time period each agent extrapolates the past values. The superscript h indicates, that the stock price is uncertain and needs to be fixed by the market clearance condition. Finally, the computed optimal investment proportion gets blurred by a noise term.
where \(\epsilon _i\) is distributed like a truncated normally distributed random variable with standard deviation \(\sigma _{\gamma }\).
Utility Maximization Thanks to the simple utility function and linear dynamics we can compute the optimal investment proportion in the cases where the maximum is reached at the boundaries. The first order necessary condition is given by:
Thus, for \(f(0.01)<0\) we can conclude that \(\gamma _i=0.01\) holds. In the same manner, we get \(\gamma _i=0.99\), if \(f(0.01)>0\) and \(f(0.99)>0\) holds. Hence, solutions in the interior of [0.01, 0.99] can be only expected in the case: \(f(0.01)>0\) and \(f(0.99)<0\). This coincides with the observations in Samanidou et al. (2007).
Harras Model We present the Harras model as defined in Harras and Sornette (2011).
We consider N financial agents where each agent is equipped with a personal opinion \(\psi _i(t_k)\), and \(t_k\) denotes a discrete time step. The personal opinion is created through the personal information of each agent \(\epsilon _i(t_k)\), public information \(n(t_k)\) and the expected action of the surrounded neighbor j by the agent i, \(E_i[\sigma _j(t_k)], \sigma _j\in \{-1,0, 1\}\). The opinion of the i-th agent at time \(t_k\) reads:
During the evaluation of our simulations we noticed a significant difference in the magnitude of the price’s volatility. Our investigation leads us to the conclusion that the opinion of the i-th agent at time \(t_k\) should instead be:
The weights \((c_{1,i}, c_{2,i}, c_{3,i})\) are chosen initially for each agent from three uniformly distributed random variables on the domains \([0,C_l],\ l\in \{1, 2, 3 \}\). The private and public information \(\epsilon _i(t_k), n(t_k)\) are modeled as standard normally distributed i.i.d. random variables. The agents are grouped on a virtual square lattice with periodic boundary conditions, such that each agent has four neighbors. We update of the opinion of each agent is performed in each time step in random order. The additional factor \(k_{ij}\) weights the predicted action of the j-th agent based on the past performance. In the same manner the factor u weights the public information stream. The update rule of these weighting factors is given by:
with the constant \(0<\alpha <1\) and the volatility
where the brackets \(\langle \cdot \rangle \) denote the expected excess demand ED. The agent’s action on the market is then determined by a threshold of each agent. The threshold \({\bar{\psi }}_i\) is drawn from a uniform distribution in the interval \([0,\Omega ]\). The trading decision of each agent is characterized by \(\sigma _i=\pm 1\), where \(\sigma _i =1\) represents a buy order and \(\sigma =-1\) a sell order. We have
Furthermore, each agent tracks his number of stocks \(q_i\) and the cash \(w_i\) and thus the trading volume \(v_i(t_k)\) of each agent (in units of stocks) is given by
Here, \(S(t_k)\) denotes the stock price and \(g\in (0,1)\) a fixed fraction of wealth each agent wants to invest in stocks. The stock price is then driven by the excess demand \(ED(t_k)\)
where ED is defined as:
The constant \(\lambda >0\) represents the market depth. Finally, we want to state the update mechanism of \(w_i\) and \(q_i\).
1.2 Technical Details
-
Numerical Discretization With numerical discretization we refer to approximation concepts for time continuous ODEs. The most prominent numerical schemes are the explicit and implicit Euler discretization. We refer to Butcher (2016) for a detailed discussion.
-
Wiener Process A Wiener process is time continuous stochastic process and plays a prominent role in the definition of a stochastic integral. We refer to Evans (2012) for details.
-
Itô SDE The term Itô SDE refers to a SDE defined by the Itô stochastic integrals. In comparison to a differential equation a stochastic process is nowhere differentiable and therefore a SDE is in fact defined as an integral equation. In order to rigorously define an SDE one needs to define a stochastic integral in the first place. For details we refer to Evans (2012).
-
Stratonovich SDE The term Stratonovich SDE refers to a SDE defined by the Stratanovich stochastic integrals. In comparison to a differential equation a stochastic process is nowhere differentiable and therefore a SDE is in fact defined as an integral equation. In order to rigorously define an SDE one needs to define a stochastic integral in the first place. For details we refer to Evans (2012).
1.3 Parameter Sets
Cross Model For simulations using the Cross model, we use the parameters and initial values presented in Table 4.
LLS Model The initialization of the stock return is performed by creating an artificial history of stock returns. The artificial history is modeled as a Gaussian random variable with mean \(\mu _h\) and standard deviation \(\sigma _h\). Furthermore, we have to point out that the increments of the dividend is deterministic, if \(z_1=z_2\) holds. We used the C++ standard pseudo random number generator for all simulations of the LLS model if not otherwise stated. The parameters and initial values used for simulations using the LLS model are shown in Tables 5 and 6.
Harras Model The parameters and initial values used for simulations using the Harras Model are shown in Table 7.
1.4 Software
We aim to explain how we translate our abstract meta-model into software instructions. The centerpiece of our software is the calculation of the excess demand and the price calculator in each time step. Furthermore, one needs to update the action of each agent, which will depend on the stock price and probably on the excess demand.
Software Classification To facilitate the selection of a proper software tool for other researchers, we classify SABCEMM by the five categories of Nikolai and Madey (2009):
Programming language required to create a model or simulation
To introduce a new building block programming in C++ is required. From existing building blocks new models/simulations can be configured with XML input files.
Operating system required to run the toolkit
SABCEMM runs on POSIX (e.g. Linux, macOS) systems with a recent C++ compiler (e.g. g++-7Footnote 12) and CMakeFootnote 13 support.
Type of license governing the platform
We distribute our software under the 3-clause BSD license.Footnote 14 Accordingly it classifies as free and open-source.
Primary domain for which the toolkit is intended
Our software is designed for financial market simulations, i.e. it falls in the category Computational economics/Auction mechanisms. SABCEMM enables researchers to do large scale simulations with heterogeneous agent types.
Degree of support available to the user of the toolkit
A Reference Manual,Footnote 15 a User GuideFootnote 16 and further documentation is provided. Further, bugs and questions can be submitted on GitHub.
HDF5 The Hierarchical Data Format version 5 (HDF5) is a well-known hierarchical file format designed for scientific applications.Footnote 17 The corresponding libraries provides high performance serial and parallel I/O routines. Logically, the data within an HDF5 file is represented as a directory-tree like hierarchy of self-describing datasets, i.e. several datasets can be stored logically separated within a single file and datasets are equipped with a name and information describing data type, encoding, and shape. In addition, HDF5 provides on-the-fly compression of data written.
We decided to use HDF5 as main file format for SABCEMM to facilitate post-processing of the generated data. Data stored in datasets within an HDF5 file can easily be read using either the C and Fortran interfaces,Footnote 18 Python packages, such as h5py,Footnote 19 MATLAB (native support), and Microsoft Excel via the add-in PyHexad.Footnote 20 Finally, the HDF5 format allows us to embed the configuration file used in the generation of the results within the HDF5. This ensures reproducibility of results (besides of differences due to random numbers generated).
Rights and permissions
About this article
Cite this article
Trimborn, T., Otte, P., Cramer, S. et al. SABCEMM: A Simulator for Agent-Based Computational Economic Market Models. Comput Econ 55, 707–744 (2020). https://doi.org/10.1007/s10614-019-09910-1
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10614-019-09910-1