Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
91,241 characters · 20 sections · 31 citation commands
On learning agent-based models from data
\twocolumn[ \begin{@twocolumnfalse}
\end{@twocolumnfalse} ]
\footnotetext[1]{These authors contributed equally to this work.} \footnotetext[2]{To whom correspondence should be addressed. E-mail: [email removed]; [email removed]; [email removed]; [email removed]}
Agent-Based Models (ABMs) are computational models in which autonomous “agents” interact with one another and with their environment, thereby producing aggregate emergent phenomena wilensky2015introduction. ABMs are an extremely successful tool for theory development, that is, to explore the macro-level implications of micro-level assumptions railsback2019agent. As Axelrod axelrod1997dissemination said “whereas the purpose of induction is to find patterns in data [...], the purpose of agent-based modeling is to aid intuition”. In line with this focus on theory development, the ability of ABMs to match empirical data and make quantitative forecasts---that is, to learn from data---has been, so far, limited lux2018estimation,gatti2020rising,windrum2007empirical,deffuant2008agent.
At a very high level, all ABMs can be described by the formula
where $Z_t$ are the variables of interest in the system, $\Theta$ is a set of parameters, $\mathbb{P}_t$ is a probability function implicitly defined by model specifications, and $t$ is the discrete time index. Typically, $\Theta$ has relatively few components and a fixed dimensionality, is interpretable by a domain scientist, and is the only tuning knob of the model. $Z$ is at the same time the state and the output of the model. Each component of $Z$ typically refers to an individual agent, which results in high dimensionality. Some of $Z$ is observable, while the rest is latent.
Most of the efforts in learning agent-based models from data have focused on parameter calibration. This task refers to the process of finding a parametrization $\Theta$ that can reproduce some macroscopic characteristic of the data, and it typically boils down to comparing a few summary statistics of aggregate empirical and model-generated variables (e.g., time series) windrum2007empirical,lee2015complexities. Summary statistics are valuable to focus on the most important characteristics of the data that the modeler wants to explain, but they often have to be chosen arbitrarily, and may hide very different underlying patterns (as in the well-known Anscombe quartet).
Estimating agent-specific (or “micro”) variables $Z$ is instead not usually considered. We think this is the main obstacle to bringing ABMs closer to data and potentially using them as a forecasting tool. Indeed, if modelers do not correctly initialize latent micro variables and update their values as the simulation progresses, and if the dynamics of observed variables crucially depend on the initialization of latent variables, then model-generated time series are bound to diverge from empirical ones. Additionally, this mismatch implies that model-generated and empirical time series cannot be directly compared to produce a “goodness-of-fit” measure, so one must resort to summary statistics or “stylized facts” to calibrate parameters. The ABM community has recently started to explore data assimilation methods to estimate the latent variables of ABMs ward2016dynamic,lux2018estimation,clay2021real,cocucci2022inference; we explain the relation of this literature to our work in the Discussion.
This paper proposes a general methodology for estimating latent variables in ABMs. Our approach proceeds in three steps:
We showcase our approach by applying it to a housing market ABM specifically designed to study income segregation pangallo2019residential ((ref)). We use the ABM to generate synthetic data traces that we can use as ground truth (we would not have access to a ground truth for latent variables if we used real-world data traces). We distinguish between observable and latent variables based on how easy it usually is to access the relevant real-world data. The main latent variable in this model is the distribution of agents' incomes in each neighborhood, which is often not available. We instead assume that we observe neighborhood-level mean prices and the number of transactions over time (these data are usually readily available, see e.g. loberto2022whatdo). We believe this distinction to reflect a common real-world setting in economic models: one might have access to which actions are being performed, but not to the latent state of agents (e.g., where they live, and what is their income). We write the likelihood of prices and of the number of transactions as a function of the household income distribution. Next, we maximize this likelihood, thus estimating the time evolution of the spatial income distribution.
In synthetic experiments, we show that our procedure enables learning latent variables accurately: the Pearson correlation between the ground truth and learned traces ranges between 0.5 and 0.9, depending on the latent variable considered. At the same time, we show that an accurate estimation of latent variables empowers out-of-sample forecasting. Compared to other benchmarks that use rules of thumb to initialize the model at the beginning of the forecasting window, our procedure obtains lower Root Mean Squared Error (RMSE) with respect to the ground truth while being more principled. It also highlights potential identification problems, i.e., situations wherein multiple configurations of micro-variables correspond to the global maximum of the likelihood, so that the ground truth configuration cannot be identified.
We start from the housing market ABM presented by Pangallo et al. pangallo2019residential---henceforth, the “original ABM”. Our goal is to modify the original ABM until it is possible to write a computationally tractable likelihood of observed variables given latent variables and parameters. If we are able to do so, we say that the modified model is a learnable ABM. While writing a tractable likelihood function, we need to preserve the general behavior of the model, as well as its essential causality mechanisms.
In this section, we first give an overview of the original ABM; then, we describe the learnable ABM resulting from our `translation' process. Along the way, we highlight the specific transformations needed to make the original ABM learnable. A more detailed explanation of the equations describing our learnable model is given in Materials and Methods and summarized in (ref). (ref) reports the causal links between variables as a graphical model. Supplementary (ref) provides more details on the models and the trasnlation process.
\paragraph{Original ABM pangallo2019residential.} The ABM describes the housing market of a city composed of $L$ locations or neighborhoods, each with a number of indistinguishable homes, inhabited by agents. Each agent belongs to an income class $k$, out of $K$ income classes, each characterized by an income $Y_k$. At each time step, individual agents---represented as discrete units---choose a neighborhood to purchase a home if they act as buyers, or put their home on sale if they act as sellers. One fundamental insight encapsulated in this model is the formalization of the attractiveness of each neighborhood, which regulates how likely an agent is to bid for that location. The model assumes that the higher the income of residents, the more attractive a neighborhood is. In this original model, matching between individual buyers searching in a neighborhood and sellers in the same neighborhood is modeled as a continuous double auction. This process selects buyers and sellers sequentially at random, puts buyers in a queue ordered from highest to lowest bid price (and sellers from lowest to highest ask price), and, whenever a seller asks a price below the maximum bid price in the queue, matches the buyer with highest bid price to the seller with the lowest ask price. The social composition of the city evolves as a byproduct of these transactions, as high-income buyers may replace low-income sellers and lead to the gentrification of some neighborhoods. We report the pseudocode of this original model in (ref).
\paragraph{Learnable ABM.} In order to translate such ABM into a learnable model, we first rewrite it in terms of `counts', i.e., instead of having variables for each individual agent, with a small loss of generality we consider the aggregated information about the number of identical agents of each income class in each location. This way, we obtain a model that revolves around the state variable $M_t$: at each time step, $M_t$ is a matrix of $L \times K$ entries, where $M_{t, x, k}$ represents the number of agents of income class $k$ in location $x$ at time $t$. Similarly, the number of agents of class $k$ buying a house in location $x$ is represented by $D^B_{t,x,k}$, giving a total of $D_{t, x}=\sum_k D^B_{t,x,k}$ transactions. $D_{t, x}$ is in turn determined as the short side of the market, i.e., the minimum between the number of sellers and the number of buyers in each case. While these two numbers in the original model were stochastic, in our learnable model we use a mean field approximation, and replace the stochastic realizations with their expected value. The final key variable is $P_{t, x}$, which represents the average price of transactions that occur in location $x$ at time $t$.
\paragraph{Matching protocol.} The matching protocol between buyers and sellers clearly exemplifies the type of transformations needed for our purpose. The continuous double auction of the original ABM is indeed hard to translate into a computationally tractable likelihood. First, we assume that we do not have detailed information on buyers and sellers for individual transactions, so estimating, e.g., the stochastic sequence in which buyers and sellers enter the queue is not feasible. Second, picking the buyer with highest proposed price is equivalent to an $\operatorname{argmax}$ operation. Such operation is not differentiable, thus causing the whole likelihood to be not differentiable. Indeed, estimating its outcome would require enumerating all possible cases. To solve both issues, while preserving the properties of the model, we replace the continuous double auction by a multinomial distribution that gives higher probability of matching to buyers proposing higher prices (Equation (ref) in Table (ref)). This rule is differentiable and can be estimated from observed prices: higher prices indicate that richer agents have settled in the neighborhood.
Once we have translated the original ABM into its learnable counterpart, we design an algorithm that infers latent variables by maximizing the likelihood of these variables with respect to observed data and model's assumptions.
To start with, we need to determine which variables are observed and which are latent. To do so, we think of aggregate information about transactions as the only observable at our disposal. In particular, we assume to know, for each neighborhood and over time, the number of transactions $D_t$ and the average price $P_t$. Our key latent variable is instead $M_t$, the distribution of agents of each income class across neighborhoods. We believe this distinction to reflect a common real-world setting in economic models: one might have access to which actions are being performed, but not to the latent state of agents (e.g., where they live, and what is their income). As a matter of fact, in many countries it is relatively easy to obtain spatially granular data on transactions, but it is much harder to obtain such data on incomes loberto2022whatdo.
Note that $M_t$ can be computed deterministically given $M_{t-1}$ and $D^B_{t-1}$. Therefore, our problem reduces to finding an estimate for the latent stochastic variable $D^B_t$, over all time steps $t=1,\ldots,T$, and for the starting condition $M_0$, given $P_t$ and $D_t$: all the other variables are in fact deterministic, and their value is fixed given the formers. This scenario corresponds to the graphical model shown in (ref).
However, the number of possible states of $D^B$ grows exponentially with the total number of time steps $T$: evaluating all possible paths of agents over all time steps would be unfeasible even for small values of $T$. Therefore, we approach our problem as an online task monti2020learning, a common technique in machine learning in cases where processing the entire data set at once is unfeasible. We process the data per time step: at each $t$, the algorithm is presented with the newly observed values $D_t$ and $P_t$, and it updates its estimate of the latent variables $M_0$ and $D^B_t$, while considering all the values previously estimated as fixed. After the given time step $t$ has been processed, the algorithm is applied on $t+1$, and so on until the last time step $T$. This process---examining each time step from $t=0$ to $T$---is iterated for a number of epochs: after the last time step $T$ has been processed, the algorithm re-starts from the beginning, so that the first time steps are re-evaluated in light of successive ones.
To solve this optimization problem, we propose an expectation-maximization algorithm. Such an algorithm is able to obtain a maximum-likelihood estimate of the latent variables by optimizing the complete-data likelihood of the model. We outline its derivation in Materials & Methods (ref). It operates by repeating at each given time step $t$ the following process. First, it evaluates the likelihood of each possible behavior of the agents---i.e, the possible outcomes of $D^B_t$; then, it uses back-propagation and online gradient descent to find the best $M_0$ under this likelihood. These two steps are alternated until convergence. This way, at each time step it recovers the most likely value for $D^B_t$, and it updates its estimate for $M_0$. All the other variables of the ABM are obtained deterministically from these ones.
In order for the algorithm described thus far to be scalable, we need to solve one last computational challenge: even in a single time step $t$, the space of possible outcomes of each $D^B_t$ is huge since in principle one should consider the decisions of all individual buyers as independent. We solve this problem by considering that, while in agent-based modeling it is common to model the behavior of individual agents, for our purposes is sufficient to evaluate the chances of groups of identical agents moving to one location or another: the behavior of a single agent is irrelevant with respect to the data we observe. Therefore, instead of considering all the possible outcomes of each $D^B_t$, we consider only those set apart by at least $s$ agent, where $s$ is a learning hyper-parameter.
In order to evaluate the efficacy of our approach, we perform two sets of experiments. First, we assess its fidelity, i.e., how well our method recovers latent variables. To do so, we generate a synthetic dataset from the original ABM as ground truth, and feed the observable part of such data to our likelihood-maximization algorithm. Second, we show that learning latent variables allows us to produce more accurate out-of-sample forecasts compared to existing heuristics.
We consider the time series of the price $P_{t,x}$ and of the number of transactions $D_{t,x}$ at each location $x$ to be observable. We also assume that the macro-parameters that generated the data set (e.g., the total number of agents per location $N$, or the global income distribution) are known. Two other time series, namely that of inhabitants $M_{t,x,k}$ and buyers $D^B_{t,x,k}$, for all locations $x$ and incomes $k$, are considered latent: they are hidden from the algorithm and used as a validation for what the algorithm learns.
We use the original ABM to generate 20 data traces with $L=5$ locations, $K=3$ income classes, and $T=20$ time steps that we use as ground truth. Each data trace differs from the others in the random initialization of $M_0$. We use the first 10 traces as training set to tune the hyperparameters of the algorithm (see Supplementary (ref)). Then, on the remaining 10 traces that we hold out as test set, we evaluate the performance of the algorithm by computing the Pearson correlation coefficients between learned time series and ground truth ones. Note that our learning algorithm uses the data from the learnable ABM to specify the likelihood, so there is some misspecification compared to the original ABM used to generate the ground truth. For completeness, we also repeat the same evaluation by using the learnable ABM to generate ground-truth data traces, thereby removing misspecification. We view this latter test as a sanity check for the algorithm.
(ref) shows the results for the test sets. As expected, our ability to reconstruct latent variables is higher for traces generated with the learnable ABM, as there is no misspecification. Perhaps more interestingly, our algorithm reconstructs the time series of buyers $D^B_{t,x,k}$ with higher fidelity than the time series of inhabitants $M_{t,x,k}$ (mean correlation $\rho=0.86$ vs. $\rho=0.52$ with traces from the original ABM). Even though $M_{t,x,k}$ proves to be harder to reconstruct, we still obtain an informative estimate, that further improves when misspecification is removed ($\rho=0.79$). We conjecture that this difference in results may due to the fact that $D^B_{t,x,k}$ is a “flow” variable that does not depend explicitly on previous time steps, while $M_{t,x,k}$ is a “stock” variable that depends on the whole history, so errors in estimating $M_{t=0}$ accumulate at following time steps. These results also hint at an identification problem in the original ABM, which we elaborate on further at the end of this section. Regarding the observable variables, our algorithm fits the prices $P_{t,x}$ almost perfectly ($\rho=0.99$), and the number of transactions $D_{t,x}$ very well ($\rho=0.85$). Without misspecification, the fit for the number of transactions is perfect ($\rho=1.0$). While such a good fit for observable variables is expected, since our inference method works by minimizing the distance from observable variables, this result indicates that there is no major misspecification introduced by using the learnable ABM to infer latent variables from traces of the original ABM. In other words, our translation does not alter the nature of the original model.
(ref) zooms in on a representative trace generated by the original ABM. For fairness, we choose this experiment as the median one in terms of performance (i.e., correlation between the ground truth and estimated values of $M$). These time series confirm the intuition from (ref): our approach is able to reconstruct $P_t$ and $D_t$ extremely well and it is also quite precise at reconstructing $D^B_t$. Our estimate of $M_t$ is also very accurate in most cases, but imprecise estimates of the initial conditions $M_0$ lead in a few cases (for instance, in location $x=3$) to an inaccurate reconstruction. In a few cases, in fact, the algorithm finds a local minimum that does not correspond to the ground truth.
One of the possible reasons behind this behavior is the presence of an identification problem. We show in fact that, in some cases, the likelihood of the observed data is the same for different possible values of the latent variable $M_0$. While these possible values include the ground truth (or, in case of misspecification, values extremely close to it) the model does not have enough information to distinguish it from the other possible optimal values of $M_0$. This phenomenon is intrinsic to the ABM under study, once we identify $P$ and $D$ as observable and $M_0$ as latent. We provide a concrete example in Supplementary (ref). (ref) shows a representation of the likelihood able to efficiently visualize such issues. Our approach allows in fact to formally define and thus diagnose such issues. Of course, one could also do this by sampling from the parameter space and computing summary statistics, as with Approximate Bayesian Computation (ABC) calibration methods (see, e.g., Ref. dyer2021approximate). Our approach, which features a closed-form of the likelihood, has three advantages over these methods: ($i$) higher accuracy, as we do not have sampling error; ($ii$) higher efficiency, as we do not need to repeatedly execute the model; and ($iii$) the possibility to look for local minima using gradient-based methods.
Except for a few recent attempts venkatramanan2018using,gatti2020rising,poledna2020economic, so far the use of ABMs for forecasting has been limited. A key problem is that ABM state variables are mostly latent, as it is often hard to observe information that describes individual agents. To the extent that the aggregate dynamics depend on the agent states, a wrong initialization of the latent state variables is likely to lead to a very inaccurate forecast. In this section, we explicitly test whether this is true for our model by using synthetic experiments. To shift our focus away from misspecification errors, we use the learnable ABM to generate the ground truth. We extend each of the 10 test traces for 5 additional time steps, so that the total length of each simulation becomes $T'=25$. To perform the forecast, we initialize the learnable ABM at $t=20$ with a given estimate of the latent state variables $M_{T=20}$, and let it produce the time series $P_t$ and $D_t$ for the out-of-sample time steps $t \in [21,25]$. We compare five approaches for the estimate of the latent variable $M_T$:
To evaluate the quality of the forecasts obtained by these approaches, we compute the Root Mean Squared Error (RMSE) for the observable time series $P_t$ and $D_t$, summing the errors from time step $t=21$ up to $t=T'=25$. (ref) shows the results. We do not report the values for the Random approach as it has RMSE=12, well above that of the other approaches. Our Learnable approach substantially improves over the Proportional and Time series approaches, and essentially on par with the ground truth benchmark. This is a strong improvement, but we believe that the value of our approach goes beyond this aspect. In fact, alternative approaches are heuristics, that do not yield much insights about inference. By contrast, our approach is more principled: it frames the problem of estimating unobservable variables of an ABM into probabilistic inference. This methodology opens new research directions to further improve our results. For instance, designing learnable ABMs from the start, for which there would be no misspecification error. Even more importantly, it makes it possible to formally reason about the likelihood of an ABM---for instance, to spot potential identification problems.
Now that we have shown the advantages of our method in terms of predictive capabilities, we discuss its general applicability. From the specific translation of the housing market ABM considered in this paper, we can identify some general design principles, that we believe will be useful in making other ABMs learnable.
First of all, it was necessary to tune the level of stochasticity of the model by considering which variables are observed and which are latent. In most graphical models, latent variables are stochastic random variables that are related to the observable ones---indeed, if they were deterministic, they could be computed exactly welling2008deterministic. All stochastic variables that are not observed must be estimated, thus increasing both the computational complexity of the process and the uncertainty of the model. However, in our translation, we have room to decide which variables are deterministic and which are stochastic. To make the model truly learnable, we need to balance observable and latent variables so that for every latent variable we have some observable that intuitively makes it possible to estimate it. We can encapsulate this first design principle as follows.
Second, we needed to carefully consider which variables and functional forms should be discrete. ABMs often consist of discrete units, and it is common for agents to choose between different discrete possibilities. However, discreteness makes likelihood optimization problematic. Indeed, whenever we deal with discrete variables, the likelihood must consider all possible combinations of values for discrete stochastic variables, which greatly increases the computational burden of the approach. Moreover, in some cases the likelihood may be flat over some region of the latent space, thus hindering the progress of optimization algorithms such as gradient descent. Given these considerations, it is important to limit the use of discrete variables to the ones that are critical to the behavior of the model.
Following these principles, it should be possible to transform any ABM into a learnable one, given enough data. While the translation in this paper was still hand-curated, it is a first step towards its proper formalization, and thus automatization.
Nevertheless, different alternative methods have been suggested in the literature to obtain similar results. Making the state of the system compatible with real-world observations has traditionally been the goal of data assimilation techniques, such as the various versions of the Kalman filter or the particle filter. Originally developed in meteorology and geosciences carrassi2018data, data assimilation techniques have recently been employed in ABM research ward2016dynamic,lux2018estimation,clay2021real,cocucci2022inference. These works treat the ABM as a black box, adjusting ABM state variables so that forecasts come closer to observations. The main advantage of data assimilation techniques over our approach is that they do not require building a new model (the learnable ABM). At the same time, our approach offers several advantages.
(i) It deals with the estimation of discrete variables in a natural and principled way. Standard data assimilation methods only allow to tune continuous variables ward2016dynamic,lux2018estimation, and recent attempts to deal with discrete variables clay2021real,cocucci2022inference tend to be heuristic and problem-specific.
(ii) Its closed-form likelihood can be maximized with computationally efficient gradient-based methods, by leveraging deep learning frameworks/architectures.
(iii) Such closed-form likelihood is also an essential tool to analyze identification problems, thus offering explanations about the estimated variables.
(iv) While Kalman filters require Gaussian or quasi-Gaussian noise, and linear or weakly non-linear functional forms, our approach can easily integrate most types of stochastic element and non-linearities.
Considering these advantages, we believe that likelihood-based estimation of ABM micro-states is a promising direction to obtain more principled approaches to data-driven ABMs.
In this work, we have shown how to translate a complex agent-based model into a probabilistic graphical model to obtain a learnable ABM. For this type of model, methods such as maximum likelihood estimation can be used to estimate latent micro-state variables of the agents coherently with both the model and with provided data. Then, we proposed an expectation-maximization algorithm for the resulting learnable ABM in order to estimate the latent variables given the observed ones. We have shown that this process is indeed able to recover unobserved variables that are in line with the learnable model, as well as with the original one, under a variety of settings. This way, we can feed such learned variables to the ABM, and obtain an evolution of its micro-states that is in line with the provided data. This procedure empowers the ABM to be used as a forecasting tool.
Building a fine-grained link between an ABM and observed data opens the way for different exciting opportunities. As we have shown in this work, it allows in the first place for better usage of ABMs as instruments for prediction. Initializing agents' micro-states in a way that is coherent with observed data means that their future trajectory can be regarded as the best compromise between the theoretical model assumptions and the available observations. Therefore, the quality of the predictions can also be used as a direct validation (or falsification) of the causal model embodied in the ABM. Besides these immediate advantages, however, more advanced possibilities are opened. For instance, defining the likelihood of the model w.r.t. the observations allows to perform model selection by using available data. In other words, it allows using ABMs to formulate hypotheses and test them against real data. While this technique has been shown to work properly in simple cases monti2020learning, its application to more complex ABMs requires further analysis and paves the way for novel research directions. Furthermore, the translation of an ABM into a probabilistic model forces the modeler to lay bare their assumptions, and to consider the inferential problem. This way, it brings forth possible identification problems: when different models (or realizations of the same model) lead to the same observable state, how can we choose one in practice? Such a problem, often ignored in ABM research, will be vital to consider in further applications of ABMs to real-world data.
Our approach for learnable ABMs stems from the general framework of probabilistic graphical models jordan2004graphical. While their application to ABMs opens possibilities for interdisciplinary cross-pollination, it also poses new theoretical challenges. Because of the complexity of ABMs, many methods commonly applied such as Markov Chain Monte Carlo (MCMC) jordan2004graphical become computationally unfeasible. Because ABMs aim to model emergent behavior through the combination of many simple rules, they often involve long chains of dependences among variables, often with highly non-linear behavior. Hence, many desirable theoretical properties necessary for the convergence of MCMC might be missing, such as the uniqueness of the posterior distribution hill2019stationarity. More in general, such a distribution is often very complex and high-dimensional, and difficult to learn through sampling techniques. Thus, we choose to maximize the likelihood by leveraging gradient descent and automatic differentiation van2018automatic. Interestingly, because of the long sequences of deterministic transformations typically found in ABMs, our optimization task ends up resembling deep learning ones. However, while the transformations in deep learning are purely data-driven---i.e., transformations aim only at maximizing prediction accuracy---our methodology still places an emphasis on causal mechanisms: each transformation represents an aspect of the theory being modeled.
Here, we give a minimal description of the learnable model. In Supplementary (ref) we provide a longer description as well as a detailed interpretation of each modeling assumption.
The model represents the housing market of a city with $L$ locations or neighborhoods denoted by $x=1,\ldots,L$, each with $N$ indistinguishable homes, inhabited by agents that are only distinguished by their income class $k=1,\ldots,K$. The vector of state variables $Z_t$ is composed by the variables $\{M_{t,x,k}\},\{P_{t,x}\},\{R_{t,x}\}$, where $M_{t,x,k}$ is the number of agents of income $k$ living in location $x$ at time $t$; $P_{t,x}$ is the average price of location $x$ at time $t$; and $R_{t,x}$ is the inventory of unsold homes at location $x$ at time $t$. These state variables are updated according to deterministic and stochastic equations that represent the demand and supply sides of the housing market, and the matching between potential buyers and sellers. The causal links between these variables are summarized in (ref). All the equations of the model, \Crefrange{eq:M1}{eq:M13}, are listed in (ref).
\Crefrange{eq:M1}{eq:M3} characterize the number of buyers from each income class that try to buy a house at each location at time $t$. Buyers prefer to live in locations with higher attractiveness $A_{t,x}$, which depends on a constant local intrinsic attractiveness $A_x^I$ and on the time-varying average income at that location, captured through $Y_k$---the income of agents in income class $k$ \labelcref{eq:M1}. However, locations with high attractiveness may also be more expensive, so the probability $\pi_{t,x,k}$ for a buyer of income class $k$ to choose location $x$ also depends on the difference between their possibility to pay---here exemplified by income $Y_k$---and price $P_{t,x}$ \labelcref{eq:M2}. Finally, the number of potential buyers of income class $k$ for location $x$ at time $t$, $N^B_{t,x,k}$, is given by simply assuming that, for each income class $k$, a fraction $\Gamma_k$ of the total buyers $Q$ distribute themselves among all locations following probabilities $\pi_{t,x,k}$ \labelcref{eq:M3}.
Next, \Crefrange{eq:M4}{eq:M5} characterize the supply side of the market. The number of sellers $N_{t,x}^S$ is given by the inventory of houses on sale at the previous time, $R_{t-1,x}$, plus a fraction $\alpha$ of the houses that were not on sale \labelcref{eq:M4}. Moreover, the minimum price that the sellers at location $x$ are willing to accept, $P^S_{t,x}$, is a smooth function of the ratio between the number of buyers and sellers at $x$: when there are more buyers than sellers, sellers refuse to sell at a price below $P_{t-1,x}$; conversely, when there are more sellers, they are willing to sell at a discount, up to a price that is $1-\delta$ of $P_{t-1,x}$ \labelcref{eq:M5}.
The demand and supply sides of the market are matched in \Crefrange{eq:M6}{eq:M11}. The number of deals or transactions $D_{t,x}$ is the short side of the market, i.e., the minimum between the number of buyers and sellers \labelcref{eq:M6}. When there are more buyers than sellers, only some buyers are able to secure a deal. The probability that agents from income class $k$ secure a deal at $x$ is represented by $\pi_{t,x,k}^D$, which is proportional to the number of buyers from class $k$ and to their income \labelcref{eq:M7}. The number of buyers of each income class who secure a deal, $D_{t,x,k}^B$, is given by the $D_{t,x}$ realizations of a multinomial with parameter $\pi_{t,x,k}^D$ \labelcref{eq:M8}. In this way, the outcome of this random variable has to be consistent with $D_{t}$: the total number of buyers in each location $x$ is fixed to $D_{t,x}$; for each location, the buyers are distributed among income classes according to $\pi_{t,x}^D$. The number of sellers from class $k$ who manage to sell at location $x$ ($D_{t,x,k}^S$) is instead simply proportional to the fraction of $k$-agents living in location $x$ \labelcref{eq:M9}. With \Crefrange{eq:M6}{eq:M9} having determined the income classes of buyers and sellers, (ref) specify the average (observed) price of transactions $P_{t,x}$. The model assumes that this is a weighted mean \labelcref{eq:M11} of the maximum price that the average buyer is willing to pay, $P^B_{t,x}$ \labelcref{eq:M10}, and of the minimum price that sellers are willing to accept, $P^S_{t,x}$ \labelcref{eq:M5}.
As a last step, we update the remaining state variables in (ref), simply by tracking the number of buyers and sellers in each class and location.
Here, we provide a more detailed description of our algorithm. Following our online assumption, its goal is to estimate latent variables at time $t$ by looking at observables at the same time step, and treating all the previously estimated variables as fixed. Specifically, $D^B_0, \dots, D^B_{t-1}$, i.e. the buyers who previously relocated, and the corresponding sellers $D^B_0, \dots, D^B_{t-1}$, are fixed. Therefore, the algorithm observes $P_t$ and $D_t$, and then it provides a new estimate of $D^B_t$, and update the estimate of $M_0$. In fact, since previous $D^B$ and $D^S$ are fixed, $M_t$ is a deterministic function of the latent variable $M_0$
allowing us to treat $M_0$, and not $M_t$, as our latent variable.
Since our observed variables are in principle also a deterministic result of the others, we model their observed value as a noisy proxy of the value determined by the agent-based model rules. Specifically, for prices we assume that we observe $\tilde{P}_t$, given by $\tilde{P}_t=P_t + \epsilon_P$, where the error $\epsilon_P$ is normally distributed and $P_t$ is the deterministic estimate of prices as computed by the model (see (ref)). Similarly, the number of observed deals $\tilde{D}_t$ will follow $\tilde{D}_t = D_t + \epsilon_D$.
Now, computing the likelihood of the observed prices $\tilde{P}_t$ requires knowledge of the latent variable $D^B_t$, that is, the distribution of buyers among classes and locations, which is a discrete outcome of a stochastic process dependent on our main latent variable $M_0$. Therefore we resort to the (Generalized) Expectation Maximization algorithm. In this way, we alternate between evaluating the expectation of $D^B_t$ and updating our estimate of $M_0$ under the current estimate of expectation. The latter can be performed with online gradient descent, since---once we fixed the probability of each possible outcome of $D^B_t$---what remains of the likelihood is a continuous and differentiable function of $M_0$.
First, observe that $\tilde{P}_t$ and $\tilde{D}_t$ are independent given $M_0$. In fact, $D_t$ is fixed given $M_0$; the distribution of $D^B$ is also fixed, since it is determined from $D_t$ and $\pi^D$; and the error $\epsilon_D$ is drawn independently from the extraction of $D^B$ from such distribution and from $\epsilon_P$. Therefore we can factorize the complete-data likelihood w.r.t. observed data $\mathbb{D} = \{ \tilde{P}_t, \tilde{D}_t \}$ as:
Since computing $\mathbb{P}(\tilde{P}_t | M_0) = \sum_{D_b} \mathbb{P}(D_b | M_0) \mathbb{P}(\tilde{P}_t | D_b, M_0)$ without the knowledge of the latent variable $D^B_t$ would be unfeasible, we resort to the Generalized Expectation Maximization algorithm, alternating these two steps until convergence:
Noting that $\tilde{D}_t$ does not depend on $D^B_t$ (see (ref)), the last probability can be decomposed as
These two elements are given by the gaussian distribution of the errors $\epsilon_P, \epsilon_D \sim \mathcal{N}(0, \sigma)$ ($\sigma$ being a hyper-parameter), between $P_t$ and $\tilde{P}_t$, and $D_t$ and $\tilde{D}_t$ respectively. Note that $P$ and $D$ are a deterministic function of the latent variable $M_0$ we are optimizing, through the chain of deterministic equations of the ABM ((ref)). The only free variable is in fact $M_0$, since the previous variables from time steps $t' < t$ are assumed to be fixed, and the value of $D^B$ is known for the assumption of EM. Therefore, since all these deterministic functions are continuous and differentiable in the general case, it is easy to update $M^*_0$ ascending the gradient $\nabla_{M^*_0}\mathbb{Q}(M^*_0)$. The complexity of computing this gradient is left to differentiable programming frameworks.
Nevertheless, this approach presents a problem: the set $\Omega$ of possible values for $D^B_t$, the matrix of numbers of actual buyers for each class and each location, is potentially huge (precisely, $\tbinom{n+k-1}{n}$ with $n$ buyers and $k$ classes). We solve this problem with two considerations: first, we will show that $\tilde{P}_{t, x} \perp \!\!\! \perp \tilde{P}_{t, y} | D_{t}, \pi^D_{t}$; second, we are not interested in all the possible values for the number of actual buyers: the behavior of a single agent is irrelevant with respect to the data we observe. Let us analyze these two key points.
The first consideration stems from the the independence of outcome in different neighborhoods: $D^B_{t, x} \perp \!\!\! \perp D^B_{t, y} | D_{t}, \pi^D_{t}$. This fact follows naturally from (ref), since all locations are independently drawn. As a consequence, also the probability of observed prices $\tilde{P}_{t, x}$ and $\tilde{P}_{t, y}$ are independent from each other for any two locations $x \neq y$, since (ref) and (ref) do not have any inter-location effect, and the observation noise $\epsilon_P$ is also independent across locations. Therefore $\tilde{P}_{t, x} \perp \!\!\! \perp \tilde{P}_{t, y} | D_{t}, \pi^D_{t}$ and we can write:
Thus, we can factorize (ref) in a more practical way. Let us call $\Omega_x$ the set of all possible values for $D^B_{t, x}$, given a location $x$. Then, our algorithm becomes an iteration of the following two steps until convergence.
To define the set $\Omega_x$ we take advantage of the second key point: two different values of $D^B_{t, x}$ might be indistinguishable in practice given our data, if they differ only by a few agents. Thus, instead of considering all the possible partitions of the integer $D_{x,t}$ in $K$ positive integers, we only consider their quotient for a given constant $s$ (i.e., $ \left \lfloor D_{x,t} / s \right \rfloor $): this can be thought of as the possible outcomes obtained by moving groups of $s$ agents at a time. Any difference below $s$ is considered negligible. In practice, we set $s$ as a consequence of the available memory. Given a maximum size for $|\Omega|$, we set a threshold for each $|\Omega_x|$ proportional to its original size $\tbinom{n+k-1}{n}$. Here, we keep in consideration the effective number of classes $k \leq K$ that can afford a location, since both $P_{t-1}$ and $Y$ are assumed to be known at time $t$. After setting this threshold, we find the minimum $s$ s.t. $|\Omega_x|$ respects such threshold.
M.P. acknowledges funding from the James S. Mc Donnell Foundation.
\scriptsize
\onecolumn
{ Supplementary Information}
This section provides more details about the original ABM ((ref)), the learnable ABM ((ref)), and the comparison between the two ((ref)).
Pangallo et al. pangallo2019residential introduce an ABM that describes the housing market of a city. It is beyond the scope of this section to fully repeat the description of the model and to justify each assumption, so we give a brief overview and report the pseudocode of the model (see (ref) and (ref)).
The city has $N \cdot L$ inhabitants (see (ref) for a summary of the notation used), with $Q$ buyers coming to the city every time step to purchase a home, divided between $\gamma_k$ buyers belonging to income class $k$, $k=1,\ldots K$, such that $Q=\sum_k \gamma_k$. Each inhabitant $i$ is characterized by four state variables that can change over time $t$: state $s_{t,i}$ (buyer, housed, seller), reservation price $P_{t,i}^R$, location $x_{t,i}$, and a categorical income $Y_{t,i}$, that belongs to one of the $K$ income classes. The city is composed of $L$ neighborhoods or locations $x$ that are distinguished by their intrinsic attractiveness $A_x^I$, social attractiveness $A^S_{t,x}$ (which depends on which agent inhabit the neighborhood), and market price $P_{t,x}$.
The model is initialized following some protocol to locate agents with different income in the city (e.g., uniformly at random, or following some predefined spatial distribution). After that, at each time step $t$ some buyers come to the city to purchase a home, some housed agents decide to leave and sell their home, and buyers and sellers at each location are matched via a continuous double auction.
(ref) details the operations that occur at each time step. First, the model updates some location-specific variables which reflect the change in social composition that occurred in the previous time step (\crefrange{alg:1:bookkeep}{alg:1:bookkeep-end}). These include updating the average income and social attractiveness at each location and then computing the utility for agents of a given income class at a given location. Next, buyers choose a location where they try to purchase a home (\crefrange{alg:1:buyers}{alg:1:buyers-end}). After that, housed agents may put their home on sale with probability $\alpha$ and set a reservation price by applying a markup $\mu$ to the market price of the location where they live (\crefrange{alg:1:sellers}{alg:1:sellers-end}). Agents that decided to sell their home in previous time steps but were unsuccessful reduce their price by a factor $\lambda$ every $\tau$ time steps (\crefrange{alg:1:reservation}{alg:1:reservation-end}). Finally, buyers and sellers are matched at each location via a continuous double auction, and successful buyers replace successful sellers (\crefrange{alg:1:book}{alg:1:book-end}).
(ref) details the continuous double auction process. At each location, there is a set of buyers $\mathcal{B}_{t,x}$ and a set of sellers $\mathcal{S}_{t,x}$ (\crefrange{alg:2:agentsets}{alg:2:agentsets-end}). If there are in fact either no buyers, or no sellers, or all reservation prices of the buyers are lower than the reservation prices of the sellers, no transaction takes place, and the market price does not get updated (\crefrange{alg:2:case-no-transactions}{alg:2:case-no-transactions-end}). If instead at least one transaction can occur (\crefrange{alg:2:book}{alg:2:book-end}), the following process takes place. First, one creates auxiliary lists of buyers and sellers (also known as logs), $\mathcal{O}_{t,x}^B$ and $\mathcal{O}_{t,x}^S$ respectively, and fills them as agents are drawn uniformly at random from the common pool of buyers and sellers. Every time that a buyer with a higher reservation price than a seller enters $\mathcal{O}_{t,x}^B$ (or a seller with a lower reservation price than a buyer enters $\mathcal{O}_{t,x}^S$), the buyer with highest reservation price is matched with the seller with lowest reservation price. The price of the transaction is the weighted mean of the respective reservation prices, with weight given by a parameter $\nu$ capturing bargaining power, and this individual transaction price is added to the list $\mathcal{P}_{t,x}$. Finally, the seller leaves the city and the buyer settles where the buyer was. The market price is computed as the mean of the transaction prices.
\FloatBarrier
This section gives a more detailed description of the learnable ABM than (ref) in Materials & Methods, and details the interpretation for each equation of the model. Table (ref) can be used as a reference for notation throughout this section (although some notation overlaps with that of (ref), there are a few differences and so we prefer to present the two tables as separate).
Agents are divided into $K$ income classes, each characterized by income $Y_{k}$, $k=1,\ldots,K$. All agents within the same income class, also named $k$-agents, are assumed to be identical and indistinguishable. The city is composed of $L$ locations denoted by $x$.
Let $M_{t,x,k}$ be the number of inhabitants of class $k$ living at location $x$ at time $t$. As shown in Table (ref), this number is a real rather than an integer. We make this choice for computational reasons but, as we typically deal with large values of $M$, it does not substantially affect our results. We assume that each location $x$ is characterized by an attractiveness $A_{t,x}$ that can change over time, given by
In the equation above, the first term $A^I_{x}$ is an intrinsic attractiveness that is fixed over the simulation. It captures relatively permanent city features, such as amenities, schools, and public transport. The other term captures an attractiveness towards wealthier neighborhoods that can vary in time. It is defined by the mean, one-period lagged, income at location $x$, $\overline{Y}_{t-1,x}=\sum_k M_{t-1,x,k}Y_k/N$, divided by the mean income over the city $\overline{Y}_{t-1}=\sum_x \sum_k M_{t-1,x,k}Y_k/NL$. Thus, location $x$ whose mean income is higher than average, i.e., $\overline{Y}_{t-1,x}>\overline{Y}_{t-1}$, is, ceteris paribus, more attractive than locations whose mean income is lower than average.
In their decision to move to location $x$, agents in income class $k$ also take into account the affordability of location $x$, i.e., the difference between their willingness to pay, here simply captured by their income $Y_k$,\footnote{As discussed more at length in pangallo2019residential, willingness to pay is proportional to income, so it would be enough to rescale incomes by a constant factor. Here, since we are not working with real-world data, we take this constant factor equal to unity.} and the average price at $t-1$, $P_{t-1,x}$. The utility of $k$-agents for location $x$ is then given by\footnote{This is an indirect utility function, derived from a standard utility function in urban economics and from the saturation of the budget constraint. A standard assumption for the utility function in urban economic models is a Cobb-Douglas in which agents mix between housing services, here exemplified by the attractiveness $A_{t,x}$, and a composite of non-housing goods and services $z_{k,t}$, i.e., $U_{t,x,k}=z_{k,t}^{1-\beta} A_{t,x}^\beta$. Agents face a budget constraint $P_z z_{k,t} + \mathbb{E}[P_{t,x}] = Y_k$, where $P_z$ is the price of the non-housing composite and $\mathbb{E}[P_{t,x}]$ is the price that they expect to pay to buy a house at location $x$ at time $t$. Because agents do not know the price $P_{t,x}$, which will be formed as a consequence of their decisions, they use the previous price $P_{t-1,x}$ as their expectation for $P_{t,x}$, i.e., $\mathbb{E}[P_{t,x}] = P_{t-1,x}$. Renormalizing prices so that $P_z=1$ and solving for $z_{k,t}$ yields the expression in (ref).}
where $\beta\in (0,1)$ gives the relative weight of attractiveness relative to affordability. When $\beta$ is close to 1, agents care little about affordability, while when $\beta$ is close to 0 the opposite holds. If location $x$ is unaffordable ($Y_k \leq P_{t-1,x}$) then $V_{t,x,k}=0$. Buyers in income class $k$ are willing to bid up to their income $Y_k$, i.e., their reservation price $P^B_{t,x,k}$ is equal to $Y_k$.
Summing up, $k$-agents looking to buy a house in the city evaluate a utility $V_{t,x,k}$ for all locations $x$. They then choose a location $x$ where they try to buy a house with probability $\pi_{t,x,k}$ proportional to $V_{t,x,k}$, i.e.
We assume that a total of $Q$ agents come to the city at each time step looking to buy a house, and that a share $\Gamma_k$ of these agents is in income class $k$. The number of buyers of income class $k$ at location $x$ at time $t$, $N_{t,x,k}^B$ is given by
i.e., it is the expected value of a multinomial with $Q\Gamma_k$ trials and a probability vector given by the $L$ values of $\pi_{t,x,k}$, for all locations $x$ ((ref)).
In each location $x$, the other side of the market is composed by sellers. We do not distinguish the income class of potential sellers, in the sense that we just keep track of the total number of agents willing to sell their house at location $x$ at time $t$, $N_{t,x}^S$. The total number of sellers is obtained by summing the number of agents who wanted to sell at the previous time steps but did not succeed, $R_{t-1,x}$, and the number of agents who decide to put their house on sale at $t$. In turn, this number is given by a fixed fraction $\alpha$ of the agents that had not decided to sell before $t$, which represent the difference between the total number of agents residing at location $x$, $N_x$, and $R_{t-1,x}$. In formula,
The way sellers determine their reservation price, i.e., the minimum price they are willing to accept, is more sophisticated. Here, we assume that sellers are not willing to accept any price below the average price at the previous time step, $P_{t-1,x}$, as long as there are more buyers than sellers. This choice captures the idea that, in this situation (known as a “sellers market”), sellers have more bargaining power than buyers. Conversely, when there are more sellers than buyers, sellers compete for the few buyers by being aggressive in reducing their reservation price. So, they are willing to accept offers that can be below $P_{t-1,x}$. We let $\phi_{t,x}=\left(\sum_k N^B_{t,x,k}\right)/N_{t,x}^S$ denote the ratio between the number of potential buyers and of potential sellers at location $x$ and time $t$. We then assume that sellers are willing to accept prices lower than $P_{t-1,x}$ by a fraction $\delta$ if there are more sellers than buyers, i.e., $\phi_{t,x}\rightarrow 0$. Conversely, when there are more buyers than sellers ($\phi_{t,x}\rightarrow \infty$), sellers are not willing to go below $P_{t-1,x}$. We interpolate between these extreme values of $\phi$ by assuming a hyperbolic tangent functional form, i.e., we assume that the sellers' reservation price $P^S_{t,x}$ is given by
Here, we assume that sellers decide on their reservation price independently of their income class.
At this point, the two sides of the market have been completely characterized, as we know the number of buyers in each income class $N^B_{t,x,k}$, their reservation price $P^B_{t,x,k}$, the number of sellers $N^S_{t,x}$, and their reservation price $P^S_{t,x}$. It remains to be determined how buyers and sellers are matched,t and how this matching impacts future prices and the social composition of neighborhoods.
To start, let $D_{t,x}$ denote the number of deals that occur at location $x$ and time $t$, i.e., the number of transactions that effectively occur between buyers and sellers. This number is given by the “short side of the market”, i.e., by the minimum between the number of potential buyers and potential sellers:
In case there are fewer deals than potential buyers, i.e., $D_{t,x}<\sum_k N^B_{t,x,k}$, we need to decide which potential buyers are successful in actually buying a house and which are not.
To do so, we assume that demand is satisfied on a pro-rata basis, although correcting the pro-rata assumption by making richer buyers more likely to secure a deal. This assumption captures a bargaining process in a more tractable way than explicitly simulating an auction. Thus, the probability that $k$-agents are able to secure a deal at location $x$ and time $t$, denoted as $\pi^D_{t,x,k}$, is proportional to the number of potential buyers in that class, $N^B_{t,x,k}$, multiplied by the difference between the reservation price of $k$-buyers and that of sellers, $Y_k-P^S_{t,x}$:
Then, we compute the number of actual buyers of class $k$ at time $t$ in location $x$ by a multinomial with $D_{t,x}$ trials and a parameter vector of length $k$ given by $\pi^D_{t,x,k}$:
We further compute the number of actual sellers $D^S_{t,x,k}$ by assuming that all agents living in location $x$ are equally likely to sell, and so the share of $k$-agents among the sellers is proportional to the share of $k$-agents among the inhabitants, $M_{t-1,x,k}/N$:
As above, this simplification ensures tractability, as keeping track of the number of sellers in each class over time would substantially increase the dimensionality of the space of state variables.
Next, after we determine which buyers and which sellers are successful in securing a deal, we need to determine the price of the transactions. First, we compute the average buyer reservation price $P^B_{t,x}$ as
Then, we assume that the average transaction price is a weighted average between the reservation price of buyers and that of sellers:
Here, $\nu$ denotes the bargaining power of sellers as, the larger $\nu$, the higher the transaction price will be.\footnote{It is always $P^B_{t,x} > P^S_{t,x}$ because (i) $P^B_{t,x}>P_{t-1,x}$ (as only buyers whose reservation price is larger than $P_{t-1,x}$ come to location $x$, see (ref)) and (ii) $P^S_{t,x}<P_{t-1,x}$, see (ref).}
It only remains to update the stocks of inhabitants $M_{t,x,k}$ of each class $k$ in each location $x$ and of unsuccessful sellers $R_{t,x}$ in $x$. For each class and each location, the number of inhabitants is given by the number of inhabitants on the previous time step, plus the buyers who secured a deal, minus the sellers who were able to sell:
The number of unsuccessful sellers is obtained by summing the unsuccessful sellers on the previous time step to the number of sellers at $t$, subtracting the number of deals:
We need to perform several modifications in order to make the original ABM learnable (see (ref) for a summary).
As a general principle, while in the original ABM the state of the system was described by the variables of individual agents $i$, in the learnable ABM we only consider counts of how many agents are within each income class. For instance, in the original ABM we keep track of the state $s_{t,i}$, income $Y_{t,i}$ and location $x_{t,i}$ of each agent $i$, while in the learnable ABM the variable $M_{t,x,k}$ counts how many agents of income $k$ are either housed or sellers at location $x$, the variable $R_{t,x,k}$ counts the sellers that were not successful in selling, and so on. This general modification does not lose much information. Indeed, the key heterogeneity that distinguishes agents in the original ABM is which income class they belong to, which is kept in the learnable ABM. We discuss below some examples where considering agent counts makes (or does not make) some difference. The rationale for this general principle is that we assume that we only observe aggregate data at the level of locations, and so we must be parsimonious with unobserved variables.
We now discuss the modifications one by one. First note that the probability for buyers to search for a home in a given location does not change from the original to the learnable ABM. For instance, although the specifications look different, (ref) and \crefrange{alg:1:bookkeep}{alg:1:bookkeep-end} in (ref) are identical. At the same time, (ref) is just a shorthand for \crefrange{alg:1:buyers}{alg:1:buyers-partial-end}.
When it comes to choosing a specific location, the learnable ABM essentially assumes the expected value of the stochastic process used in the original ABM. In the original ABM, individual agents belonging to a given income class $k$ select a given location $x$ by drawing from a categorical distribution---a multinomial distribution with one trial ((ref)). Because all buyers belonging to the same income class are identical and have the same probability to choose a given location, it is completely equivalent to consider a multinomial distribution with $\gamma_k$ trials. Indeed, this is what the learnable ABM does, except it considers the expected value of this distribution ((ref)). This choice is, once again, to limit the amount of stochasticity: as the model does not observe potential buyers, it would have to estimate the realization of this variable, and this may create computational problems.
There is a similar difference in the computation of the number of sellers. The original ABM simulates the decisions of sellers individually (\crefrange{alg:1:sellers}{alg:1:sellers-end}). As soon as a given housed agent becomes a seller with probability $\alpha$, its state changes and that specific agent, from that point on, acts as a seller. In the learnable ABM we treat sellers as undistinguishable, and so it is sufficient to compute new sellers by drawing from a binomial distribution (in fact, by taking the expected value of that distribution, as in (ref), again to limit the amount of stochasticity).
There is a more substantial difference in the way sellers determine their reservation price. In the original ABM they follow an aspiration level heuristic artinger2016heuristic, i.e., sellers start from a markup on the market price ((ref)), and then they decrease their reservation price if they are unable to sell (\crefrange{alg:1:reservation}{alg:1:reservation-end}). The outcome of this heuristic is that prices tend to be higher in locations with higher demand, as sellers do not need to decrease their initial price much. We implicitly capture this dynamics in the specification of (ref), as discussed in (ref). However, according to our specification, all sellers in the same location have the same reservation price. This choice allows to treat sellers as undistinguishable in the learnable ABM, differently from the original ABM.
The final main difference lies in the way buyers and sellers are matched. Lacking information on individual transactions, we cannot write a computationally tractable likelihood by keeping the explicit representation of a continuous double auction (\crefrange{alg:1:book}{alg:1:book-end}). So we try to keep its main features while using a more tractable form. We achieve this by giving more probability to be matched to buyers with higher income ((ref)) and by computing the market price as the weighted mean of the average buyer and seller price, as in the original ABM. Note that the model keeps some stochasticity in the way the matching process works in the learnable ABM. In particular, we observe the number of transactions, and the realization of the matching affects the evolution of the social composition at each location, which is a key property of the model we wish to preserve.