Conference Paper

Bayesian Calibration of Hyperparameters in Agent-Based Stock Market

Authors:
To read the full-text of this research, you can request a copy directly from the authors.

No full-text available

Request Full-text Paper PDF

To read the full-text of this research,
you can request a copy directly from the authors.

... Furthermore, there have been numerous comparative efforts to assess agent-based calibration methods, tailored to specific modeling domains. For instance, in the fields of economics [21], macroeconomics [20], and the stock market [28]. ...
... Furthermore, there have been numerous comparative efforts to assess agent-based calibration methods, tailored to specific modeling domains. For instance, in the fields of economics [21], macroeconomics [20], and the stock market [28]. ...
Conference Paper
Full-text available
Agent-based modeling and simulation is a practical computational technique for studying complex systems of autonomous agents in various disciplines. Agent-based models facilitate the study of emergent phenomena by simulating heterogeneous agents and their flexible behaviors and interactions. However, developing an agent-based model of a complex system is often time-consuming and vulnerable to the modeler's biases. Addressing this challenge requires a paradigm shift from knowledge-driven modeling to data-driven modeling. In this research, we initiate and experiment with automating the process of composing agent-based models by developing data-driven model extraction. To achieve this objective, we conduct experiments employing different variations of Schelling's segregation model, a well-known agent-based model, each featuring different parameter sets and complexity levels.
... In the literature, BO has been applied to calibrate agent-based models, but the objective function and the surrogate model are often chosen differently. [19] is the closest work to ours that we have found. However, they use the one-dimensional K-S statistic between daily return distributions, whereas we use a high-dimensional generalization of K-S statistic to compare the entire series distributions. ...
Preprint
Full-text available
Multi-agent market simulation is commonly used to create an environment for downstream machine learning or reinforcement learning tasks, such as training or testing trading strategies before deploying them to real-time trading. In electronic trading markets only the price or volume time series, that result from interaction of multiple market participants, are typically directly observable. Therefore, multi-agent market environments need to be calibrated so that the time series that result from interaction of simulated agents resemble historical -- which amounts to solving a highly complex large-scale optimization problem. In this paper, we propose a simple and efficient framework for calibrating multi-agent market simulator parameters from historical time series observations. First, we consider a novel concept of eligibility set to bypass the potential non-identifiability issue. Second, we generalize the two-sample Kolmogorov-Smirnov (K-S) test with Bonferroni correction to test the similarity between two high-dimensional time series distributions, which gives a simple yet effective distance metric between the time series sample sets. Third, we suggest using Bayesian optimization (BO) and trust-region BO (TuRBO) to minimize the aforementioned distance metric. Finally, we demonstrate the efficiency of our framework using numerical experiments.
Conference Paper
Applications of Machine Learning in Quantitative Investment and Wealth Management: -- when it works well -- when it does not work well -- why it does not work well I describe specific opportunities and challenges of leveraging machine learning within context of quantitative investment and wealth management. Such applications include forecasting of financial time series, classification of alternative data, identification of market regimes, clustering-based portfolio diversification, assessment of risk factors. The QWIM applications are categorized into areas and topics: 1) classification and pattern recognition, such as: -- classification and partition of the investment universe -- investing based on alternative data -- text analysis of company and regulatory documents -- sentiment analysis of news and social media -- ESG (Environmental, Social and Governance) investing -- fund decomposition, inference and replication 2) network analysis and clustering, such as: -- clustering-based portfolio optimization -- network-based portfolio optimization -- analysis of interconnectedness risk -- network effects on investment portfolios. 3) time series forecasting, such as: -- forecasting of financial time series -- empirical asset pricing 4) reinforcement learning, such as: -- pricing and hedging of financial derivatives -- optimal dynamic trading strategies -- portfolio construction -- goals-based investing 5) Other practical ML applications in QWIM include: -- synthetic financial data generation -- testing investment strategies and portfolios -- factor-based investment strategies -- nowcasting -- incorporating market states and regimes into investment portfolios. The presentation also describes some of the the challenges, including -- lack of sufficient data -- need to satisfy privacy, fairness and regulatory requirements -- model overfitting -- causality -- explainability and interpretability -- hyperparameter tuning
Article
Full-text available
A smart grid can be considered as a complex network where each node represents a generation unit or a consumer, whereas links can be used to represent transmission lines. One way to study complex systems is by using the agent-based modeling paradigm. The agent-based modeling is a way of representing a complex system of autonomous agents interacting with each other. Previously, a number of studies have been presented in the smart grid domain making use of the agent-based modeling paradigm. However, to the best of our knowledge, none of these studies have focused on the specification aspect of the model. The model specification is important not only for understanding but also for replication of the model. To fill this gap, this study focuses on specification methods for smart grid modeling. We adopt two specification methods named as Overview, design concept, and details and Descriptive agent-based modeling. By using specification methods, we provide tutorials and guidelines for model developing of smart grid starting from conceptual modeling to validated agent-based model through simulation. The specification study is exemplified through a case study from the smart grid domain. In the case study, we consider a large set of network, in which different consumers and power generation units are connected with each other through different configuration. In such a network, communication takes place between consumers and generating units for energy transmission and data routing. We demonstrate how to effectively model a complex system such as a smart grid using specification methods. We analyze these two specification approaches qualitatively as well as quantitatively. Extensive experiments demonstrate that Descriptive agent-based modeling is a more useful approach as compared with Overview, design concept, and details method for modeling as well as for replication of models for the smart grid.
Article
Full-text available
We outline a vision for an ambitious program to understand the economy and financial markets as a complex evolving system of coupled networks of interacting agents. This is a completely different vision from that currently used in most economic models. This view implies new challenges and opportunities for policy and managing economic crises. The dynamics of such models inherently involve sudden and sometimes dramatic changes of state. Further, the tools and approaches we use emphasize the analysis of crises rather than of calm periods. In this they respond directly to the calls of Governors Bernanke and Trichet for new approaches to macroeconomic modelling. Graphical abstract
Article
Full-text available
Time series of financial asset returns often exhibit the volatility clustering property: large changes in prices tend to cluster together, resulting in persistence of the amplitudes of price changes. After recalling various methods for quantifying and modeling this phenomenon, we discuss several economic mechanisms which have been proposed to explain the origin of this volatility clustering in terms of behavior of market participants and the news arrival process. A common feature of these models seems to be a switching between low and high activity regimes with heavy-tailed durations of regimes. Finally, we discuss a simple agent-based model which links such variations in market activity to threshold behavior of market participants and suggests a link between volatility clustering and investor inertia.
Article
Full-text available
In the recent past, a number of interesting agent-based financial market models have been proposed. These models successfully explain some important stylized facts of financial markets, such as bubbles and crashes, fat tails for the distribution of returns and volatility clustering. These models, reviewed, for instance, in Chen, Chang, and Du (in press); Hommes (2006); LeBaron (2006); Lux (in press); Westerhoff (2009), are based on the observation that financial market participants use different heuristic trading rules to determine their speculative investment positions. Note that survey studies by Frankel and Froot (1986);Menkhoff (1997);Menkhoff and Taylor (2007); Taylor and Allen (1992) in fact reveal that market participants use technical and fundamental analysis to assess financial markets. Agent-based financial market models obviously have a strong empirical microfoundation. Recall that technical analysis is a trading philosophy built on the assumption that prices tend to move in trends (Murphy, 1999). By extrapolating price trends, technical trading rules usually add a positive feedback to the dynamics of financial markets, and thus may be destabilizing. Fundamental analysis is grounded on the belief that asset prices return to their fundamental values in the long run (Graham and Dodd, 1951). Buying undervalued and selling overvalued assets, as suggested by these rules, apparently has a stabilizing impact on market dynamics. In most agent-based financial market models, the relative importance of these trading strategies varies over time. It is not difficult to imagine that changes in the composition of applied trading rules - such as a major shift from fundamental to technical trading rules - may have a marked impact on the dynamics of financial markets.
Article
Full-text available
We undertake a comprehensive investigation of price and volume co-movement using daily New York Stock Exchange data from 1928 to 1987. We adjust the data to take into account well-known calendar effects and long-run trends. To describe the process, we use a seminonparametric estimate of the joint density of current price change and volume conditional on past price changes and volume. Four empirical regularities are found: (i) positive correlation between conditional volatility and volume; (ii) large price movements are followed by high volume; (iii) conditioning on lagged volume substantially attenuates the “leverage” effect; and (iv) after conditioning on lagged volume, there is a positive risk-return relation.
Article
Full-text available
This paper reports statistical analyses performed on simulated data from a stochastic multi-agent model of speculative behaviour in a financial market. The price dynamics resulting from this artificial market process exhibits the same type of scaling laws as do empirical data from stock markets and foreign exchange markets: (i) one observes scaling in the probability distribution of relative price changes with a Pareto exponent around 2.6, (ii) volatility shows significant long-range correlation with a self-similarity parameter H around 0.85. This happens although we assume that news about the intrinsic or fundamental value of the asset follows a white noise process and, hence, incorporation of news about fundamental factors is insufficient to explain either of the characteristics (i) or (ii). As a consequence, in our model, the main stylised facts of financial data originate from the working of the market itself and one need not resort to scaling in unobservable extraneous signals as an explanation of the source of scaling in financial prices. The emergence of power laws can be explained by the existence of a critical state which is repeatedly approached in the course of the system's development.
Article
Full-text available
Macroeconomic models often assume that the choices of all the diverse agents in one sector—consumers for example—can be considered as the choices of one "representative" standard utility maximizing individual whose choices coincide with the aggregate choices of the heterogeneous individuals. My basic point is that the reduction of the behavior of a group of heterogeneous agents even if they are all themselves utility maximizers, is not simply an analytical convenience as often explained, but is both unjustified and leads to conclusions which are usually misleading and often wrong. First, such models are particularly ill-suited to studying macroeconomic problems like unemployment, which should be viewed as coordination failures. Furthermore these models, instead of being a hive of activity and exchange, are frequently, ones in which no trade at all takes place. And this is just the beginning of a list of problems with this approach. Finally I will consider more positive alternatives to the representative individual approach—approaches that focus on heterogeneity of agents may and interaction between individuals. It is clear that the "representative" agent deserves a decent burial, as an approach to economic analysis that is not only primitive, but fundamentally erroneous.
Article
Full-text available
We propose a theory of asset pricing based on heterogeneous agents who continually adapt their expectations to the market that these expectations aggregatively create. And we explore the implications of this theory computationally using our Santa Fe artificial stock market. Asset markets, we argue, have a recursive nature in that agents' expectations are formed on the basis of their anticipations of other agents' expectations, which precludes expectations being formed by deductive means. Instead traders continually hypothesize---continually explore---expectational models, buy or sell on the basis of those that perform best, and confirm or discard these according to their performance. Thus individual beliefs or expectations become endogenous to the market, and constantly compete within an ecology of others' beliefs or expectations. The ecology of beliefs co-evolves over time. Computer experiments with this endogenous-expectations market explain one of the more striking puzzles in fina...
Chapter
The principal model in economic theory is the Walrasian model of general economic equilibrium. In it, consumers choose to demand and supply goods to maximize a utility function subject to the constraint that the value of what they demand must equal the value of what they supply. Producers choose to demand and supply goods to maximize profits subject to the restrictions of a production technology. An equilibrium of this model is a vector of prices, one for each good, which the agents all take as given in solving their maximization problems, such that demand is equal to supply for every good. Economists use this type of model to do comparative statics analysis: they first compute a benchmark equilibrium for the model; they then change a parameter of the model such as a tax rate; finally they compare the new equilibrium with the benchmark. Large-scale empirical models are often used to do policy analysis (see, for example, Kehoe and Serra-Puche, 1983, and Shoven and Whalley, 1984).
Article
Taking agent-based models (ABM) closer to the data is an open challenge. This paper explicitly tackles parameter space exploration and calibration of ABMs combining supervised machine-learning and intelligent sampling to build a surrogate meta-model. The proposed approach provides a fast and accurate approximation of model behaviour, dramatically reducing computation time. In that, our machine-learning surrogate facilitates large scale explorations of the parameter-space, while providing a powerful filter to gain insights into the complex functioning of agent-based models. The algorithm introduced in this paper merges model simulation and output analysis into a surrogate meta-model, which substantially ease ABM calibration. We successfully apply our approach to the Brock and Hommes (1998) asset pricing model and to the "Island" endogenous growth model (Fagiolo and Dosi, 2003). Performance is evaluated against a relatively large out-of-sample set of parameter combinations, while employing different user-defined statistical tests for output analysis. The results demonstrate the capacity of machine learning surrogates to facilitate fast and precise exploration of agent-based models' behaviour over their often rugged parameter spaces.
Article
Financial markets (share markets, foreign exchange markets and others) are all characterized by a number of universal power laws. The most prominent example is the ubiquitous finding of a robust, approximately cubic power law characterizing the distribution of large returns. A similarly robust feature is long-range dependence in volatility (i.e., hyperbolic decline of its autocorrelation function). The recent literature adds temporal scaling of trading volume and multi-scaling of higher moments of returns. Increasing awareness of these properties has recently spurred attempts at theoretical explanations of the emergence of these key characteristics form the market process. In principle, different types of dynamic processes could be responsible for these power-laws. Examples to be found in the economics literature include multiplicative stochastic processes as well as dynamic processes with multiple equilibria. Though both types of dynamics are characterized by intermittent behavior which occasionally generates large bursts of activity, they can be based on fundamentally different perceptions of the trading process. The present paper reviews both the analytical background of the power laws emerging from the above data generating mechanisms as well as pertinent models proposed in the economics literature.
Article
In this paper we introduce a calibration procedure for validating of agent based models. Starting from the well-known financial model of (. Brock and Hommes, 1998), we show how an appropriate calibration enables the model to describe price time series. We formulate the calibration problem as a nonlinear constrained optimization that can be solved numerically via a gradient-based method. The calibration results show that the simplest version of the Brock and Hommes model, with two trader types, fundamentalists and trend-followers, replicates nicely the price series of four different markets indices: the S&P 500, the Euro Stoxx 50, the Nikkei 225 and the CSI 300. We show how the parameter values of the calibrated model are important in interpreting the trader behavior in the different markets investigated. These parameters are then used for price forecasting. To further improve the forecasting, we modify our calibration approach by increasing the trader information set. Finally, we show how this new approach improves the model's ability to predict market prices.
Article
We present a consumption-based model that explains a wide variety of dynamic asset pricing phenomena, including the procyclical variation of stock prices, the long-horizon predictability of excess stock returns, and the countercyclical variation of stock market volatility. The model captures much of the history of stock prices from consumption data. It explains the short- and long-run equity premium puzzles despite a low and constant risk-free rate. The results are essentially the same whether we model stocks as a claim to the consumption stream or as a claim to volatile dividends poorly correlated with consumption. The model is driven by an independently and identically distributed consumption growth process and adds a slow-moving external habit to the standard power utility function. These features generate slow countercyclical variation in risk premia. The model posits a fundamentally novel description of risk premia: Investors fear stocks primarily because they do poorly in recessions unrelated to the risks of long-run average consumption growth.
Article
Grid search and manual search are the most widely used strategies for hyper-parameter optimization. This paper shows empirically and theoretically that randomly chosen trials are more efficient for hyper-parameter optimization than trials on a grid. Empirical evidence comes from a comparison with a large previous study that used grid search and manual search to configure neural networks and deep belief networks. Compared with neural networks configured by a pure grid search, we find that random search over the same domain is able to find models that are as good or better within a small fraction of the computation time. Granting random search the same computational budget, random search finds better models by effectively searching a larger, less promising configuration space. Compared with deep belief networks configured by a thoughtful combination of manual search and grid search, purely random search over the same 32-dimensional configuration space found statistically equal performance on four of seven data sets, and superior performance on one of seven. A Gaussian process analysis of the function from hyper-parameters to validation set performance reveals that for most data sets only a few of the hyper-parameters really matter, but that different hyper-parameters are important on different data sets. This phenomenon makes grid search a poor choice for configuring algorithms for new data sets. Our analysis casts some light on why recent "High Throughput" methods achieve surprising success--they appear to search through a large number of hyper-parameters because most hyper-parameters do not matter much. We anticipate that growing interest in large hierarchical models will place an increasing burden on techniques for hyper-parameter optimization; this work shows that random search is a natural baseline against which to judge progress in the development of adaptive (sequential) hyper-parameter optimization algorithms.
Book
The Minority Game is a physicist's attempt to explain market behaviour by the interaction between traders. With a minimal set of ingredients and drastic assumptions, this model reproduces market ecology among different types of traders. Its emphasis is on speculative trading and information flow. The book first describes the philosophy lying behind the conception of the Minority Game in 1997, and includes in particular a discussion about the El Farol bar problem. Then it reviews the main steps in later developments, including both the theory and its applications to market phenomena. This book gives a colourful and stylized, but also realistic picture of how financial markets operate.
Article
Machine learning algorithms frequently require careful tuning of model hyperparameters, regularization terms, and optimization parameters. Unfortunately, this tuning is often a "black art" that requires expert experience, unwritten rules of thumb, or sometimes brute-force search. Much more appealing is the idea of developing automatic approaches which can optimize the performance of a given learning algorithm to the task at hand. In this work, we consider the automatic tuning problem within the framework of Bayesian optimization, in which a learning algorithm's generalization performance is modeled as a sample from a Gaussian process (GP). The tractable posterior distribution induced by the GP leads to efficient use of the information gathered by previous experiments, enabling optimal choices about what parameters to try next. Here we show how the effects of the Gaussian process prior and the associated inference procedure can have a large impact on the success or failure of Bayesian optimization. We show that thoughtful choices can lead to results that exceed expert-level performance in tuning machine learning algorithms. We also describe new algorithms that take into account the variable cost (duration) of learning experiments and that can leverage the presence of multiple cores for parallel experimentation. We show that these proposed algorithms improve on previous automatic procedures and can reach or surpass human expert-level optimization on a diverse set of contemporary algorithms including latent Dirichlet allocation, structured SVMs and convolutional neural networks.
Article
This chapter surveys work on dynamic heterogeneous agent models (HAMs) in economics and finance. Emphasis is given to simple models that, at least to some extent, are tractable by analytic methods in combination with computational tools. Most of these models are behavioral models with boundedly rational agents using different heuristics or rule of thumb strategies that may not be perfect, but perform reasonably well. Typically these models are highly nonlinear, e.g. due to evolutionary switching between strategies, and exhibit a wide range of dynamical behavior ranging from a unique stable steady state to complex, chaotic dynamics. Aggregation of simple interactions at the micro level may generate sophisticated structure at the macro level. Simple HAMs can explain important observed stylized facts in financial time series, such as excess volatility, high trading volume, temporary bubbles and trend following, sudden crashes and mean reversion, clustered volatility and fat tails in the returns distribution.
Article
Following a long tradition of physicists who have noticed that the Ising model provides a general background to build realistic models of social interactions, we study a model of financial price dynamics resulting from the collective aggregate decisions of agents. This model incorporates imitation, the impact of external news and private information. It has the structure of a dynamical Ising model in which agents have two opinions (buy or sell) with coupling coefficients, which evolve in time with a memory of how past news have explained realized market returns. We study two versions of the model, which differ on how the agents interpret the predictive power of news. We show that the stylized facts of financial markets are reproduced only when agents are overconfident and mis-attribute the success of news to predict return to herding effects, thereby providing positive feedbacks leading to the model functioning close to the critical point. Our model exhibits a rich multifractal structure characterized by a continuous spectrum of exponents of the power law relaxation of endogenous bursts of volatility, in good agreement with previous analytical predictions obtained with the multifractal random walk model and with empirical facts.
Article
We present a tutorial on Bayesian optimization, a method of finding the maximum of expensive cost functions. Bayesian optimization employs the Bayesian technique of setting a prior over the objective function and combining it with evidence to get a posterior function. This permits a utility-based selection of the next observation to make on the objective function, which must take into account both exploration (sampling from areas of high uncertainty) and exploitation (sampling areas likely to offer improvement over the current best observation). We also present two detailed extensions of Bayesian optimization, with experiments---active user modelling with preferences, and hierarchical reinforcement learning---and a discussion of the pros and cons of Bayesian optimization based on our experiences.
Article
Recent studies argue that the spread-adjusted Taylor rule (STR), which includes a response to the credit spread, replicates monetary policy in the United State. We show (1) STR is a theoretically optimal monetary policy under heterogeneous loan interest rate contracts in both discretionay and commitment monetary policies, (2) however, the optimal response to the credit spread is ambiguous given the financial market structure in theoretically derived STR, and (3) there, a commitment policy is effective in narrowing the credit spread when the central bank hits the zero lower bound constraint of the policy rate.
Article
We propose a theory of asset pricing based on heterogeneous agents who continually adapt their expectations to the market that these expectations aggregatively create. And we explore the implications of this theory computationally using our Santa Fe artificial stock market.
Article
To the extent that intervention induces technical trading profitability, trading rules may generate profit opportunities in the spot foreign exchange markets of developing countries. The vast majority of the developing countries examined generate statistically significant out-of-sample returns, assuming transaction costs are 0.50%. Break-even transaction costs range from 0.36 to 22.27%. There is some evidence that the profitability of trading rules is related to the potential for intervention. The risk-adjusted performance measures indicate that trading rules do not outperform a simple short-selling strategy or risk-free strategy, and the trading rules are found to significantly underperform a risk-free strategy for Brazil.
Article
This paper concerns the relationship between the variability of the daily price change and the daily volume of trading on the speculative markets. Our work extends the theory of speculative markets in two ways. First, we derive from economic theory the joint probability distribution of the price change and the trading volume over any interval of time within the trading day. And second, we determine how this joint distribution changes as more traders enter (or exit from) the market. The model's parameters are estimated by FIML using daily data from the 90-day T-bills futures market. The results of the estimation can reconcile a conflict between the price variability-volume elationship for this market and the relationship obtained by previous investigators for other speculative markets.
Article
The paper provides a survey of the work that has been done in financial econometrics in the past decade. It proceeds by first establishing a set of stylized facts that are characteristics of financial series and then by detailing the range of techniques that have been developed to model series which possess these characteristics. Both univariate and multivariate models are considered.
Article
In this paper we analyze a credit economy � la Kiyotaki and Moore [1997. Credit cycles. Journal of Political Economy 105, 211-248] enriched with learning dynamics, where both borrowers and lenders need to form expectations about the future price of the collateral. We find that under homogeneous learning, the MSV REE for this economy is E-stable and can be learned by agents, but when heterogeneous learning is allowed and uncertainty in terms of a stochastic productivity is added, expectations of lenders and borrowers can diverge and lead to bankruptcy (default) on the part of the borrowers.