Agent-Based Modelling for Social Impact

Liz Gallagher
Data science at Nesta
9 min readOct 18, 2022

Nesta has the mission of tackling big societal challenges around increasing the number of healthy lives lived, narrowing the outcome gap for children growing up in disadvantage and accelerating the UK’s transition to a low-carbon future. In part, these require change at scale through targeted innovations and policy interventions. To investigate how well different interventions might impact social behaviour, simulation modelling can help.

At Nesta, we organise one or two exploration weeks per year. This allows teams to take a break from their usual projects for a whole week to work on something entirely new. In this article, I will talk you through the reflections and findings that a small team of us (Chris Williamson, juan.mateos-garcia, George Richardson, Jack Vines, Jack Rasala, Federico Andreis and I) in the Data Analytics Practice (DAP) have gathered during our latest Exploration week. The team traditionally focuses on machine learning methods in our projects. So, taking on the ethos of exploration during our Exploration week, we chose to see how agent-based modelling (ABM, a type of simulation modelling) could be useful for Nesta.

What is agent-based modelling (and why might it be useful for Nesta)?

Agent-based modelling (ABM) is a method for modelling the behaviour of a system by simulating autonomous “agents” that interact with each other and their environment. Complex macro-level behaviours can be simulated this way, even from quite simple individual rules for the agents.

One of the first ABMs was Thomas Schelling’s 1971 model for segregation. This model considers two groups of agents who have a certain level of intolerance for each other. Each agent moves around a grid until a certain percentage of its neighbours are from the same group as the agent. Although segregation of the two groups isn’t coded into the model, this behaviour emerges under certain intolerance levels (ie, macro-level behaviour emerges from simple agent-based rules). What’s interesting about this model is that even with quite low levels of intolerance, segregation will still occur.

The starting (left) and final (right) states of Schelling’s agent-based model where segregation between red and blue groups has emerged. Simulation by Frank McCown.

From Schelling’s model many others have been developed — from the work on cooperative behaviours by Robert Axelrod and colleagues (eg, Axelrod, 1997) to Neil Ferguson’s contentious model for controlling the spread of Covid-19. There are many more examples of ABMs and their history. ABMs lend themselves well to modelling social dynamics, since we often know more about the rules individuals follow than the rules the whole system follows. Because of this, ABMs could be useful for Nesta as a means of understanding the impact of different social policy decisions. Most relevant to Nesta, we could use ABMs to explore food environments and learn more about which interventions might make them easier to navigate. Alternatively, we could use ABMs, heat pump electricity usage and efficiency data to forecast future demand on the electricity grid. Of course, ABMs aren’t the only type of method to model social dynamics. Examples of other methods include modelling population growth via differential equations, crowd behaviour using fluid dynamics or wealth forecasting using econometrics.

Our ABM exploration

We packed a lot into our ABM exploration week and wanted to both read some of the literature and learn how to code ABMs. Thus, our week consisted of reading about, making and discussing ABMs.

Reading about ABMs

The week kicked off with a couple of days of reading about ABMs in areas Nesta is interested in — such as heat pump adoption, tackling obesity, innovation diffusion, collective action and job automation.

We read the Centre for Net Zero’s “Hitting the Target” report in which an ABM was used to model the impact that five different scenarios had on the adoption of heat pumps. This allowed them to forecast whether the UK’s current policy interventions, as well as possible interventions, would lead to the 2028 target for heat pump installations. Another heat pump-related report by Snape et al (2015) discussed an ABM for the non-financial barriers to heat pump adoption, where households (the agents) are influenced in their heating system of choice by their neighbours, the cost, the “hassle” and the climate.

Giabbanelli, Tison and Keith’s 2021 paper on the application of ABMs to public health was also of interest. In this they review and critique the ABMs used to help policy makers understand food behaviour interventions to tackle obesity. Their critique focuses on how much (if at all) these models have been evaluated on their technical quality (eg, parameter sensitivity analysis).

We also read some papers to do with innovation diffusion and development. A paper from Lopolito et al from 2013 explored an ABM for the interaction of firms to guide the development and diffusion of new technologies and how policy interventions can affect this. A 2020 paper by He and Lee discussed the effects of social culture (eg, individualism or uncertainty avoidance) on innovation diffusion using an ABM.

Another paper that caught our eye was that of Chenoweth et al from 2022 on nonviolent activist strategies. The ABM developed here looked at the outcomes of three activism strategies, finding which strategies are best at influencing the opponents’ support network.

We also read a paper from del Rio-Chanona et al (2021) who created a model for occupational mobility and used it to test out different responses to job automation scenarios. Another paper we read by Cogliano (2012) explored the emergence and the stability of profit under Karl Marx’s “labour theory of value”, by including agents which exchange commodities and make decisions about their allocation of labour.

Making ABMs

As well as reading, we wanted to gain experience of creating ABMs and coding them. A few members of the team explored using the Mesa Python package (which was particularly useful for the visualisation of ABMs), and some other members tried coding them from scratch in Python. Although less than a week wasn’t very long to design, code and experiment with a model, Chris, Juan and I did manage to make some first steps with them (although evaluating them and gaining actual insight from them would require more time).

I was interested in the effect of increased police power on the spread of ideas during a protest — something which may change the effect protests have after the new Policing Act. Key components to my model were agents having a propensity for disruption during a protest which, if over a threshold, would lead to arrest by any nearby police. Agents were influenced by their neighbours’ amount of disruption, and the overall success of a protest was proportional to the amount of disruption.

Frames from our agent-based models for protests (left), hungry fish (middle) and research discovery (right).

In order to explore ABMs in continuous space rather than on a grid, Chris built a “fish tank model” in which fish move around and eat smaller fish which in turn increases their size. Fish can either be risk-averse (prioritising escaping bigger fish) or risk-taking (prioritising eating smaller fish).

During the week Juan refined his model for research discovery in which agents search for discoveries in a research landscape. This model could be used to see what happens to research discoveries when agents are more risk adverse or interested in generating publications vs. making useful discoveries (these two things are not always the same!).

Discussing ABMs

The combination of reading about ABMs and designing and coding them lead to some interesting broad discussions. After coding the simulation, each of us felt like the bigger task ahead was the parameter selection and analysis (for example, I explored the effect the number of police, and how often they moved, had on my model outcomes). We talked about how we could generate large datasets of simulation runs with different parameter values and analyse the type of model behaviour (which is also something I explored in relation to forager mobility in my pre-data science life).

At times our discussions turned to the more theoretical aspects of ABMs — whether all ABMs boil down to the same few templates (eg, cooperation, segregation)? Have all our potential ABM ideas already been published (there are a lot of heat pump adoption ABMs out there)? How can we measure the impact our assumptions have on the results? How much complexity should we add to our ABMs (when does adding complexity start clouding our ability to interpret the model)? How much data do you need to develop an ABM (and what is the interaction between simulation results and the data)? What would it take to get policy makers to utilise the predictions from an ABM and to do so responsibly? What proportion of time should you spend trying to produce nice videos of your ABM (videos are useful for understanding if the model is doing what it should be, but aren’t useful in developing a broad understanding from the model)?

We also came up with a few areas which ABMs might be of use to Nesta. One such use case would be about food environment mapping — where we could use an ABM to model social networks around food pantries, and find what sort of interventions might make these environments easier to navigate. Another area might be to expand on the Centre for Net Zero’s ABM by using heat pump electricity usage and efficiency data to forecast future demand on the electricity grid. We found that a generic ABM framework that kept coming up in our discussions was how a policy intervention could affect the diffusion of a behaviour and/or information spread and dissipation, as well as generating any unintended consequences. This sort of framework could be built upon to model all sorts of things relevant to Nesta’s missions — for example to promote the uptake of early years government support, to encourage heat pump installation, and to enable people to eat more healthily.

Conclusion

All in all, we got a lot out of our ABM week and it was great to have some dedicated time to read papers and experiment with ideas. We found agent-based modelling coding and analysis quite a fun challenge (at one point the idea was floated to only use Python’s standard library to code them!), and we felt like some of our other data science skills might come in useful for analysing how model behaviours change as parameters vary. Lots of Nesta’s research questions are based around understanding how policy interventions can affect social behaviour — which we felt seems quite suitable for agent-based modelling.

References

Axelrod, R. (1997). The complexity of cooperation. In The Complexity of Cooperation. Princeton university press.

Centre for Net Zero. (2022). Hitting the Target, https://www.centrefornetzero.org/wp-content/uploads/2022/05/ABM-Report-Final.pdf

Chenoweth, E., Hocking, A., & Marks, Z. (2022). A dynamic model of nonviolent resistance strategy. PloS one, 17(7), e0269976.

Cogliano, J. F. (2012). An agent-based approach to classical-Marxian value theory and labor mobility.

Gallagher, E. M., & Bryson, J. J. (2017). Agent-based modelling. Encyclopedia of Animal Cognition and Behavior, 1–9.

Giabbanelli, P. J., Tison, B., & Keith, J. (2021). The application of modeling and simulation to public health: Assessing the quality of agent-based models for obesity. Simulation Modelling Practice and Theory, 108, 102268.

He, M., & Lee, J. (2020). Social culture and innovation diffusion: a theoretically founded agent-based model. Journal of Evolutionary Economics, 30(4), 1109–1149.

Lopolito, A., Morone, P., & Taylor, R. (2013). Emerging innovation niches: An agent based model. Research Policy, 42(6–7), 1225–1238.

MRC Centre for Global Infectious Disease Analysis, covid-sim, GitHub repository, https://github.com/mrc-ide/covid-sim

del Rio-Chanona, R. M., Mealy, P., Beguerisse-Díaz, M., Lafond, F., & Farmer, J. D. (2021). Occupational mobility and automation: a data-driven network model. Journal of the Royal Society Interface, 18(174), 20200898.

Schelling, T. C. (1971). Dynamic models of segregation. Journal of mathematical sociology, 1(2), 143–186.

Snape, J. R., Boait, P. J., & Rylatt, R. M. (2015). Will domestic consumers take up the renewable heat incentive? An analysis of the barriers to heat pump adoption using agent-based modelling. Energy Policy, 85, 32–38.

--

--