Journal

Agents, Agents Everywhere

Words by Cahal Moran, Post-Crash Economics Society

Agents, agents everywhere

One method of economic modelling that has become increasingly popular in academia, government and the private sector is Agent Based Models, or ABM. These simulate the actions and interactions of thousands or even millions of people to try to understand the economy – for this reason ABM was once described to me as being “like Sim City without the graphics”. One advantage of ABM is that it is flexible, since you can choose how many agents there are (an agent just means some kind of ‘economic decision maker’ like a firm, consumer, worker or government); how they behave (do they use complicated or simple rules to make decisions?); as well as the environment they act in, then just run the simulation and see what happens as they interact over time.

What’s interesting about these simulations is that individual behaviour can produce so-called emergent properties, which means the overall behaviour of a system is different to the behaviour of individuals. An example is a fire alarm causing everybody in a crowded room to rush to the escape, collectively blocking it and rendering it unusable for the vast majority of the room – the exact opposite of each individual’s intentions. ABM can not only model such a process; it can suggest counterintuitive ways of solving the problem, such as putting a pillar in front of the exit to slow down the flow of people. Eric Bonabeau has detailed real world examples where this kind of logic is apparent: supermarkets have used ABM to model the paths taken by customers around their stores and thus improve their layout, making it easier for customers and more efficient for the supermarket. Traffic authorities have similarly used ABM to decide which infrastructure projects can best alleviate congestion.

Indeed, ABM has an impressively broad list of applications: they originated in biology, to understand the behaviour of colonies of ants and flocks of birds, and they have also been used to model cancer cells and other evolutionary and ecological processes. The crisis of 2008 sparked renewed interest in ABM in finance and economics – now known as Agent-Based Computational Economics (ACE) – since its biological roots make it well-suited to capturing the kind of herding and panic exhibited by market participants (not to mention everyone else) during this period. The flexible nature of these models also means that they can use the behavioural rules of thumb that most people use to make decisions.

ACEs typically include different types of agents, for example ‘fundamentalists’ who think the market is right and will follow its historical average, versus ‘chartists’ who extrapolate from current trends, or even ‘contrarians’ who think current trends will reverse. Agents can learn and shift between different types, or exhibit even more complex behaviour, and promisingly such models have shown some capacity to match the key facts of financial markets such as the grouping of fluctuations and the existence of extreme events. We can also use the data to see how often agents switch between types of behaviour, how much they care about making money, and how likely they are to follow the crowd, and so forth.

Macroeconomic models such as Mark I emulate the behaviour of the whole economy during recessions, when it rapidly switches from positive to negative growth and has a tendency to stay there unless pushed back by external forces such as world trade, technological breakthrough or government. The recent paper ‘Agent based-stock flow consistent macroeconomics: Towards a benchmark model’ seems like a mouthful, but it illustrates how a relatively simple model with banks, households, governments and other types of agents can produce the kind of extreme fluctuations that occur during a financial crisis. For example, here is GDP growth from the latter model compared with GDP in the UK (grey), US (blue) and Eurozone (orange) over the financial crisis:

   

There is good qualitative agreement between the two, although hard-headed empiricists might be concerned about the difference between the numbers themselves. Firstly, on the y-axis (growth) the values are much higher for the real data (above) than for the model (below). Secondly, if you look at the x-axis (time) it is not clear what a ‘time period’ in ACE stands for: we have hundreds of them on the left but only a few years on the right. So what do the numbers on the left mean: a second, day, week, year – or the miniscule fraction of time it takes computers to make a trade in financial markets? This poses a problem for the interpretation of data and for policy analysis, since it’s difficult to compare the models and the real world.

These guys take a more detailed empirical approach, utilising a private-sector ACE model for the housing market which they claim “for over two decades forecast prepayment [paying off your mortgage early] rates for tens of millions of individual mortgages.” The basic model is quite simple: agents have a cost of paying their mortgage earlier (both the cost charged directly by the bank and the psychological or time costs of engaging in the transaction); some level of ‘alertness’ which measures how much they pay attention to their finances; and a probability of selling their house. They then try to minimise the overall amount they pay on their mortgage, producing results which match the aggregate data on how much people prepay remarkably well:

The authors use this model as a starting point to build a more complex ACE model of the 2000s housing market, capturing the boom, bust and other aspects of the data such as mortgage rates and number of houses sold. Most usefully for policymakers – and those of us trying to understand the primary causes of the crash – they simulate counterfactuals based on freezing interest rates and leverage ratios (think of these as a measure of the banks’ financial cushions relative to how much they borrow), and find that only the latter prevents the bust. Incidentally, in the aforementioned Mark I model leverage is the key variable which pushes the economy onto a ‘good’ versus ‘bad’ path, so both models are consistent in suggesting that limiting banks’ borrowing is the key to stabilising finance.

To be sure, matching data in social science is extremely hard and is far from the only aim of economic models, including ACE. In a 2006 article Marco Janssen and Elinor Ostrom (the only woman ever to win a Nobel Prize in economics) reviewed the potential for empiricism in the ABM literature, discussing not only quantitative data but also the use of case studies and laboratory experiments. The role of these is to try and understand which mechanisms in agent behaviour lead to certain outcomes, and especially to either rule out certain possibilities or suggest novel ones in a given context. These gain empirical clout from being localised and detailed and therefore readily applicable in a given domain – such as the supermarket or traffic examples from above, or this experiment which emulates financial markets – but of course lose the generality that broad datasets can give us.

ACE is a promising approach due to its inherent feasibility, flexibility and ability to match key elements of the data, and as discussed above has proven useful in a variety of contexts. A final challenge for ACE going forward is a problem which plagues perhaps every type of economic modelling: the model works until it doesn’t. People can suddenly change their minds and start behaving very differently with the arrival of new information, laws, technology, or simply of their own free will. ACE is actually more capable of dealing with this than most approaches, since it is easy to program agents to learn and change their behaviour based on circumstance, but there is always fundamental uncertainty – things we “don’t know we don’t know”, as former US defence secretary Donald Rumsfeld famously put it – so modellers will have to be alert to changes in the real world to anticipate and react to such shifts.

Nevertheless, ACEs paint a compelling picture: as The Economist put it, “one vision is a real-time simulation, fed by masses of data” of the whole economy, continually updated and evaluated by policymakers and researchers. It would also be relatively easy to visualise, making it transparent for everyone else. The Chief Economist of the Bank of England Andy Haldane perhaps put it best when he envisioned “a Star Trek chair and a bank of monitors…tracking the global flow of funds in close to real time, in much the same way as happens with global weather systems.” Such a set-up would lend itself naturally to ACEs, with Sim City-like images in some of the screens playing out different possibilities for the economy and financial markets.

Share on , , Email