Final report of my JSMF fellowship

I recently finished my JSMF fellowship at Sant’Anna Pisa, and took up a position as a researcher at CENTAI. I just took the chance to submit the final report to JSMF to reflect on the last 3 years, and thought to share this report as a somewhat autobiographical note for this blog, which I’m unfortunately not maintaining as I would like to.

_______________________________________________________________

Thanks to the unique flexibility that the JSMF fellowship provides, during my 3-year postdoctoral period I have been able to translate my relatively vague research proposal into a precise agenda. This happened through the collaboration with multiple people coming from several institutions, and while adapting my plans to contingent events such as the Covid-19 pandemic. In the spirit of the fellowship, I broadened my research areas from theoretical to data-driven modeling.

My JSMF project is titled “A theory of prediction for economic agent-based models”. Agent-based models (ABMs) are computational representations of complex systems in which individual agents interact adopting simple behavioral rules, and non-obvious patterns emerge from their interactions. I started working on ABMs during my PhD, as I worked on stylized ABMs in game theory, but I wanted to make my ABMs more data-driven. Moreover, I was interested in understanding when ABMs outperform traditional economic models in out-of-sample prediction. In such situation, ABMs would be a more accurate description of reality than traditional models, and this would justify their use for both scientific understanding and policy advice, making them more widely accepted. In the bigger picture, in my view using ABMs rather than traditional models would lead to a better representation of the economy as a complex system.

My initial plans were mostly on the “theory” of data-driven ABMs. I wanted to understand the theoretical conditions under which ABMs outperform traditional models in forecasting, mostly by using synthetic data generated by other models used as ground truth, before attempting to compare predictions in the real world. This has been the focus of Ref. [1]. A key problem for prediction with ABMs is that many variables of individual agents are unobserved, or latent. To the extent that the ABM dynamics depends on the values of these latent individual-level variables, unless these are estimated precisely the model cannot produce reliable forecasts. Using a specific ABM, we have been able to learn some lessons on the conditions of ABMs that make it possible to estimate latent variables. First, the amount of stochasticity of the ABM must be commensurate with data availability. If the model has many stochastic elements providing outcomes that cannot be observed, it is very difficult to write a computationally tractable likelihood function that enables precise estimates of latent variables. Second, the model must be continuous when possible, keeping discrete elements only when discreteness is crucial for the mechanisms that the ABM represents. This work [1] paves the way to a research agenda to make agent-based models “learnable”, i.e. such that their latent variables can be estimated from real-world data, and thus amenable to forecasting.

Further zooming into the structure of ABMs, I started thinking of ABMs as dynamic causal networks in which nodes correspond to the values of variables at a given time step and links indicate a dependency in the computer code describing the ABM. For instance, when z(t) <- x(t) + y(t-1), the causal network would have links from x(t) and y(t-1) to z(t), for all time steps t. Together with colleagues at Sant’Anna Pisa (my JSMF host institution), we developed a programming language that makes it possible to automatically derive the dynamic causal network of an ABM from the model code as it is executed [8]. In work in progress, we are using this causal network formalism to classify simulation models into a taxonomy with several dimensions, such as how stochastic, discrete, interactive, heterogeneous, complex a model is [9]. This taxonomy is not restricted to ABMs, as it extends to all simulation models. As a first goal, we hope to use this causal network to see which features make ABMs unique; we are the first to analyze this from a formal, rather than conceptual, point of view. This is useful in several respects. First, it would make it possible to open the “black-box” of an ABM. Indeed, usual methods treat the ABM as a black box that takes inputs and produces outputs [2, 11], but since we know the code of the model it is a big waste of information not to use it. Moreover, building the causal network of the ABM makes it possible to replace certain parts or the entire model by machine learning metamodels, which may be easier to deal with in the presence of latent variables [1,10]. Putting all pieces together I am getting closer to understanding the theoretical conditions under which ABMs can be used for forecasting.

My postdoctoral research also involved applications of data-driven ABMs. This line of work started from the Covid-19 pandemic. Stuck at home during the first lockdown, in spring 2020, my co-authors and I started working intensely on macroeconomic ABMs with an industry-to-industry input-output structure. We wanted to forecast the economic impacts of lockdowns, both at the aggregate level and across specific industries, and also to provide policy recommendations on which industries might be closed to minimize economic harm and maximize health benefits. In an early paper representing the UK economy [3], we predicted a 21.5% reduction in UK GDP in spring 2020, two months before the official release stating a 22.1% contraction. Our forecast was much closer to reality than the one by the Bank of England (around 30%) and the median forecast by several commercial banks and institutions (around 16%). At the policy level, we recommended against closing manufacturing industries, because they are relatively “upstream”, in the sense that they may provide outputs that are necessary inputs by other industries, and at the same time do not involve as many face-to-face contacts as more “downstream” industries such as entertainment and food. Our paper was widely circulated within the UK Treasury.

Building on this paper [3], I proposed to join forces with a team of epidemiologists to create an integrated epidemic-economic ABM that could address the most debated epidemic-economic tradeoffs [6]. This project took more than two years, but in the end we came up with what we think is the most granular and data-driven epidemic-economic model to date. We represent the New York metropolitan area, simulating the mobility and consumption decisions of a synthetic population of half a million individuals that closely resembles the real population. Mobility decisions are obtained from a privacy-preserving algorithm that reads individual-level mobility traces extracted from cell phone data and associates them to synthetic individuals. Households may reduce consumption for fear of infection as the number of Covid-related deaths increases. We find several results, including that epidemic-economic tradeoffs affect low-income more than high-income individuals, and that mandated government closures have similar tradeoffs as spontaneous consumption avoidance due to fear of infection.

A last line of research on the applications of data-driven ABMs, which is still in progress, is about housing markets and climate change [13]. We obtained access to a very rich dataset comprising all properties, transactions and mortgages in the Miami area, and we used it to initialize an ABM in which households buy and sell houses. In this ABM, buyers may avoid properties that may be most at risk of sea level rise, and this brings down the value of these properties. We reproduce interesting patterns of climate gentrification, such as the fact that prices are increasing in low-income but relatively high-altitude areas such as Little Haiti and decreasing in high-income low-altitude area such as Miami beach, because of a flux of affluent individuals from low-altitude areas at high risk of sea level rise to safer areas. We plan to use this model to test several climate adaptation strategies and study scenarios according to different climate pathways.

Finally, in addition to the new research lines that the JSMF fellowship enabled me to start, I had the chance to conclude papers on game theory [4, 14] and business cycles synchronization [7].

Following such an ambitious and wide-ranging research agenda has only been possible thanks to the unique characteristics of the JSMF fellowship. First of all, I greatly benefited from interacting with multiple coauthors coming from different backgrounds, many of whom I met when searching for a host institution. As the JSMF fellowship is not tied to a host institution, the search period is a great opportunity for finding new collaborators. Second, because I did not have to adhere to a strict reporting schedule, I had the flexibility to adapt my research to the circumstances, such as the Covid-19 pandemic, enriching my initial plans. Third, the 3-year period of the fellowship gave me time and independence to build my own research agenda. Fourth, the generous research budget made it possible to organize an international workshop on the topics of my fellowship, better connecting with the community working on data-driven ABMs, which I believe is in a great position to bridge theoretical and empirical approaches across disciplines [12].

Thank you for giving me the opportunity to pursue this research line. In my view, many postdoctoral programs around the world should follow in the footsteps of the JSMF Postdoctoral Fellowship.

___________________________________________________

[1] Monti, C., Pangallo, M., Morales, G. D. F., & Bonchi, F. (2023a). On learning agent-based models from data. arXiv:2205.05052.

[2] Borgonovo, E., Pangallo, M., Rivkin, J., Rizzo, L., & Siggelkow, N. (2022). Sensitivity analysis of agent-based models: a new protocol. Computational and Mathematical Organization Theory, 28(1), 52-94.

[3] Pichler, A., Pangallo, M., del Rio-Chanona, R. M., Lafond, F., & Farmer, J. D. (2022). Forecasting the propagation of pandemic shocks with a dynamic input-output model. Journal of Economic Dynamics and Control, 144, 104527.

[4] Heinrich, T., Jang, Y., Mungo, L., Pangallo, M., Scott, A., Tarbush, B., & Wiese, S. (2023). Best-response dynamics, playing sequences, and convergence to equilibrium in random games. arXiv:2101.04222.

[5] Loberto, M., Luciani, A., & Pangallo, M. (2022). What Do Online Listings Tell Us about the Housing Market? International Journal of Central Banking, 18(4), 325.

[6] Pangallo, M., Aleta, A., Chanona, R., Pichler, A., Martín-Corral, D., Chinazzi, M., Lafond, F., Ajelli, M., Moro, E., Moreno, Y., Vespignani, A., & Farmer, J.D. (2022). The unequal effects of the health-economy tradeoff during the COVID-19 pandemic. arXiv:2212.03567.

[7] Pangallo, M. (2023). Synchronization of endogenous business cycles. arXiv:2002.06555.

[8]  Comparing causal networks extracted from model code and derived from time series. In preparation.

[9] Quantifying features of simulation models directly from model code. In preparation.

[10]  Learning agent-based models through graph neural networks. In preparation.

[11] Pangallo, M., Giachini, D., & Vandin, A. (2023c). Statistical Model Checking of NetLogo Models. In preparation.

[12] Prediction and understanding in data-driven agent-based models. In preparation.

[13] Pangallo, M., Coronese, M., Lamperti, F., Cervone, G., & Chiaromonte, F. (2023d). Climate change attitudes in a data-driven agent-based model of the housing market. In preparation.

[14]  Best-response dynamics in multiplayer network games. In preparation.

When Does One of the Central Ideas in Economic Theory Work?

This blog post, written in collaboration with Doyne Farmer and Torsten Heinrich, was originally published on the blog of Rebuilding Macroeconomics.

The concept of equilibrium is central to economics. It is one of the core assumptions in the vast majority of economic models, including models used by policymakers on issues ranging from monetary policy to climate change, trade policy and the minimum wage.  But is it a good assumption?

In a newly published Science Advances paper, we investigate this question in the simple framework of games, and show that when the game gets complicated this assumption is problematic. If these results carry over from games to economics, this raises deep questions about economic models and when they are useful to understand the real world.

Kids love to play noughts and crosses, but when they are about 8 years old they learn that there is a strategy for the second player that always results in a draw. This strategy is what is called an equilibrium in economics.  If all the players in the game are rational they will play an equilibrium strategy.

In economics, the word rational means that the player can evaluate every possible move and explore its consequences to their endpoint and choose the best move. Once kids are old enough to discover the equilibrium of noughts and crosses they quit playing because the same thing always happens and the game is boring. One way to view this is that, for the purposes of understanding how children play noughts and crosses, rationality is a good behavioral model for eight year olds but not for six year olds.

In a more complicated game like chess, rationality is never a good behavioral model.  The problem is that chess is a much harder game, hard enough that no one can analyze all the possibilities, and the usefulness of the concept of equilibrium breaks down. In chess no one is smart enough to discover the equilibrium, and so the game never gets boring. This illustrates that whether or not rationality is a sensible model of the behavior of real people depends on the problem they have to solve. If the problem is simple, it is a good behavioral model, but if the problem is hard, it may break down.

Theories in economics nearly universally assume equilibrium from the outset. But is this always a reasonable thing to do?  To get insight into this question, we study when equilibrium is a good assumption in games. We don’t just study games like noughts and crosses or chess, but rather we study all possible gamesof a certain type (called normal form games).

We literally make up games at random and have two simulated players play them to see what happens.  The simulated players use strategies that do a good job of describing what real people do in psychology experiments. These strategies are simple rules of thumb, like doing what has worked well in the past or picking the move that is most likely to beat the opponent’s recent moves.

We demonstrate that the intuition about noughts and crosses versus chess holds up in general, but with a new twist. When the game is simple enough, rationality is a good behavioral model:  players easily find the equilibrium strategy and play it. When the game is more complicated, whether or not the strategies will converge to equilibrium depends on whether or not the game is competitive.

If the game is not competitive, or the incentives of the players are lined up, players are likely to find the equilibrium strategy, even if the game is complicated. But when the game is competitive and it gets complicated, they are unlikely to find the equilibrium. When this happens their strategies always keep changing in time, usually chaotically, and they never settle down to the equilibrium. In these cases equilibrium is a poor behavioral model.

A key insight from the paper is that cycles in the logical structure of the game influence the convergence to equilibrium. We analyze what happens when both players are myopic, and play their best response to the last move of the other player. In some cases this results in convergence to equilibrium, where the two players settle on their best move and play it again and again forever.

However, in other cases the sequence of moves never settles down and instead follows a best reply cycle, in which the players’ moves keep changing but periodically repeat – like the movie “ground hog day” – over and over again. When a game has best reply cycles, convergence to equilibrium becomes less likely. Using this result we are able to derive quantitative formulas for when the players of the game will converge to equilibrium and when they won’t, and show explicitly that in complicated and competitive games cycles are prevalent and convergence to equilibrium is unlikely.

When the strategies of the players do not converge to a Nash equilibrium, they perpetually change in time. In many cases the learning trajectories do not follow a periodic cycle, but rather fluctuate around chaotically. For the learning rules we study, the players never converge to any sort of “intertemporal equilibrium”, in the sense that their expectations do not match the outcomes of the game even in a statistical sense. For the cases in which learning dynamics are highly chaotic, no player can easily forecast the other player’s strategies, making it realistic that this mismatch between expectations and outcomes persists over time.

Are these results relevant for macroeconomics? Can we expect insights that hold at the small scale of strategic interactions between two players to also be valid at much larger scales?

While our theory does not directly map to more general settings, many economic scenarios – buying and selling in financial markets, innovation strategies in competing firms, supply chain management – are complicated and competitive. This raises the possibility that some important theories in economics may be inaccurate. Challenges to the behavioral assumption of equilibrium also challenge the predictions of the model. In this case, new approaches are required that explicitly simulate the behavior of economic agents and take into account the fact that real people are not good at solving complicated problems.