Introduction to Agent-Based Modelling by Bruce Edmonds
Centre for Policy Modelling, Manchester Metropolitan University
For a workshop at the "Government Operational Research Service"
Many aspects of modern society are highly complex, in the sense that they are not easy to understand without taking into account the detailed interactions between the social actors that comprise it. For such cases mathematical and system dynamics models are insufficient to be useful for understanding what is going on or forecasting what might occur. Statistical models are useful when the detail of the interactions can be treated as noise, and such models can make useful projections into the future, but it is not clear when the assumptions behind such projections will fail (and hence the projections being wrong - qualitatively as well as the error rate).
Agent-based modelling (ABM) is a relatively new technique that has the potential to play a part in this. In this technique social actors (people, departments, firms, households etc.) are individually represented as separate entities within the simulation and the interactions between the actors are represented as separate interactions within the simulation. The entities in the simulation that correspond to the social actors are called "agents". Sets of "rules" determine the micro-level behaviour of each agent. Each agent may have different characteristics and, indeed, different rules. One then "runs" the simulation where (effectively in parallel) all the agents obey their rules and a complex web of interactions between them result. This "mess" of detail can then be abstracted/graphed/measured in various ways (very similar to the techniques we use to understand what is happening in society itself) to give us macro-level statistics and visualisations which can be compared with existing aggregate statistics.
Two examples of such ABM are presented: (1) a very simple one that illustrates how the detailed interactions of individuals can affect the global outcomes, and (2) a more complex descriptive model that illustrates some of the social complexity that such models can represent.
Unsurprisingly the increased expressive power of ABM comes with downsides, including: (a) such models require a lot of data in order to be able to validate them and (b) the models are so complex that it can be difficult to understand the model itself. As a result of these difficulties, ABMs should not be considered to give probabilistic forecasts, but rather possibilistic - that is, they can produce some of the possibilities that are inherent in the system, but not (reliably) the probabilities of each (nor indeed will they be able to produce all of the real possibilities). In the context of policy making this is particularly relevant to risk-analyses of policies, where one wants to know some of the possible ways a policy might go wrong. This will allow one to design and implement "early warning" systems ...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
"A 30min Introduction to Agent-Based Modelling" for GORS
1. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 1
An Introduction to Agent-Based Modelling
Bruce Edmonds
Centre for Policy Modelling
Manchester Metropolitan University
2. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 2
Society is Complex!
• This may not be a surprise to many of you..
• …but in the sense of complexity science it means
that significant global outcomes can be caused by
the interactions of networks of individuals
• In other words, the outcomes are not modellable if
you do not model interactions between individuals
or model only the interaction of global variables…
• …and if you try to model it in these ways, you will
often be caught out be surprises
• Agent-based simulation allows the exploration of
such surprises but it is still a maturing field
3. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 3Social influence and the domestic demand for water, Aberdeen 2002, http://cfpm.org/~bruce slide-3
Equation-based or statistical modelling
Real World Equation-based Model
Actual Outcomes
Aggregated
Actual Outcomes
Aggregated
Model Outcomes
4. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 4
Individual- or Agent-based simulation
Real World Individual-based Model
Actual Outcomes Model Outcomes
Aggregated
Actual Outcomes
Aggregated
Model Outcomes
Agent-
5. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 5
What happens in ABSS
• Entities in simulation are decided on
• Behavioural Rules for each agent specified (e.g. sets of
rules like: if this has happened then do this)
• Repeatedly evaluated in parallel to see what happens
• Outcomes are inspected, graphed, pictured, measured
and interpreted in different ways
Simulation
Representations of OutcomesSpecification (incl. rules)
6. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 6
Example 1: Schelling’s Segregation
Model
Schelling, Thomas C.
1971. Dynamic Models of
Segregation. Journal of
Mathematical Sociology
1:143-186.
Rule: each iteration, each
dot looks at its 8
neighbours and if less than
30% are the same colour
as itself, it moves to a
random empty square
Segregation can result
from wanting only a few
neighbours of a like colour
7. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 7
Characteristics of agent-based
modelling
• Computational description of process
• Not usually analytically tractable
• More specific…
• … but assumptions are less ‘brave’
• Detail of unfolding processes accessible
– more criticisable (including by non-experts)
– but can be more convincing that is warrented
• Used to explore inherent possibilities
• Validatable by a variety of data kinds…
– but needs LOTS of data to do this
• Often very complex themselves
8. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 8
Micro-Macro Relationships
Micro/
Individual data Qualitative, behavioural, social psychological data
Theory,
narrative
accounts
Social, economic surveys; Census
Macro/
Social data
Simulation
9. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 9
Choosing Simulation Techniques
• Every simulation technique has pros and cons
• The hardest decision is when to use which approach
(or how to combine approaches)
• Analytic approaches rely on their formulation being
simple enough to be solvable (or, in practice, they use
simulation anyway)
• Statistical approaches rely (in different and subtle
ways) on the representation of noise as random –
they will miss surprises in their projections
• Agent-based approaches are complex, require lots of
data and do not give probability forecasts
• Simplicity is no guarantee of truth or generality
10. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 10
Meaning from intermediate
abstraction (often implicit)
target system
mental model
formal model
(Meaning)
11. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 11
In Vitro vs In Vivo
• In biology there is a well established distinction
between what happens in the test tube (in vitro) and
what happens in the cell (in vivo)
• In vitro is an artificially constrained situation where
some of the complex interactions can be worked
out…
• ..but that does not mean that what happens in vitro
will occur in vivo, since processes not present in vitro
can overwhelm or simply change those worked out in
vitro
• One can (weakly) detect clues to what factors might
be influencing others in vivo but the processes are too
complex to be distinguished without in vitro
experiments
12. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 12
Some modelling trade-offs
simplicity
generality
Lack of error (accuracy of results)
realism
(design reflects
observations)
13. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 13
Example 2: A model of social
influence and water demand
• Part of a 2004 study for EA/DEFRA, lead by the
Stockholm Environment Institute (Oxford branch)
• Investigate the possible impact of social influence
between households on patterns of water
consumption
• Design and detailed behaviour from simulation
validated against expert and stakeholder opinion
at each stage
• Some of the inputs are real data
• Characteristics of resulting aggregate time series
validated against similar real data
15. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 15
Some of the household influence structure
16. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 16
Example results: relative aggregate
domestic demand for water (1973 = 100)Aggregate dem and series scaled so 1973=100
0
20
40
60
80
100
120
140
160
180
200
J-
73
J-
74
J-
75
J-
76
J-
77
J-
78
J-
79
J-
80
J-
81
J-
82
J-
83
J-
84
J-
85
J-
86
J-
87
J-
88
J-
89
J-
90
J-
91
J-
92
J-
93
J-
94
J-
95
J-
96
J-
97
Sim ulation Date
RelativeDemand
17. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 17
Conclusions from Example 2
• The use of a concrete descriptive simulation
model allowed the detailed criticism and, hence,
improvement of the model
• The inclusion of social influence resulted in
aggregate water demand patterns with many of
the characteristics of observed demand patterns
• The model established how:
– processes of mutual social influence could result in
differing patterns of consumption that were self-
reinforcing
– shocks can shift these patterns, but not always in the
obvious directions
– the importance of introduction of new technologies
18. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 18
Example 3: Developing Work
• Institute for Social Change &
Theoretical Physics Group,
University of Manchester
• Centre for Policy Modelling,
Manchester Metropolitan University
19. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 19
the SCID Modelling Approach
Data-Integration Simulation Model
Micro-Evidence Macro-Data
Abstract Simulation
Model 1
Abstract Simulation
Model 2
SNA Model Analytic Model
20. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 20
Overall Structure of Model
Underlying data about
population composition
Demographics of people in
households
Social network formation and
maintenance (homophily)
Influence via social networks
• Political discussions
Voting Behaviour
Input
Output
21. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 21
Discuss-politics-with person-23 blue expert=false
neighbour-network year=10 month=3
Lots-family-discussions year=10 month=2
Etc.
Memory
Level-of-Political-Interest
Age
Ethnicity
Class
Activities
AHousehold
An Agent’s Memory of Events
Etc.
Changing personal
networks over which
social influence occurs
Composed of households of
individuals initialised from
detailed survey data
Each agent has a rich variety of
individual (heterogeneous)
characteristics
Including a (fallible) memory of
events and influences
22. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 22
Example Output: why do people vote (if
they do)
Intervention: voter
mobilisation
Effect: on civic
duty norms Effect: on habit-
based behaviour
23. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 23
Simulated Social Network at 1950
Established
immigrants: Irish,
WWII Polish etc.
Majority: longstanding
ethnicities
Newer
immigrants
24. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 24
Simulated Social Network at 2010
25. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 25
Possibilistic vs Probibilistic
• The idea is to map out some of the possible social
processes that may happen
• Including ones one would not have thought of or
ones that have already happened
• The global coupling of context-dependent
behaviours in society make projecting
probabilities problematic
• Increases understanding of why processes (such
as the spread of a new racket) might happen and
the conditions that foster them
• Complementary to statistical models
26. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 26
Role of ABM in Policy Assessment
• ABMs are good for analysing risk – how a more
standard model/prediction might go/be wrong
• That is, testing the assumptions behind simpler
models (statistical, discrete event, system dynamic,
etc.)…
• …so exploring the possible deviations from their
forecasts
• In other words, showing some of the possible
surprises that could occur (but not all of them)
• To inform a risk analysis that goes with a forecast
• Can be used for designing early-warning indicators of
newly emergent trends
27. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 27
ABSS Advantges
• ABSS allows the production and examination of
possible complex outcomes that might emerge
• It does not need such strong assumptions (that
analytic approaches require) to obtain results
• It allows the indefinite experimentation and
examination of outcomes (in vitro)
• It aids the integration and use of a wider set of
evidence, e.g. very open to stakeholder critique
• It suggests hypotheses about the complex
interactions in observed (in vivo) social phenomena
• So allowing those ‘driving’ policy to be prepared, e.g.
by implementing ‘early warning systems’
• Can be complementary to other techniques
28. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 28
ABSS Disadvantages
• It does not magically tell you what will happen
• Are relatively time-consuming to construct
• It can look more convincing that is warranted
• Understanding of the model itself is weaker
• It needs truck loads of data for its validation
• It gives possibilities rather than probabilities
• Fewer good practitioners around
• Not such a mature field
29. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 29
To Learn More
• Simulation for the Social Scientist, 2nd Edition.
Nigel Gilbert and Klaus Troitzsch (2005) Open University
Press. http://cress.soc.surrey.ac.uk/s4ss/
• Simulating Social Comlexity – a handbook.
Edmonds & Meyer (eds.) (2013), Springer.
• Journal of Artificial Societies and Social
Simulation, http://jasss.soc.surrey.ac.uk
• European Social Simulation Association,
http://essa.eu.org
• NetLogo, a relatively accessible system for doing ABM
http://ccl.northwestern.edu/netlogo
• OpenABM.org, an open archive of ABMs, including
code and documentation
30. An Introduction to Agent-Based Modelling, GORS, London, 24th Sept. 2013. slide 30
Thanks!
Bruce Edmonds
http://bruce.edmonds.name
Centre for Policy Modelling
http://cfpm.org
I will make these slides available at:
http://www.slideshare.net/BruceEdmonds