<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Simulating Heterogeneous Portfolio Choices and Financial Market Outcomes</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sebastian Benthall</string-name>
          <xref ref-type="aff" rid="aff4">4</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christopher D. Carroll</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zachary David</string-name>
          <xref ref-type="aff" rid="aff6">6</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>John Liechty</string-name>
          <xref ref-type="aff" rid="aff5">5</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alan Lujan</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christopher McComb</string-name>
          <xref ref-type="aff" rid="aff3">3</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nicholas Skar-Gislinge</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Copenhagen Center for Social Data Science, University of Copenhagen</institution>
          , Ø
          <addr-line>ster Farimagsgade 5 1353 Copenhagen K</addr-line>
          ,
          <country country="DK">Denmark</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Economics, 590 Wyman Hall, Johns Hopkins University</institution>
          ,
          <addr-line>Baltimore, MD 21218</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Department of Economics, The Ohio State University</institution>
          ,
          <addr-line>410 Arps Hall, 1945 N. High St., Columbus, OH 43210</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Department of Mechanical Engineering, Carnegie Mellon University</institution>
          ,
          <addr-line>5000 Forbes Ave, Pittsburgh, PA 15213</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff4">
          <label>4</label>
          <institution>New York University School of Law</institution>
          ,
          <addr-line>40 Washington Square South, New York, NY 10012</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff5">
          <label>5</label>
          <institution>Smeal College of Business, Penn State University</institution>
          ,
          <addr-line>University Park, PA 16802</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff6">
          <label>6</label>
          <institution>Urvin Finance</institution>
          ,
          <addr-line>Washington, DC 20015</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Explaining the causes of financial crises requires relaxing some of the assumptions traditionally made by macroeconomic theory. We are able to simulate market crashes when consumer households have heterogeneous expectations of asset prices. These consumers earn, consume, and allocate their savings to either a risky or risk-free asset. As a departure from most macroeconomic models, the price of the risky asset is determined by a realistic agent-based simulation of a stock market, rather than through an idealized frictionless market model. Only a subset of agents in the market, the institutional investors, price the asset according to a rational expectations strategy based on an observed signal of the asset's fundamental value. The consumers try to infer this fundamental value from the noisy price signal under bounded rationality conditions that limit their memory of and access to the price process. The consumers pass all of their buy and sell orders to the market in aggregate through a broker. This dynamic process of strategic interaction between heterogeneous macroeconomic agents and the agent-based ifnancial market determines a new equilibrium price. We find that when the consumers have enough market power to overwhelm the institutional investors, the market will fail by driving the price of the risky asset to zero. This shows how one form of bounded rationality - ignorance about fundamental asset value - can contribute to financial crises. We also find that increasing the consumer market power leads to an increase in volatility (and a decrease in the price) of the risky asset. This suggests that there is an asymmetry whereby consumption dampens asset bubbles while accelerating price collapses.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Heterogeneous Agent Modeling</kwd>
        <kwd>Agent-Based Models</kwd>
        <kwd>Financial Markets</kwd>
        <kwd>Market Microstructure</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The dynamics of the macroeconomy are of nearly universal concern. But despite its importance,
the science used to study the macroeconomy is still unable to predict and adequately respond to
large financial market shocks, such as the Financial Crisis of 2007-2008. This is, in part, because
economists traditionally have preferred parsimonious models of the economy with several
well-motivated simplifying assumptions designed to characterize the economy’s aggregate and
general equilibrium behavior. This traditional theory of the macroeconomy, however, left the
United States ill-prepared for the 2008 Financial Crisis, which involved dynamics that these
simplified models ruled out or assumed away. Since that crisis, macroeconomics and adjacent
ifnancial researchers have explored models that relax these traditional assumptions. This paper
presents one such modeling efort.</p>
      <p>One obstacle to modeling financial crises is the rational expectations assumption, according
to which all agents in the model know the model’s information. Typically, this allows agents to
converge on a price and prevents market failures. In our model, consumer households have
heterogeneous expectations based on boundedly rational access to price history. Prices are
determined by the interactions, via a broker, of the consumers’ investing decisions with an
agent-based model (ABM) of a financial market, populated by realistic financial actors such as
institutional investors, market makers, and trend followers. Thus, we build on heterogeneous
agent modeling (HAM) techniques to design an experiment in which consumers have
heterogeneous expectations, are a departure from traditional representative agent assumptions. We
ifnd that the more market power that is wielded by boundedly rational consumer households
relative to informed, fundamentalist institutional investors, the more likely the market is to
crash to a price of $0.</p>
      <sec id="sec-1-1">
        <title>The Frontier of Macroeconomic and Financial Research</title>
        <p>
          A traditional assumption of macroeconomics has been rational expectations [
          <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
          ]. In a rational
expectations model, agents’ beliefs about uncertain outcomes are governed by equations that
ensure that those beliefs are accurate with respect to the predictions of a model used by the
agent. In a rational expectations model, an agent’s beliefs about uncertain outcomes reflect the
model’s true environment such that the agents’ predictions about future outcomes are accurate
on average. This is a powerful constraint that in many cases ensures an equilibrium by inducing
a feedback loop where agents can anticipate the environment and subsequently the agents’
actions are predictable. However, rational expectations models assume away many bounded
rationality conditions, which can arise because humans have limited cognitive capacity–e.g.,
limited ability to pay attention to information. These conditions are known to be both realistic
and salient to the interactions between the macroeconomy and the financial system and leaving
them out can lead to dramatically diferent dynamics compared to real-world phenomena. New
methods of Agent-based Computational Economics have emerged to study macroeconomics
and financial markets as dynamic systems of many interacting agents without the rational
expectations constraint [
          <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
          ].
        </p>
        <p>In our model, we relax the rational expectations assumption for the consumer households in
the model. Instead, households employ a boundedly rational learning process that uses historical
market pricing data to inform present beliefs about expected future rates of return. Agents in
our model have a memory function that determines their weighting of historical prices. This
function is parameterized to account for the relative importance of recent and past prices. These
agents also have limits on their ability to attend to price information from the market.</p>
        <p>
          Instead of using an unrealistic frictionless market clearing mechanism typical of rational
expectations models, we instead draw on financial research methods and use an agent-based
model (ABM) to simulate the financial market’s role in changes to asset prices. The use of ABMs
for modeling the financial market is yet another methodological shift in financial research made
in response to the 2008 financial crisis [
          <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
          ]. We build on a detailed agent-based simulated market,
mimicking many of the features of a modern electronic market, and connect it programmatically
to the households in the macroeconomy. The financial ABM is calibrated to several stylized
facts about the financial system but is not itself amenable to a closed-form description. Hence,
the use of the ABM reinforces the need for agents to have boundedly rational expectations of
the market’s performance.
        </p>
        <p>
          A major development in macroeconomics in the last few decades has been the shift from
Representative Agent (RA) modeling to Heterogeneous Agent Modeling (HAM). Earlier RA
approaches modeled an entire sector of an economy as a single “representative agent". This
approach, equivalent to a mean-field theory approach in physics, is appropriate when the aggregate
dynamics of a system can be characterized by the central limit theorem, but otherwise breaks
down [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. The advancement of computational technology along with innovations in numerical
methods has allowed economists to develop models that incorporate important diferences
across agents. For example, recent work in agent-based macroeconomics has developed models
of heterogeneous expectations [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. HAM builds on earlier work that shows how heterogeneity
in the population can explain wealth inequality [
          <xref ref-type="bibr" rid="ref10 ref11 ref9">9, 10, 11</xref>
          ] as well as allowing economists to
explicitly study the consequences of heterogeneity in, for example, time preference rate, age,
and education on the marginal propensity to consume [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. This shift towards HAM has
contributed to better modeling of responses to crises from exogenous shocks, such as the COVID-19
pandemic, and the tailoring of policy responses [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>
          In this paper, we present an integrated HAM-ABM approach that builds on [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] by considering
heterogeneity not only on discount factor but also on the coeficient of risk aversion. Our toy
economy consists of six sub-populations each characterized by a discount factor  (reflecting
the agent’s view of the time value of money) and a coeficient of constant relative risk aversion
 (meaning that the proportion of their wealth that the agents will be willing to hold in the
risky asset will decrease as their wealth increases, but at diferent rates depending on the value
of  ). These diferent subpopulations have predictable diferences in their target levels of wealth
(again based on the subpopulation’s value of  ), which are reflected in our model results. These
diferent subpopulations may also engage the financial system diferently and in a way that
contributes to the overall price dynamics of the risky asset. We employ HARK (Heterogeneous
Agent Resources and toolKit) [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], an open-source software toolkit for heterogeneous agent
modeling, to build this part of the simulation. In our model, these households play the role of
both consumers and retail investors.
        </p>
        <p>This combination of boundedly rational expectations of asset prices, an ABM financial model,
and heterogeneous agent modeling puts our model at the frontier of macroeconomic and
ifnancial research.</p>
        <p>We find that the boundedly rational and heterogenous retail investing households (identified
below as HARK agents) ‘break’ the simulation (force prices to $0 or over $5,000, with a starting
value of $100) as their relative market power increases relative to the institutional investors
1. This market power increases as more HARK agents pay attention to the risky asset (and
consequently invest) and as the conversion rate between the macroeconomy (HARK) currency
and the financial market (identified below as AMMPS (Agent-Market Modeling Platform and
Simulator) currency increases. Interestingly a stronger dividend rate moderates the negative
impact of their market power. One interpretation of this result is that the more that capital is
unhinged from direct signals of fundamental asset value (in our case, the most recent dividend
information), the more likely markets are to thrash and crash.</p>
        <p>We also find that an increase in the HARK agent’s market power leads to an increase in
volatility (and a decrease in the price) of the risky asset. Our results suggest that consumer
behavior dampens asset bubbles while accelerating price collapses. The HARK agents’ behaviors
are asymmetric, in that they tend to ‘deflate’ asset bubbles. It is currently unknown whether this
is due to their increasing consumption as their wealth increases, to investing less of their income
in the risky asset, or actually selling some of their risky asset holdings in order to supplement
their income as they consume more than they make. On the other hand, when the risky asset
has a negative price run this can evolve into a price collapse, as the desire of the HARK agents
to consume is not diminished suficiently to stop the sellof. As a result, increased volatility
appears to be related more to persistent negative price runs as compared to persistent asset
bubbles. We note that the lack of clarity on this point, suggests ways in which our simulation
platform could be improved, such as by devising summaries of the risky asset’s price process, for
each simulation run, that can reasonably distinguish between asset bubbles and price collapses.</p>
      </sec>
      <sec id="sec-1-2">
        <title>Organization</title>
        <p>The paper is organized as follows. In Section 2, we give an overview of the integrated model
that combines both the HAM, HARK, model and the ABM financial market model. , In Section 3,
we describe the design of our simulation study its parameters. Section 4 reports the results of
the simulation. Section 5 discusses ways in which the simulation could be improved to make it
both more robust as well as more realistic. There is also a Technical Appendix which describes
more details of the model.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. The Integrated Model Simulation Platform</title>
      <p>The core innovation of this paper is the integration of a heterogeneous agent model (HAM) of
the macroeconomy (the HARK model) with an agent-based model (ABM) of a financial market
1We have identified these boundaries of ‘breaking’ the simulation because it is not reasonable to have a collapse
in the price to 0 when the stock is still providing a dividend and it is correspondingly not reasonable to have a
price that is more than a 50 fold increase of the starting value, over no more than 8 quarters, when the average
rate of growth is around 10% per year. We acknowledge that a factor of 50x for the upper bound is arbitrary, but
it seemed a reasonable guess to start.</p>
      <sec id="sec-2-1">
        <title>Institutional Investor</title>
      </sec>
      <sec id="sec-2-2">
        <title>Broker</title>
      </sec>
      <sec id="sec-2-3">
        <title>Daily dividend rate and intraday prices</title>
      </sec>
      <sec id="sec-2-4">
        <title>Strategy</title>
      </sec>
      <sec id="sec-2-5">
        <title>Lucas asset price</title>
      </sec>
      <sec id="sec-2-6">
        <title>Aggregate consumer Executes all orders orders across the trading day</title>
      </sec>
      <sec id="sec-2-7">
        <title>Market Maker</title>
      </sec>
      <sec id="sec-2-8">
        <title>Intraday prices</title>
      </sec>
      <sec id="sec-2-9">
        <title>Technical Traders</title>
      </sec>
      <sec id="sec-2-10">
        <title>Intraday prices</title>
        <p>0-Information Traders</p>
      </sec>
      <sec id="sec-2-11">
        <title>None</title>
      </sec>
      <sec id="sec-2-12">
        <title>Consumers</title>
      </sec>
      <sec id="sec-2-13">
        <title>Daily prices</title>
      </sec>
      <sec id="sec-2-14">
        <title>Heterogeneity</title>
      </sec>
      <sec id="sec-2-15">
        <title>Assumptions about consumer risk aversion and discount factors</title>
      </sec>
      <sec id="sec-2-16">
        <title>Diferent technical indicators, memory and thresholds for entry and exit</title>
      </sec>
      <sec id="sec-2-17">
        <title>Place bid and ask quotes around current mid price to minimize inventory</title>
      </sec>
      <sec id="sec-2-18">
        <title>Trend following and mean reversion</title>
      </sec>
      <sec id="sec-2-19">
        <title>Executes random orders</title>
      </sec>
      <sec id="sec-2-20">
        <title>Invest based on in- Risk aversion and ferred asset value discount factor</title>
        <p>for exchanging (and setting the price of) a risky asset (the Financial Market model). The
assumptions of the model are summarized in Table 2. A graphical overview of the integrated
system is given in Figure 1. In this section, we give an overview of both the HARK macroeconomy
and the AMMPS ABM financial market components of our integrated simulation framework.
The sources of information and strategies of the agents in the combined model is summarized
in table 1.
2.1. The HARK Macroeconomy Component
Agents in the HARK model are endowed with wealth and income and have diferent risk
preferences and discount factors. The HARK agents experience random shocks to their wealth and
income during the process of the simulation (mimicking changes in employment, inheritances,
disabilities, and so on). The primary tasks of the HARK agents are to determine the amount of
wealth to consume each period, and then how much wealth to invest in a risky asset (akin to a
market index like the S&amp;P 500) and a risk-less asset (akin to a government bond).</p>
        <p>Typically the allocation is done once a quarter, based on the HARK agent’s view of the mean
Assets</p>
      </sec>
      <sec id="sec-2-21">
        <title>Risky Asset</title>
      </sec>
      <sec id="sec-2-22">
        <title>Riskless Asset</title>
        <p>Agents</p>
      </sec>
      <sec id="sec-2-23">
        <title>Institutions</title>
      </sec>
      <sec id="sec-2-24">
        <title>Zero</title>
      </sec>
      <sec id="sec-2-25">
        <title>Traders</title>
      </sec>
      <sec id="sec-2-26">
        <title>Information</title>
      </sec>
      <sec id="sec-2-27">
        <title>Technical Traders</title>
      </sec>
      <sec id="sec-2-28">
        <title>Market Makers</title>
      </sec>
      <sec id="sec-2-29">
        <title>Brokers</title>
      </sec>
      <sec id="sec-2-30">
        <title>Consumers</title>
      </sec>
      <sec id="sec-2-31">
        <title>Yields daily dividends modelled as an exogenous random walk, subject to a lognormal shock each day. Dividends are assumed to be reinvested in the market for all agents except for consumers.</title>
      </sec>
      <sec id="sec-2-32">
        <title>Yields a zero rate of return.</title>
        <p>Employ the fundamental Lucas asset pricing model and
consider the price of the risky asset to be determined
solely by its dividends. These agents have limited
liquidity and exhibit heterogeneous views regarding the
relationship between dividends and asset prices,
representing diferent views of the discount factor and risk
aversion of the economy’s consumers.</p>
      </sec>
      <sec id="sec-2-33">
        <title>Trade for reasons unrelated to the model, adding a flow</title>
        <p>of orders that induce fluctuations in supply and demand.</p>
      </sec>
      <sec id="sec-2-34">
        <title>Have a long term net zero position in the market.</title>
      </sec>
      <sec id="sec-2-35">
        <title>Form trading signals based solely on past price history and do not consider fundamental prices for the risky asset.</title>
      </sec>
      <sec id="sec-2-36">
        <title>Supply liquidity by submitting limit orders on both sides</title>
        <p>of the market. They adjust their prices in order to
maintain an average net zero position in the risky asset and
adjust the width of their bid-ask spread in response to
volatility.</p>
      </sec>
      <sec id="sec-2-37">
        <title>Execute the trading volume of consumers across the</title>
        <p>trading day, but do not take into account the asset price.</p>
        <p>Consume out of wealth and save in risky and riskless
asset. Receive uncertain income with transitory and
permanent shocks. Use previous day’s closing market price
to determine their demand for the risky asset, which is
executed by brokers. They have limited attention and
only participate in the market sporadically. They price
the risky asset using the Lucas asset pricing model and
infer the dividends process from the asset price. Vary by
discount factor and relative risk aversion.
and variance of the risky asset and the equity premium (the diference between the mean return
of the risky asset and the risk-free return of the safe asset). We expand the HARK framework
to mimic more realistic asset allocation behavior by agents (consumers) in the macroeconomy.
These agents can be viewed as retail investors. A random subset of these agents make their
allocation decisions each day, as opposed to all of the agents making their allocation decisions
on the same day, once a quarter. Each day the total quantities of the risky asset that these agents
want to either buy or sell are aggregated and sent to a Buy Broker and Sell Broker, respectively.
These brokers then proceed to buy or sell on behalf of the agents in the financial market, where
they interact with and compete with other financial market agents within the AMMPS ABM
component of the simulation. The price for the risky asset is then determined by simulating
one day of trading using the AMMPS financial market ABM, which includes the Buy Broker and
Sell Broker, market makers, and institutional investors that are choosing a target price based on
an exogenous dividend process. At the end of the trading day, the wealths of the macro agents
are adjusted based on the closing price and dividend.</p>
        <p>One of the key elements of the HARK simulation that we explore, in addition to the proportion
of agents that pay attention to the market during a day, is how the agents make inferences
about (or guess) the mean and variance of the risky asset–a key component to their calculation
regarding how much of the risky asset to hold. In particular, we introduce a scheme for weighting
the impact of the historic mean and variance of the price process along with the observed price
process generated during the simulation. For some parameter values in this scheme, the HARK
agents essentially always use the historical mean and variance of the risky asset, for other
parameter values, they have a ‘relatively’ short memory with regards to the price of the risky
asset and essentially disregard all but the last few weeks of price movements. The other major
consideration that we parameterize and vary over the course of the simulation is the relative
economic size of the HARK agents (in terms of the average number of shares of the risky asset)
relative to the ABM agents in the AMMPS component. Due to page restrictions, a detailed
discussion of the HARK algorithm and how the parameter values impact the weighting scheme
are included in the accompanying Technical Appendix B.
2.2. The AMMPS ABM Financial Market Component
The AMMPS ABM simulated financial market, includes Institutional Investors, Market Makers,
Buy and Sell Brokers, and a variety of noise traders. Below we give a sense of how the first three
of these agents operate (with full details, along with details about the noise traders, given in the
Technical Appendix C). A key feature of this simulation platform is that the market features a
price time priority matching engine processing agent messages and sending market data in a
FIX like format.</p>
        <sec id="sec-2-37-1">
          <title>Institutional Investors</title>
          <p>
            The institutional agent represents so-called ‘buy side’ market participants that take large
positions in the market, which are executed across the trading day using a constant participation
execution algorithm in order to minimize their market impact. The agents use a Lucas asset
price model [
            <xref ref-type="bibr" rid="ref15">15</xref>
            ] where their current estimate of the value of the dividend is used in order to
determine a fundamental value for the risky asset. Deviations in the price from this fundamental
value trigger large-scale buying or selling, which is halted when the target position has been
reached with regards to the agents’ fundamental price.
          </p>
          <p>The market maker agents are the primary source of liquidity in the financial market simulation
ecosystem. Market makers want to profit by facilitating trades to both buyers and sellers,
typically placing passive orders at many diferent price levels simultaneously so that their
orders are at the front of the queue for each price level in the market’s central limit order book.
This gives them favorable time priority compared to signal-based agents. To profit from liquidity
provision rather than short-term or long-term price trends, the agents frequently adjust their
passive orders to try to trade equally on both sides of the market while achieving an average
sell price that is higher than the average buy price. The particular pricing logic used by the
Market Makers is detailed in Technical Appendix C.</p>
        </sec>
        <sec id="sec-2-37-2">
          <title>Buy and Sell Brokers</title>
          <p>The broker agents form the link between the macroeconomy, the HARK agents, and the
AMMPS ABM financial markets by buying and selling on behalf of the HARK agents. Each time
the market opens the Buy and Sell Brokers receive the buy and sell volume targets from the
subset of the HARK agents who are paying attention to the risky asset that day. The buy and sell
volumes are executed by the Buy or Sell Broker respectively, evenly across the day–but with an
acceleration in trading towards the end of the day, if needed, in order execute all of the orders
from the HARK agents. At the end of the day the Buy and Sell Brokers send the closing price
back to the macro agents.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Simulation Study</title>
      <p>Using the integrated model simulation platform, we conducted a simulation study where we
sought to determine the impact of: 1) attention to whether to trade, 2) attention to price history,
1
2
Dividend Growth Rate
Dollars per HARK
Money Unit</p>
      <sec id="sec-3-1">
        <title>Description</title>
      </sec>
      <sec id="sec-3-2">
        <title>Probability that a HARK agent pays attention and re-balances their portfolio.</title>
      </sec>
      <sec id="sec-3-3">
        <title>Decay rate governing how HARK agents weight</title>
        <p>the price generated during the simulation.</p>
      </sec>
      <sec id="sec-3-4">
        <title>Decay rate governing how HARK agents weight</title>
        <p>simulation data vs. historical mean and variance.</p>
      </sec>
      <sec id="sec-3-5">
        <title>The mean of the lognormal shock to the dividend of the risky asset.</title>
      </sec>
      <sec id="sec-3-6">
        <title>Scaling factor   between units of</title>
        <p>wealth used by the HARK agents and ‘dollars’
used to buy and sell the risky asset.
3) the level of dividends, and 4) the amount of the money scaling factor,  , on the mean
and volatility of the price process (as a way of measuring asset bubbles and asset collapses) and
the overall level and distribution of wealth among the HARK agents.</p>
        <p>The HARK part of the simulation is written in Python and is available under an open-source
license. Further the simulated market for the risky asset (the financial market) is built in an
agent-based simulation framework called AMMPS, written in C#. Future versions of this ABM
platform are intended to be made available under an open-source license. The HARK Python
code communicated with the AMMPS C# code via RabbitMQ, which was deployed in batch
manner using containers in the Azure cloud system.
3.1. Structure of Simulation Study
We varied five parameters over a grid. All of the remaining parameters were set to values that
gave us reasonable behavior from the integrated system. For each combination of parameters,
we ran 15 versions of the integrated model (each with 8 quarters of 60 simulated 6.5 hour
trading days).</p>
        <p>The five simulation parameters (and their values)–which vary the HARK agents’ attention
and memory, the rate at which the dividend of the risky asset grows, and the relative size of the
HARK agents impact on the financial market–are given in Table 3.
3.2. Breaking the Simulation
We purposely used simulation parameter values that would ‘break’ the AMMPS financial market
portion of the simulation platform, where ‘breaking’ meant when the market makers set prices
at $0 (or less) or $5,000 (or more), corresponding to a 5,000% increase in the price of the risky
asset over the simulation. We have identified these boundaries of ‘breaking’ the simulation
because it is not reasonable to have a collapse in the price to 0 when the stock is still providing
a dividend and it is correspondingly not reasonable to have a price that is more than a 50 fold
increase of the starting value, over no more than 8 quarters, when the average rate of growth is
around 10% per year. We acknowledge that a factor of 50x for the upper bound is arbitrary, but
it seemed a reasonable guess to start.</p>
        <p>The simulation ‘breaks’ when the net buy or sell volume of the HARK agents exceeds the
liquidity that can be provided by the other traders in the market, i.e. the institutional agents.
In this case, the market makers are left with the excess volume and will adjust their prices,
in an attempt to make the other agents take their inventory, but as these other agents have
exhausted their liquidity the market makers are stuck with the excess volume causing further
adjustment to their price. This starts a feedback loop between the HARK agents and the market
makers, where the HARK agents’ desire for buying (selling) is increased further by the market
makers’ continuous upwards (downwards) price adjustments. Essentially we test when the
influence of the HARK agent’s demand for buying or selling shares in the risky asset overwhelmed
the capacity of the non-broker agents in the AMMPS financial market. As not all simulation
parameter values broke the simulation, we ran an analysis (a binary logit) where we determined
the influence of the simulation parameters on the probability of ‘breaking’ the market.</p>
        <p>Then, removing the ‘broken’ simulation from the data, we analyzed data (using regressions)
from each of the remaining runs of the integrated model, capturing the mean and standard
deviation of the percent change of the ‘daily’ price of the risky asset (Market Mean and Market
Standard Deviation) during the 8 quarters of trading within each run of the integrated model, and
the mean and standard deviation of the distribution of wealth among the HARK agents at the end
of the simulation (Average Wealth and Standard Deviation of Wealth). We also summarized the
distribution of wealth (mean and standard deviation) for all of the HARK agents and then within
each heterogeneous subgroup of HARK agents that made up the universe of HARK agents–noting
this distinction as Across all Groups and Within Risk and Discount Groups.</p>
        <p>We ran the integrated model 15 times for each combination of the simulation parameters,
and for each run the HARK agent composition was the same: there were 25 HARK agents in 6
diferent risk and discount groups (a 2 × 3 design) with two levels of discounting (0.95 and
0.97) and three levels of risk aversion (using a Constant Rate of Risk Aversion) (3.3, 6 and 8.67).</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results</title>
      <p>After reporting on the conditions that lead to failures in the market (the market breaking), the
two primary dynamics that we investigate are Market Mean and Volatility (of the risky asset)
and Distribution of Wealth (across the HARK agents). The Market Mean and Volatility are based
on the ‘daily’ price movement of the risky asset across the 8 quarters within each complete run
of the integrated model. The dependent variable Market Mean is the average return of the price
of the risky asset at the end of each complete run of the integrated model, and the dependent
variable log(Volatility) of the Market is the log of the standard deviation of the daily percent
change of the risky asset over the 8 quarters.</p>
      <sec id="sec-4-1">
        <title>When does the Market ‘Break’?</title>
        <p>As reported in Table 4, an increasing number of HARK agents paying attention to the market
(increased Percent Attention), results in an increased probability of an AMMPS market failure (or
having the simulation ‘break’); this is similar for an increase in the Dollars per HARK Money Unit.
Both make sense in that they increase the relative market size of the Buy/Sell Brokers relative to
the other AMMPS agents–which can be viewed as an increase in the market power of the retail
investors versus the institutional investors and market makers–and can push intra-day prices
to extremes. Alternatively, an increase in the Dividend Growth Rate decreases the probability
of an AMMPS market failure, which is intuitive given that it appears that most failures occur
when negative feedback forces prices to zero and a stronger Dividend Growth Rate generally
keeps the price further from zero over the history of a simulation. Net of the influence of these
parameters, neither of the memory parameters (1 and 2) were statistically significant with
regards to whether the market failed (or ‘broke’).</p>
        <p>Next, we removed the simulations where the market ‘broke’ and then used the remaining
simulation results to understand how the price dynamics of the risky asset and the distribution
of wealth among the HARK agents varied as a function of the simulation parameters.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Market Mean and Volatility</title>
        <p>We used the natural log of the standard deviation of the volatility of the rate of (percentage)
return for the daily price of the risky asset over each simulation run because the original
(non-log) values have significant positive skewness and large outliers.</p>
        <p>As reported in Table 5, an increasing number of HARK agents paying attention to the market
(increased Percent Attention), results in increased market volatility; this is similar to an increase
in the Dollars per Hark Money Unit. Again, both make sense in that they increase the relative
market size of the Buy/Sell Brokers relative to the other AMMPS agents allowing their utility
functions to become more dominant and produce reinforcing, path-dependent behavior, and
price movements. Interestingly, an increase in the Dividend Growth Rate decreases market
volatility. This is likely due to the fact that in markets where there is strong upward pressure
on the price, negative transient price movements are ‘dampened’ and are less likely to lead to
feedback that collapses the price down toward zero.</p>
        <p>The impact of the simulation parameters reverses with regard to the mean market price.
As the Dividend Growth Rate increases, the market price tends to increase at the end of each
simulation; this makes sense as an increased dividend is theoretically linked with a higher value
for the risky asset. As both the Percent Attention and the Dollars per HARK Money Unit increase,
the mean market price decreases. This is most likely due to higher values of these simulation
parameters leading to increased market volatility. In those environments, a feedback cycle for
negative price movements tends to arise, driving the price toward zero.</p>
        <p>Both of these patterns suggest that the HARK agents’ behaviors are asymmetric, in that they
tend to ‘deflate’ asset bubbles by increasing their consumption as their wealth increases, by
either investing less of their income in the risky asset or actually selling some of their risky
asset holdings in order to supplement their income as they consume more than they make.
Alternatively, when the risky asset is involved in a price collapse, the desire of the HARK agents
to consume is not diminished suficiently to stop the sellof, and as a result, increased volatility
appears to be related more to persistent negative price runs as compared to persistent asset
bubbles. This lack of clarity points to one way in which our simulation platform could be
improved, which is by devising summaries of the risky asset’s price process, for each simulation
run, that can reasonably distinguish between asset bubbles and price collapses.</p>
      </sec>
      <sec id="sec-4-3">
        <title>Wealth Distribution</title>
        <p>Each complete run of the integrated model has 150 HARK agents, consisting of 6 subgroups of
25 agents, where the agents in each subgroup have the same risk preference and use the same
discount factor. The initial distribution of wealth across the 150 HARK agents is random. The
Wealth Distribution that we analyze is based on the wealth of the HARK agents at the end of the
8 quarters for a complete run of the integrated model. The dependent variable Average Wealth
is the mean of the HARK agents’ final wealth; the dependent variable Spread of Wealth is the
standard deviation of the HARK agents’ final wealth and can be viewed as a measure of wealth
inequality. As previously noted, we calculate these dependent variables using all of the HARK
agents (the Across all Groups case) and for the HARK agents within a specific risk and discount
rate subgroup (the Within Risk and Discount Group case).</p>
        <p>When we summarize what drives diferences in wealth across all HARK agents in a simulation,
as reported in Table 6; we find that both the level of attention of the HARK agents as well as
one of the market price memory parameters (1) had no impact on the distribution of wealth.
Alternatively, the Dividend Growth Rate and Dollars per HARK Money Unit both had positive
correlations. The first is not surprising as it suggests a log-normal type efect on the distribution
of wealth, the larger the average wealth, the broader the spread of wealth. The second, suggests
that the more active the HARK agents are, the greater their collective wealth–which supports
one of the underlying assumptions of this simulation framework, which is that having HARK
agents update their asset allocation quarterly will give very diferent results when compared
with a more realistic random attention model. The other memory parameter (2) reflects how
HARK agents weigh the historic mean and variance vs the price generated during the simulation,
with low values corresponding to ‘essentially’ ignoring the historic mean. It turns out that the
lowest of these values corresponds to an average decrease in the mean and spread of wealth.
Perhaps this is due to the fact that when agents pay attention to the market prices, as opposed
to the supposed long-term history, there are more feedback-driven price runs which tends to
result in negative price runs heading toward zero.</p>
        <p>When we summarize what drives diferences in wealth within each HARK agent group, as
reported in Table 7; we see the same patterns with respect to the HARK agent memory parameters
as well as with respect to the Dividend Growth Rate and Dollars per HARK Money Unit, which
we posit are for similar reasons. As for the preference parameters, a higher coeficient of relative
risk aversion (CRRA) has a positive efect and a higher Discount Factor has a negative efect on
average wealth. The efect of CRRA can be understood as a moderation on risk taking; agents
with lower CRRA parameters on average are able to enjoy some higher returns without exposing
themselves to too much risk, ending the simulation with higher average wealth. The efect of
the Discount Factor parameter is similarly expected and explained; agents with a high Discount
Factor put an increasingly similar weight on today as they do tomorrow, leading to a strong
incentive to smooth consumption and save in a safe asset, which could prevent agents from
participating in the market and benefit from higher returns to wealth.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Future Improvements</title>
      <p>Clearly, there is scope for adding to (and refining) the grid points used in order to better
understand how the current simulation system performs. The most likely candidates are
exploring smaller values of the HARK agent’s memory parameters (1 and 2). Another simple
improvement will be to make more detailed summaries of the simulation to use as additional
dependent variables; natural candidates to consider include summaries of stylized facts of the
risky asset price dynamics (e.g., AR parameter estimates, GARCH/ARCH parameter estimates)
and functional data summaries of the price dynamics to extract functional trends, hopefully
allowing us to identify and diferentiate between asset bubbles and price collapses; they could
also include summaries of the HARK agents utility functions.</p>
      <p>The fact that demand from the HARK agents can overwhelm the capacity of the AMMPS
market is, in some ways, not surprising, but we intend to change both the HARK agents and the
AMMPS market in ways that reflect more realism and require the AMMPS market to ‘break’
for reasons more likely to arise in a real financial market. For the HARK agents, we intend to
build in a scheme for identifying when a market has failed (e.g. when it has deviated suficiently
from the historic mean and variance) which would then justify the HARK agents changing their
behavior (e.g. flight to quality) based on a more complex belief-based utility function. Under
‘normal’ conditions, HARK agents may behave more like the institutional investors in that they
price the asset according to the Lucas asset pricing model, when evidence suggests they should
abandon this model then alternative actions would be taken.</p>
      <p>For the AMMPS market, clearly, the Institutional Investors can and will need to become
more realistic: using a Bayesian learning model to estimate the dividend process; having more
realistic and flexible risk preferences as well as having flexible access to capital markets allowing
their leverage to change. Both modifications will afect how much they will participate in the
market, and hence their power in the market; similarly for market makers, having a dynamic
access to credit would greatly afect their ability to provide liquidity at diferent points in the
simulation.</p>
      <p>Finally, adding a circuit breaker feature in the simulated exchange in AMMPS, would add a
more realistic handling of events where the market for some reason moves very drastically in
one direction when the liquidity of the market actors is exhausted. Instead of simply ‘breaking’
the market, a circuit breaker type of event could ofer a path for the market to recover.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgements</title>
      <p>This material is based upon work supported by the Defense Advanced Research Projects Agency
through cooperative agreement No. HR001 12220029 and the National Science Foundation under
Grant No. 2105301. Any opinions, findings, and conclusions or recommendations expressed
in this paper are those of the authors and do not necessarily reflect the views of the sponsors.
One of the authors of this article was supported by the New York University Information Law
Institute’s Fellows program, which is funded in part by Microsoft Corporation.</p>
    </sec>
    <sec id="sec-7">
      <title>A. Technical Appendices: Introduction</title>
      <p>In these Technical Appendices, we present details about the computational models used in
the simulation platform, in the companion paper but which are not needed to gain a general
understanding of the work.</p>
    </sec>
    <sec id="sec-8">
      <title>B. The macroeconomic (HARK ) agents</title>
      <p>
        The macroeconomic agents in our simulation are both consumer households and retail investors.
B.1. Portfolio Choice Model
The macroeconomic HARK agents in our simulation are obtained from the Econ-ARK
Heterogeneous Agents Resources and toolKit (HARK) library [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. When a HARK agent pays attention,
the allocation problem solved by these agents is of the kind first explored by Merton [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] and
Samuelson [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and further developed by Campbell and Viceira [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ] [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. These agents choose
consumption and saving to maximize their present discounted expected utility over a finite (or
infinite) life-cycle given by:
(1)
(3)
(4)
max E
[︃  ]︃
∑︁ [ (1 − D)]() .
      </p>
      <p>=0</p>
      <p>The agents have an isoelastic, or constant relative risk aversion (CRRA), utility function with
parameter 
() = 1−  − 1 (2)</p>
      <p>1 −</p>
      <p>Additionally, these agents experience life-cycle uncertainty such as employment, income,
and mortality risk. When saving, these agents can choose between a safe asset with a low but
certain return and a risky asset with a higher expected but uncertain return. The proportion of
total assets that the agent chooses to invest in a risky asset is called the risky portfolio share, or
risky share for short, and is denoted by . We can represent the overall return on the agent’s
portfolio R+1 as:</p>
      <p>R+1
=
=</p>
      <p>R(1 − ) + R+1
where the return of the risky asset is distributed log R ∼  ( + r −  2/2,  2) and  is the
equity premium, the diference between the expected risky return and the risk-free rate on the
safe asset r = log R.</p>
      <p>The problem can be represented by the recursive Bellman equation:
v(, )</p>
      <p>0 ≤
R+1
+1
s.t.
=</p>
      <p>max
{,,}
 −</p>
      <p>() +  (1 − D+1)E[v+1(+1, +1)]
where the state variables are market resources (cash-on-hand)  and the level of permanent
income . The control variables that the agent can choose are current period’s consumption ,
total assets , and the risky share of assets . The agents discount the future by  and face a
probability of death D+1. Before the onset of next period, the agents experience permanent and
transitory income shocks, distributed as log  ∼  (−  2 /2,  2 ) and log  ∼  (−  2/2,  2)
respectively. 2</p>
      <p>An equivalent problem that facilitates finding the solution to the above maximization problem
is to separate the objective into a two-stage sequential Bellman problem, where the agent first
chooses a level of saving and then chooses their risky portfolio share.</p>
      <p>In the first stage, the agent chooses between consumption and saving given market resources,
which by the market clearing condition entails only one choice.</p>
      <p>v(, )
max () + v˜(, , )
{,}
=
s.t.</p>
      <p>=</p>
      <p>−</p>
      <p>Given a level of saving  ≥ 0, the agent then chooses the proportion of assets that they are
willing to invest in the risky asset. At this stage, the agent considers the risk associated with
stock market participation as well as their income uncertainty next period.</p>
      <p>max  (1 − D+1)Ev+1(+1, +1)</p>
      <p>v˜(, )</p>
      <p>0 ≤
R+1
+1
=
s.t.
 ≤ 1
=
=
2For log-normally distributed variables, it is known that if log  ∼  (,  2) then log E[] =  +  22 such that
[ ], [ ] = 1.
+1
=</p>
      <p>In summary, when determining how much of their savings to invest in the risky asset or
to consume, the agent computes backwards from their expected end-of-life to maximize their
expected discounted utility. The agent takes into account known risk parameters:   ,   for
the income process, and ¯ =  + r − 2/2 and  for the risky asset.</p>
      <p>In a rational expectations model, ¯ and  would be veridical, and the rate of return of the
risky asset would be a lognormal distribution. In our hybrid model, the rate of return of the
risky asset is instead determined by a simulation of a financial market. The agents infer   and
  from a statistical process that takes into account observations of past market returns.</p>
      <p>For the purpose of these simulations, the risky average is related to the financial market
process as follows:</p>
      <p>R+1 =
where +1 is the dividend process and +1 is the price level of the aggregate stock3. As
the simulation proceeds, agents observe a series of prices and dividends to construct a series
of risky asset returns. Since our agent population includes heterogeneity in belief formation,
agents with diferent perceptions of the market may update their beliefs of the mean market
return and standard deviation diferently, leading to deviations in market behavior.
B.2. Population parameters
The specific population used in this study was calibrated for a balance of realism and qualitatively
interesting results. The population consisted of six subclasses diferentiated by time preference
factor  and risk aversion  .</p>
      <p>
        The distribution of  was taken from [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]’s results fitting a uniform distribution of time
preference to have a resulting distribution of wealth that matches that of the United States.
The distribution of  was chosen based on that range of values that are needed to produce
qualitatively interesting results in portfolio choice problems. Each uniform distribution was
discretized into equiprobable points. Each combination of one of two  values and one of three
 values comprises a population class. For each population class, there were 25 instances (or
agents). All of these agents interacted with each other via the market (see below).
      </p>
      <p>
        All of the macroeconomic agents in the model shared transitory and permanent income
shock parameters calibrated to a typical 40 year old male in the projections of [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. We used
conventional probability of death D = 0.02 and permanent growth factor Γ = 1.01. All these
values were adjusted from annual to quarterly values. The entire duration of the integrated
simulation is eight quarters or two years.
      </p>
      <p>All agents are initialized with starting permanent income 0 = 1, and with  = 1 and
0 = 1 − (1). In future work, these starting wealth levels can be tuned to the equilibrium
values for each agent class in order to stabilize the efects of the macroeconomic changes on the
3The details of these processes are explained in later sections.</p>
    </sec>
    <sec id="sec-9">
      <title>C. The market simulation</title>
      <p>The simulated market for trading the risky asset (the financial market) is written in C#. On
a basic level the system simulates trading by the processing of messages added to a queue:
Diferent parts of the simulation system subscribe to diferent types of messages and process
them, which in turn may generate new messages to be added to the queue. The messages
are placed in the queue according to their attached timestamp, and once the processing loop
reaches a message it is taken of the queue and relayed to the relevant components of the system
depending on the message type. An example is a market order to buy x amount of stock ABC.
In this case, the buy order message is placed in the queue and relayed to the matching engine,
which finds a matching passive order(s) and completes a trade. The trade, in turn, generates a
new set of messages, a general message describing the trade, a message describing the change
to the order book, and a message for each party of the trade, informing them of the trade.</p>
      <p>The message types can be seen as diferent information streams, by which the diferent
components of the system can subscribe to and interact with. Because of the placement in
the queue according to the attached timestamp, it is possible to simulate latency between the
diferent information streams and actors by adding a delay caused by the latency to the message
timestamp.</p>
      <p>On a higher level, we can use the system to define agents that observe and react to these
information streams according to diferent logics and time scales based on market actors in a
stock market. Market makers, for example, subscribe to the order book stream to keep track of
the best bid and ask prices and adjust their own prices accordingly. Institutional trades follow
the trading prices across the day as well as dividend information released at the beginning of
the day. In addition to the agents described in the main document, the additional agent types
are described in detail below:
C.0.1. Market Makers
When a market maker’s pricing method is triggered, the agent generates a set of target passive
orders for bids, , and asks, , each containing entries  ∈  and  ∈  for  ∈
{1, 2, . . . , } where  is the maximum number of levels for which the agent places orders on
each side of the bid-ask spread, and 1,1 represent the highest bid and lowest ask respectively.
Each entry contains both price and quantity information, such that ,  are the respective

target bid and ask prices at level , and ,  are the respective target bid and ask quantities at

level . To populate  and , the agent first determines where it should set its best bid price
and best ask price according to:
1 =  −
1 =  +
︁(</p>
      <p>2
︁( 
2
+ (  ,  ))︁</p>
      <p>2
+ (  ,  ))︁
2
where  is the smoothed volume-weighted mid-price,  is the volatility-based spread,  ,
  are the respective position-based spread adjustments for the bid and ask sides, and  is a
parameter which limits how far the spread can be adjusted back toward , where − 1 ≤  ≤ 0.
The process for calculating the above prices can be thought of as first setting a positive spread,
, symmetrically about  and then applying independent adjustments to each side. For the
initial spread, , a market maker wants to set its bid-ask spread narrow enough so that its prices
are competitive to get matched against marketable orders but also wide enough to avoid adverse
selection where the price quickly trades through the level. A simulation (market maker) agent
sets its volatility-based spread according to</p>
      <p>=  +  · 
where  is the minimum spread, defined as {0.01,  · 0.0001},  is a scalar spread-factor
parameter that determines how much the agent’s spread should respond to volatility, and  is
the volatility, defined as the average traded price range over a given sampling frequency.</p>
      <p>Because queue position is a profit-center for market makers, they will have passive orders
at many price levels at once. In trending markets, this strategy will create a risk of quickly
accumulating a large net position in a single instrument at disadvantageous prices. Market
makers respond to this risk by adjusting their spreads as a function of the position. In the
simulation, the position-based spread adjustment asymmetrically widens out the spread on
either the bid or ask side based on the agent’s position in an instrument,  , where  &gt; 0 if the
agent is long and  &lt; 0 if the agent is short. The adjustments for the bid and ask directions are
given by</p>
      <p>Where  and  are the respective best bid and ask prices and  and  are the
respective best bid and ask sizes. In real trading scenarios, the VWMP is often preferred to
the simple mid-price between the best bid and ask as it reflects information about the relative
sizes at the top of the order book and encodes information about which size is more likely to be
taken out, allowing market makers to adjust their orders more quickly when aggressive trading
begins to occur on one side of the market. The smoothed VWMPs are updated on a one-second
timer that fires for each market maker. When the timer fires, the market maker adds the most
recently stored VWMP to the EMA smoothing process.</p>
      <p>In summary, the market maker agent first prices its best bid and ask symmetrically according
to the volatility-based spread. Then in order to avoid accumulating too much size in one
instrument at a single price, it will widen out the spread in the direction that it has been filled
in that instrument.</p>
      <p>C.0.2. Institutional Investors
The institutional agent represent so-called "buy side" market participants that take large positions
in the market which is executed across the trading day using a constant participation type
of execution algorithm in order to minimize their market impact. Each day these agents will
price the asses using the Lucas asset pricing model based on their estimate of the current value
of the dividend. At the beginning of each day, a random perturbation of the current value of
the dividend is revealed to each institutional agent, giving each agent an individual price to
dividend ratio which is used to calculate its particular price for the asset. For institution  at
day  the price of the asset is calculated as:</p>
      <p>Where  is the current value of the dividend at day , and , is the price to dividend ratio for
institution  at day . At randomly drawn intervals between 5 to 30 minutes, the institution will
poll the price and calculate the discrepancy between the valuation and the current mid-price:
, =  · ,
Δ = (, − ),
where  is a random normally distributed variable with mean 1 and standard deviation of
0.01 representing any additional private information the institution may have. If Δ &gt; 0 the
agent will proceed to buy the asset as it considers it undervalued whereas if the Δ &lt; 0 it will
sell the asset. However, the institution will only take one position each day, if it has bought a
position in the asset, because the asset was undervalued and by the next poll price now has
risen above ,, it will hold its position and not start selling.</p>
      <sec id="sec-9-1">
        <title>Execution</title>
        <p>The execution algorithm of the institutional investors aims to execute the target position by
participating as a constant fraction, , of the total trading. While the execution algorithm is
active, it tracks the cumulative trading volume and calculates the order size needed to participate
as  of the market:</p>
        <p>= ( − ) − 
where  is the total volume traded in the period that the execution algorithm has
been running, and  is the volume executed by the agent. The algorithm initially places
the volume as a passive order at the best bid or ask depending on the side and waits ,
where  is drawn from a uniform distribution between 15 to 60 seconds, then it trades
any remaining volume as an active market order. Once an active order has been executed
the algorithm waits , where  is drawn from a uniform distribution between 1 and 5
minutes, before sending a new order.</p>
        <p>C.0.3. Buy Sell Brokers
The broker agents form the link between the macro and micro markets by buying and selling
on behalf of the macro HARK agents. Each time the market opens the brokers receive the buy
and sell volume targets from the macro simulation. The buy and sell volume is executed by the
buy or sell broker respectively across the day. When the agent has received its buy or sell target
for the day, it calculates a "trading velocity", , determining the size of the suborders it will
have to execute every second in order to reach the target by the end of the day.</p>
        <p>= /( − ℎ)</p>
        <p>Where  is the volume the agent needs to execute to reach its target,  is the current
time, and ℎ is the time 5 minutes before the market closes.</p>
        <p>The order is executed in the same way as the institutional agent, first using a passive order,
then an active order for any remaining volume, and finally a pause before executing the next
order. The length of such a sequence is  =  + , and the target volume is:
 =  ·</p>
        <p>The trading velocity is updated each interval in order to account for possible execution
shortfalls and any remaining volume is executed at ℎ, in order to guarantee the broker
meets its target at the end of the day. When the market closes at the end of the day the broker
sends the closing price back to the macro market.</p>
        <p>C.0.4. Technical Agents
In addition to the agents described above, the market contains a number of ‘technical’ agents
that follow diferent strategies, following a common design described below.</p>
      </sec>
      <sec id="sec-9-2">
        <title>Trading Data Representation and Memory</title>
        <p>The price data continuously received by the agents is synthesized into so-called price "bars"
that describe the trading process for a given interval, eg 5 minutes. This is a common practice
among traders and coarse grains that data to a time scale that the traders are interested in
(traders with long time horizons would be interested in price information on days, weeks or
months). For interval , we define the bar, , as a set of values</p>
        <p>= {, , , , , }</p>
        <p>Where , , , , are the opening, highest, lowest and closing prices for the interval,
and  and  are the volume traded and the volume imbalance measured as the diference
between the active buy and sell volume in the interval.</p>
        <p>Each agent will have a set number of look backs,  , determining how many bars it will store
defining its memory of the trading process. For agent n at time  its memory of the trading
process is defined as the set of bars:</p>
        <p>, = {0, 1, 1, ...,  }</p>
        <p>Where 0 is the most recent bar and  is the bar representing the trading process 
intervals ago.</p>
      </sec>
      <sec id="sec-9-3">
        <title>Targets</title>
        <p>Each agent also defines a target, which defines the conditions for entering and subsequently
exiting the market. We define a target  as a set of values:</p>
        <p>, = {, , , , , }</p>
        <p>The first component of the target, , is the entry price defining the price required for the
agent to enter the market. The second component, , defines the side of the target and
is 1 for a long target and − 1 for a short target, the target volume,  , similarly can be positive
for a long position and negative for a short position.</p>
        <p>In addition to the entry price, the target contains a ‘take profit’ price, , and a ‘stop loss’
price, , defining the price at which the agent will exit its position, either to capture the
profits of its investment (‘take profit’) or to avoid further losses (‘stop loss’).</p>
        <p>The target can be a momentum type entry, in which case the agent will buy when the asset
is trading above the entry price for a long target position, or sell if the asset is trading below
the target price and the target position is short. Inversely, for a target with a reversion type
entry, the agent will sell when the asset is trading above the target price and the target position
is short or buy when the asset is trading below the target price and the target position is long.</p>
        <p>The ‘take profit’ and ‘stop loss’ prices are set symmetrically around the target price.
for a momentum type target, and
 =  +  · 
 =  −  · 
 =  −  · 
 =  +  ·</p>
        <p>= 1 ∑0︁( − )
for a reversion type target.  is a measure of the price volatility at time , defined as:
Using the base framework we define 6 agent classes that use diferent strategies to define
their target price. In addition to how they define the target price, the agents are heterogeneous
with respect to the interval by which they set their sample bars, how many bars they keep and
their stop loss factor defining when to exit their positions.</p>
      </sec>
      <sec id="sec-9-4">
        <title>Target Size</title>
        <p>For agent , the target size at time , is given by:</p>
        <p>= / ,.</p>
        <p>, is current annualised daily volatility,  is a cash amount assigned to the trader (100000)
and  is drawn from a folded normal distribution:</p>
        <p>= (0.005 + (0.025 − 0.005)| |)</p>
        <p>Where  is a normal distribution with zero mean and unit variance.  represents the
fraction of the assigned amount of cash the trader use for the trade and  is capped at 0.5 to
avoid potentially very large values.</p>
      </sec>
      <sec id="sec-9-5">
        <title>Zero Information Traders</title>
        <p>This type of agent is essentially a liquidity trader that seeks to buy or sell the asset for
reasons exogenous to our model, generating a fluctuating flow of orders into our market. At
random intervals, they will enter the market by manually triggering an entry into the market,
with a take profit/stop loss that is 20 times the current volatility, meaning that they will not
trigger a take profit or stop loss. They do not simulate traders following a specific strategy, but
rater simulate the fluctuating order flow of a large number of traders following a multitude of
strategies with wide range of investment horizons. The agent will randomly choose to buy or
sell with 50% probability. In order to avoid having these agents hold a long term position in the
market, they have a mean-reverting behavior. If an agent is long and wants to sell, but the size
of the sell order is not large enough to enter a short position, the size of the sell order is set
so that the new position is (1 − ) · , where  is a reversion factor and  is the current
inventory. In the current simulation the reversion factor is set to 0.5. This means if the agents
build a position that’s outside the size range of the order sizes they are more likely to start to
reduce their inventory rather than increase it further.</p>
      </sec>
      <sec id="sec-9-6">
        <title>Aggressor Trend</title>
        <p>This agent is a momentum type agent, using the imbalance between buy and sell trades
and the direction of the price change to determine when the price is trending and follows the
trend. The target direction and entry price are determined from the collected trading volume
imbalances for the  bars stored by the agent. If the trade volume imbalance of the last bar
is significantly above(below) the mean, as determined by a z test, and the diference between
the opening and closing price of the current bar is positive(negative) it will set a target for a
long(short) position at the closing(opening) price of the current bar:</p>
        <p>Where &lt;  &gt; and   are the average and standard deviation of trade volume imbalance.
This means that if the agent observes a change in the buying volume and an increase in
price it will buy if the price continues to increase, reversely if it observes an increase in
the selling volume and a decrease in price it will (short)sell. Each agent, , has an
individual z-score threshold, , determining when it will consider the volume imbalance significant.</p>
      </sec>
      <sec id="sec-9-7">
        <title>Breakout Trend</title>
        <p>The breakout trend agent is a momentum type agent that monitors when the price moves
outside a historic range. Every time the agent closes a bar it will calculate a long and short
breakout value as the last bar opening price plus and minus the exponential moving average
(EMA) of the price ranges (high-low) for the stored bars multiplied by a factor. If the low of the
current bar is less than the open of the last bar and the current bar high is above or equal to
the long breakout value, it will target a long position at the current bar high. Inversely if the
current bar high is greater or equal to the last bar open and the current bar low is less or equal
to the short breakout value, it will target a short position at the current bar low:
,  =
1, 0
− 1, 0
if 0 ≤ 1 and 0 &gt; 0 + ⟨ − ⟩ · ,
if 0 ≥ 1 and 0 &lt; 0 − ⟨  − ⟩ · ,</p>
        <p>Where ⟨ − ⟩ is the exponential average of the diference between the highest and
lows prices of each stored bar. The agent sets a target if only one of these conditions is met.
Each agent has an individual factor, which determines its breakout prices.</p>
      </sec>
      <sec id="sec-9-8">
        <title>Pullback Reversion</title>
        <p>The pullback reversion agent is a reversion type agent that tries to trade on price reversion
or pull back. If the agent identifies a price reversion and then observes a deviation from this
reversion it will take a position in the direction of the reversion. The algorithm follows a two
step process.</p>
        <p>First, it will identify a pullback:
 =
1
− 1
if 1 &lt; ⟨⟩ and 0 &gt; ⟨⟩
if 1 &gt; ⟨⟩ and 0 &lt; ⟨⟩</p>
        <p>If the agent closes a bar where the closing is higher (lower) than the EMA of the closing
prices and the closing price of the previous bar was less (more) than EMA of the closing prices,
i.e., the current bar is moving in the opposite direction than the average compared to the last
bar, the agent considers the price reverting up (down).</p>
        <p>If the pullback direction,  is positive, a target direction and entry price are set
 = 1,  = 0 if 1 &gt; ⟨⟩ and 0 &lt; ⟨⟩
For a negative pullback direction, the target direction and entry price are set as:
 = − 1,  = 0 if 1 &lt; ⟨⟩ and 0 &gt; ⟨⟩</p>
        <p>When the agent has determined an upwards (downwards) pullback, it will set a target to
enter the market if it observes a deviation from the pullback. If a bar closes below (above)
the EMA of the stored bars, while the previous bar closed above (below), a long (short)
position target is set at the high (low) of the current bar. Once the target is set it will set,  is set to 0.</p>
      </sec>
      <sec id="sec-9-9">
        <title>RSI Reversion</title>
        <p>The RSI reversion agent is a reversion type agent that uses the relative strength index (RSI)
to determine if the asset is over bought or over sold, and is likely to revert. The agent calculates
the RSI using the open to close price returns of the stored bars as:
the price it considers the asset over bought, and 
sold. For each agent + and − are determined as:
where ⟨⟩ and ⟨⟩ are the exponential averages of the observed positive and negative
price changes determined as  −  . Each agent has a two RSI thresholds; +, determining
− below which it considers the asset over
+ = 100 − , + = 
,  =
− 1, 0 + (+)
1, 0 + (− )
if  &gt; 50
if  &lt; 50
for the RSI to reach + and − respectively:</p>
        <p>Were (+) and (− ) are the positive and negative price changes required
(+) =
1 (︂ 100(1 − ) ⟨⟩
100 − +</p>
        <p>− (1 − ) ⟨⟩ − (1 − ) ⟨⟩</p>
        <p>−
(− ) = − 1 (︂ (100 − − )(1 − ) ⟨⟩
− (1 − ) ⟨⟩
Each RSI reversion type agent difers by the RSI threshold values used to determine if the
asset is over-bought or over-sold.</p>
      </sec>
      <sec id="sec-9-10">
        <title>Scalper Reversion</title>
        <p>The Scalper Reversion agent is an agent that trades on the assumption that if the price starts
trading significantly away from the mean trend, the price is going to revert back to the mean
trend. Each time the agent closes a bar it calculates the diference between the closing price and
the mean of the closing price of all bars stored. For each bar, it will keep this diference. If the
current diference (between the current bar close and the mean close price) is significant, as
determined by a z-test, from the average diference of the stored bars it will set a long or short
target depending on whether the current diference is negative or positive. In case of a negative
diference, it will set a long reversion target price at the current close price and if the diference
is positive it will set a short reversion target at the current close price.</p>
        <p>C.1. Sensitivity of the Market Simulation
One key element of the integration of the HARK macro model and the financial market ABM,
AMMPS execution is to determine the relative size of the markets, or put diferently to determine
when an imbalance in buy and sell orders, aggregated at the macro-level will have a sizable
impact on the price movement of the risky asset. We explored this in two ways: 1) we ran a
short, single-day price impact, simulation study (which is reported here) and 2) we ran the
full simulation using a range of parameter values, where the values were suficient to ‘break’
the market portion of the simulation platform (which is reported in the main body of the
manuscript).</p>
        <p>For the single-day price impact study, we used the same AMMPS market configuration as
was used for the full study and let the simulation run for 30 days, then allowed the Buy Broker
and Sell Broker to trade, using a range of diferent order sizes, for a single day and measured the
percent change in the price of the risky asset. The results are given in Figure C.1.</p>
        <p>We generated 5 years worth of daily data (5 * 250, or 1, 250) for each combination of Buy
Broker and Sell Broker settings (determined by a base number of shares: 500, 1, 200, 5, 000 and
12, 000 and a sell to buy ratio, where the base number of shares was associated with the number
1–e.g., a 3 to 1 ratio with a base number of shares of 500 would mean that the Sell Broker sold
1, 500 shares and the Buy Broker bought 500 shares).</p>
        <p>The rate of return is the percent change of the starting and ending price for the final trading
period. We adjusted each of the percent changes so that on average a 1 to 1 scenario would
have the same mean and standard deviation as the &amp; 500 index over the last five years. We
did not match any higher moments, and the tail behavior of the simulated data versus the &amp;
500 index are clearly driving diferences in these simulated distributions versus the &amp; 500
index. We anticipate that more advanced agent-based market simulations for the risky asset
will allow us to have a distribution of outputs that is more similar to the &amp; 500 dynamics.</p>
        <p>It appeared that imbalances starting as small low as 500 shares for the base level can produce
noticeably large movements in the daily price of the risk asset, particularly in the presence of
imbalances. We have done initial explorations of determining the optimal mapping between
HARK dollars and AMMPS dollars, with limited success. We anticipate making this type of
exploration a point of future study.</p>
      </sec>
    </sec>
    <sec id="sec-10">
      <title>D. Details of Simulation Design</title>
      <p>In this section, we give the details of the algorithm that governs how the software for the HARK
model and the financial market AMMPS model interact.</p>
      <p>The basic concept is that at the beginning of each trading day, a random subset of the HARK
agents pay attention to how much of their wealth is allocated to the risky asset. They then
calculate a mean and variance for the risky asset (estimating ¯ and ), using a weighted
combination of the historic mean and variance and the price of the risky asset generated so
far in the simulation. (Each simulation assumes 8 quarters, each with 60 trading days.) For
each of these attending HARK agents, using their utility (risk aversion) and time value of money,
we calculate their optimal holdings in the risky asset, as described above, using the closing
price from the previous trading day in the simulation to calculate their current wealth. The
HARK agents desired adjustments (buy/sell) to their holdings are aggregated and passed to a
Buy Broker and Sell Broker respectively. These desired levels of holding of the risky asset by
an attending HARK Agent is based on their earnings, consumption, and investment, which are
updated on dates spread throughout each quarter.</p>
      <p>The simulation platform has three primary scripts or blocks of software:
1. SHARKFin. This is python code that controls the overall simulation. It sets up global
parameters for each simulation and interacts with the HARK and AMMPS simulation code.
2. The HARK Model, which solves agent-based macroeconomic calculations. It takes inputs
from the SHARKFin and returns relevant output based on the price of the risky asset. In
particular, it determines the aggregate change (buy and sell) in the desired holding of the
risky asset by the HARK agents who are paying attention to the financial market.
3. AMMPS, which takes inputs from SHARKFin (aggregate buy, sell order, and dividend
rates) and simulates a trading day based on those inputs and the AMMPS agents’ state
from the previous day. Because the AMMPS agents’ states are used, each simulated day
becomes path dependent and the state of the market the previous days afect the simulated
trading the next. When the market closes for the day, the closing price is returned to
SHARKFin and the AMMPS simulation waits for the next input from SHARKFin.</p>
      <sec id="sec-10-1">
        <title>Detailed Algorithm</title>
        <p>A. Start - Initialize HARK model
• Create HARK Agents: ,  = 1, · ,  .</p>
        <p>– There are  agents.
• Set initial economic conditions, as discussed in Section B.2: 0,  = 1, · ,  .
– This is done in the HARK program, these parameters are set and stored inside
of the HARK program.
– The amount of wealth that each agent holds in the risky asset is updated at the
end of each trading day based on the price of the risky asset and the dividend.
The updating is done independently of whether an agent pays attention to the
market and wants to change the amount of wealth that they have of the risky
asset or whether they are ignoring the market that day.
– Each agent is assigned a macroeconomic update day . This is the day of
the quarter (out of 60) on which the agent undergoes their earning (subject to
exogenous shocks), consuming, and investment cycle as described in Section
B.1.
• Set risk preferences: ,  = 1, · ,  .</p>
        <p>– These are parameter values, e.g.  or the CRRA parameter, set in the HARK
program and they do not change throughout the simulation.
• Start with an initial stock price for the risky asset: 0 = 100, the Risky Asset
Price at time 0.</p>
        <p>– This value of the Risky Asset Price is maintained in SHARKFin.</p>
        <p>– As a convention set the price to 100.
• Use this stock price to determine the initial number of shares of the risky asset held
by each agent:
– 0 = (0. ) /0.
– 0. is the Risky Asset Wealth held by the ℎ HARK agent at time 0
and 0 is the Risky Asset Shares held by the ℎ HARK agent at time 0. This
value is strategically computed as a function of the HARK agent’s assets. It is
stored and updated by each HARK agent object. It is related to the total wealth
held by an agent and the share of wealth that the agent puts in the risky asset,
.
–   is a scaling factor, dollars per HARK money unit, which is set as a
parameter that is not changed throughout the simulation.</p>
        <p>B. Update prices and dividend for each trading day in each Quarter
• At the beginning of each trading day ,  + 1 (during a quarter), select a random
group of HARK agents (with replacement—meaning that the same agent could trade
multiple times during a quarter—even back to back days).</p>
        <p>– * , where * indicates that the HARK agent was selected and , where 
indicates that the HARK agent was not selected.
– Note that time, , starts at the beginning of the simulation and does not reset
each time a new quarter starts.
• For the selected group of HARK agents, * , calculate the desired level of wealth
that the agent wants to have allocated to the risky asset based on the previous day’s
trading price, − 1 , then determine the total number of shares that each agent
wants to trade, buy or sell.</p>
        <p>–  , determine the expected return and standard deviation for the risky asset
(¯, ) to be used for decision in period  + 1.
– To do this the agents use a weighted average of rates of return
(0, ..., − 1) and a historic (e.g. S&amp;P 500) average return and standard
deviation (¯0, 0) to calculate the ‘current’ expected return and standard
deviation. The rate of return includes the returns based on price movements as
well as an exogenous dividend process.
– The formula for the mean and standard deviation used by the HARK agent is
given by</p>
        <p>¯ = ∑︁  + ¯0
=1
(6)
and
where
(7)
(8)
∗  = (1 −  ) {* } , for  ≥  &gt; 0 and 0 =  for all .
∗ Further  = ∑︀</p>
        <p>=1  { * } , and  =  { *  }.
∗ The parameter  = {2} , where 1 &gt; 2 &gt; 0 is the proportion of the
 2
weight that is assigned to the historical mean and standard deviation, or it is
the value of 0, when the amount of data that has been seen is equal to  2.
So 0 = 2, when  =  2. For example, if 2 = 0.1 and  =  2 = 120,
then ∑︀1</p>
        <p>=1 20 = 0.9 and 0 = 0.1.</p>
        <p>∗ See Figure 3 for numerical examples.
– , using this (¯, ), calculate the total number of shares of the risky
asset that the selected HARK agents want to buy or sell.</p>
        <p>∗ Have HARK calculate the amount of wealth that each of the selected agents
wants to hold in the risky asset (this is an update or new number), or
determine * +1. .
∗ Using the closing price from the previous period, , determine the new
number of shares that each selected agent wants to hold, or
* +1 =
* +1. ·  

.
∗ Aggregate the total number of shares of the risky asset that the
selected agents want to buy and the total (aggregate) number of shares
of the risky asset that the selected agents want to buy, +1 =
∑︀ (* +1 − * )+ , where (· )+ = (· , 0), and the total
(aggregate) number of shares of the risky asset that the selected agents want
to sell, +1 = ∑︀ (* +1 − * )− , where (· )− = (· , 0).
∗ For HARK agents that were not selected leave the number of shares in the
risky asset unchanged, or +1 = .
∗ For any HARK agents whose macro-update day  is the current day of
the quarter, update their economic conditions based on the equations in
Section B.1:
b) The agent undergoes permanent and transitory income shocks.
c) The agents’ market resources  are updated as a function of their
income, as well as returns on their saved assets. The return on saved
assets in the macro-update step is the dividend rate, as capital gains are
handled separately.
d) The agent choices their optimal allocation to the risky asset and level of
consumption according to their previously computed solution.
e) The agent recomputes their target number of shares * +1 and
adjusts the buy and sell aggregate numbers +1 and +1 accordingly.
–  ℎ, sample the next dividend from the exogenous dividend process. For a
dividend growth rate  and dividend standard deviation   :
 ∼ Lognormal(0,   )
+1 = 
–  ℎ, using (+1, +1) and +1 as the input to the Buy Broker and
Sell broker run a day of trading and determine the end of day price of the risky
asset +1 and the rate of return +1
• Use the final price to calculate the amount of wealth each (all) HARK agent has
allocated to the risky asset, +1. = +1 * +1. Additionally,
award each agent wealth according to the dividend +1+1.
• Repeat for each trading day until the end of the quarter, then repeat for each quarter
until the end of the simulation.</p>
        <p>40
6
.
0
2
.
0
8
.
0
2
.
0
0
.
0
s
e
c
i
r
p
ftr
o
h
g
i
e
W
s
e
c
i
r
p
ftr
o
h
g
i
e
W
6
0
.
0
4
0
.
0
2
0
.
0
0
0
.
0
6
0
.
0
4
0
.
0
2
0
.
0
0
0
.
0
40</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Muth</surname>
          </string-name>
          ,
          <source>Rational Expectations and the Theory of Price Movements, Econometrica</source>
          <volume>29</volume>
          (
          <year>1961</year>
          )
          <fpage>315</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Shefrin</surname>
          </string-name>
          , Rational Expectations, Cambridge University Press,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>LeBaron</surname>
          </string-name>
          , L. Tesfatsion, Modeling Macroeconomies as Open-Ended
          <source>Dynamic Systems of Interacting Agents, American Economic Review</source>
          <volume>98</volume>
          (
          <year>2008</year>
          )
          <fpage>246</fpage>
          -
          <lpage>250</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>Tesfatsion</surname>
          </string-name>
          ,
          <article-title>Chapter 16 Agent-Based Computational Economics: A Constructive Approach to Economic Theory, in: Handbook of Computational Economics</article-title>
          , volume
          <volume>2</volume>
          ,
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          ,
          <year>2006</year>
          , pp.
          <fpage>831</fpage>
          -
          <lpage>880</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J. D.</given-names>
            <surname>Farmer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Foley</surname>
          </string-name>
          ,
          <article-title>The economy needs agent-based modelling</article-title>
          ,
          <source>Nature</source>
          <volume>460</volume>
          (
          <year>2009</year>
          )
          <fpage>685</fpage>
          -
          <lpage>686</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>R.</given-names>
            <surname>Bookstaber</surname>
          </string-name>
          ,
          <source>The End of Theory</source>
          , Princeton University Press,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A. F.</given-names>
            <surname>Siegenfeld</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bar-Yam</surname>
          </string-name>
          ,
          <article-title>An Introduction to Complex Systems Science</article-title>
          and Its Applications,
          <year>Complexity 2020</year>
          (
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>16</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>W. A.</given-names>
            <surname>Branch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>McGough</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Heterogeneous</given-names>
            <surname>Expectations</surname>
          </string-name>
          and
          <article-title>Micro-Foundations in Macroeconomics, in: Handbook of Computational Economics</article-title>
          , volume
          <volume>4</volume>
          ,
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>3</fpage>
          -
          <lpage>62</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Huggett</surname>
          </string-name>
          ,
          <article-title>The risk-free rate in heterogeneous-agent incomplete-insurance economies</article-title>
          ,
          <source>Journal of Economic Dynamics and Control</source>
          <volume>17</volume>
          (
          <year>1993</year>
          )
          <fpage>953</fpage>
          -
          <lpage>969</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S. R.</given-names>
            <surname>Aiyagari</surname>
          </string-name>
          , Uninsured Idiosyncratic Risk and
          <string-name>
            <given-names>Aggregate</given-names>
            <surname>Saving</surname>
          </string-name>
          ,
          <source>The Quarterly Journal of Economics</source>
          <volume>109</volume>
          (
          <year>1994</year>
          )
          <fpage>659</fpage>
          -
          <lpage>684</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>P.</given-names>
            <surname>Krusell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. S.</given-names>
            <surname>Jr.</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. A.</given-names>
            <surname>Smith</surname>
          </string-name>
          ,
          <string-name>
            <surname>Jr.</surname>
          </string-name>
          ,
          <article-title>Income and Wealth Heterogeneity in the Macroeconomy</article-title>
          ,
          <source>Journal of Political Economy</source>
          <volume>106</volume>
          (
          <year>1998</year>
          )
          <fpage>867</fpage>
          -
          <lpage>896</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>C.</given-names>
            <surname>Carroll</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Slacalek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Tokuoka</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. N. White,</surname>
          </string-name>
          <article-title>The distribution of wealth and the marginal propensity to consume, Quantitative Economics 8 (</article-title>
          <year>2017</year>
          )
          <fpage>977</fpage>
          -
          <lpage>1020</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>C. D. Carroll</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Crawley</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Slacalek</surname>
            ,
            <given-names>M. N.</given-names>
          </string-name>
          <string-name>
            <surname>White</surname>
          </string-name>
          ,
          <article-title>Modeling the Consumption Response to the CARES Act</article-title>
          ,
          <source>Finance and Economics Discussion Series</source>
          <year>2020</year>
          (
          <year>2020</year>
          )
          <fpage>107</fpage>
          -
          <lpage>141</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>C.</given-names>
            <surname>Carroll</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . Kaufman, J. Kazil,
          <string-name>
            <given-names>N.</given-names>
            <surname>Palmer</surname>
          </string-name>
          ,
          <string-name>
            <surname>M. White,</surname>
          </string-name>
          <article-title>The Econ-ARK and HARK: Open Source Tools for Computational Economics</article-title>
          ,
          <source>in: Proceedings of the 17th Python in Science Conference</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>25</fpage>
          -
          <lpage>30</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>R. E.</given-names>
            <surname>Lucas</surname>
          </string-name>
          <string-name>
            <surname>Jr</surname>
          </string-name>
          ,
          <article-title>Asset prices in an exchange economy</article-title>
          ,
          <source>Econometrica: journal of the Econometric Society</source>
          (
          <year>1978</year>
          )
          <fpage>1429</fpage>
          -
          <lpage>1445</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>R. C.</given-names>
            <surname>Merton</surname>
          </string-name>
          ,
          <article-title>Lifetime Portfolio Selection under Uncertainty: The Continuous-Time Case</article-title>
          ,
          <source>The Review of Economics and Statistics</source>
          <volume>51</volume>
          (
          <year>1969</year>
          )
          <fpage>247</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Samuelson</surname>
          </string-name>
          ,
          <string-name>
            <surname>Lifetime Portfolio Selection By Dynamic Stochastic Programming</surname>
          </string-name>
          ,
          <source>The Review of Economics and Statistics</source>
          <volume>51</volume>
          (
          <year>1969</year>
          )
          <fpage>239</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>J. Y.</given-names>
            <surname>Campbell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. M.</given-names>
            <surname>Viceira</surname>
          </string-name>
          , Strategic Asset Allocation, Oxford University Press,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>L. M.</given-names>
            <surname>Viceira</surname>
          </string-name>
          ,
          <article-title>Optimal Portfolio Choice for Long-Horizon Investors with Nontradable Labor Income</article-title>
          ,
          <source>The Journal of Finance</source>
          <volume>56</volume>
          (
          <year>2001</year>
          )
          <fpage>433</fpage>
          -
          <lpage>470</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>J.</given-names>
            <surname>Sabelhaus</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Song,</surname>
          </string-name>
          <article-title>The great moderation in micro labor earnings</article-title>
          ,
          <source>Journal of Monetary Economics</source>
          <volume>57</volume>
          (
          <year>2010</year>
          )
          <fpage>391</fpage>
          -
          <lpage>403</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>