Introduction to Agent-Based Modelling

Overview

Teaching: 10 min
Exercises: 0 min
Questions
  • What are agent-based models?

Objectives
  • Describe the features of an agent-based model.

  • Describe the steps for the development of an agent-based model.

Agent-Based Modelling

To model a complex system, we can use a method known as agent-based modelling.

An agent-based model (ABM) is a computational model for simulating the actions and interactions of autonomous agents (both individual or collective entities such as organisations or groups) in order to understand the behaviour of a system and what governs its outcomes. Agent-based Model - Wikipedia

Architecture of an ABM

Simple architecture of a multi-agent system. This image was used from the review by Zhang et al.


Building Blocks of an ABM

PARTE Framework describing the elements of an agent-based model by Hammond


Why use an agent-based model

Pros Cons
Captures emergent phenomena Randomness is random
Provides a natural description of a system Models need to serve a purpose
Flexible Large interactions can be computationally intensive
Low cost and time-saving approach  

Applications of ABM

  • Flows
  • Markets
  • Organisations
  • Diffusion

Disciplines:

Computer Science Art Physics Ecology
Economics Biology Games Psychology
Engineering Chemistry Earth Science Social Science
Epidemiology Philosophy    

… But no pharmacy?


Development of an agent-based model

Steps involved in building and agent-based model. This image is from the chapter on Agent-Based Modelling and was sourced from the authors Research Gate Profile.


  1. Hypothesis Specification
  2. Model Development
  3. Model Validation

1. Hypothesis Specification

When designing the ABM, we consider the different types of modelling styles. Two major styles:

  • Phenomena-based modelling
  • Exploratory modelling

Phenomena-based modelling

We have the phenomena in mind that we want to model. Then build characteristics into our agents and define interactions that explain the model pattern. This creates an explanatory model where we see how adjustments to our input parameters can affect the outcome of our model

Exploratory modelling

We create the agents and define what behaviours they are to take. Then, we run the model and observe the patterns that emerge. These patterns can then be compared to real-world phenomena and refined to achieve similar model patterns. Further iterations of adjustments and comparisons with our real-world phenomenon lead to a model, an explanatory model that explains the phenomenon.


Considering these two styles, it is essential to precisely define the hypothesis and the question your model tries to address. A good approach is to embed the model in existing theories.


2. Model Development

Stages in designing ABM

  1. Formulate a question
    • Clearly defined question which model addresses
  2. Choosing your agents and their properties
    • These can be ‘individuals’ in your model. Alternatively, agent’s can be another construct that has behaviour to be modelled.
    • Their properties can affect their characteristics.
  3. Environment characteristics and stationary agents
    • This could be the building/institution/intervention that interacts/influences your agents.
  4. Agent behaviour
    • How they move and act.
  5. Designing the Time Step
    • What happens in each unit of ‘time’. Each step of the model action takes place.
  6. Choosing parameters of the model
    • What input parameters can you adjust? Are they for the agent or the environment?
  7. Choosing your measures
    • These are your outputs. What do you want your model to report?

How to get started building?

Start simple and add components to address your research question. (Top down)
or
Start simple and build up, identifying interesting questions along the way (Bottom-up).


3. Model Validation

  • Statistical analysis of the results
  • Evaluation of the results and connection with the driving question/hypothesis
  • Verification and validation

Other Resources

Other Model Development Suggestions

There are many ways to approach the model development process. In the above, we provided a simple suggested approach to get started. While reading the literature on ABM design, many different authors will have a suggestion for an approach. These are usually based on the industry. For example, we have included the table below from a policy development perspective. Link to table. In ecology, for example, is the ODD protocols, which stands for the overview, design concepts, and detail. The authors provide substantial information and examples on how to report a model in their detailed guide.

Key Step Description
1. Definition of question or goal Thoroughly considers and spell out the goal that the model will be designed to serve or the specific questions that it will try to answer.
2. Model scope and conceptual design Identify key concepts, structures, and relationships from the literature and preliminary studies. Determine clearly defined geographic and temporal contexts that are sufficient to achieve research goals.
3. Model specification Design the model, operationalising the model “ingredients” identified in the previous step in an implementation-ready way.
4. Model implementation Translate the specified model into a computationally operational program. Determine initial model parameter values using real-world data estimates and engagement with content domain experts.
5. Analysis  
- Testing and calibration Test the model against real-world data and, if necessary, iteratively calibrate the model design and parameters.
- Designing experiments and conducting analysis Create simulated scenarios using the model to test hypotheses central to the research focus, and interpret their results to explore research questions.
- Sensitivity analysis Sweep parameter space to identify key leverage points (i.e., parameter values at which small changes in the system can result in drastic changes in outcomes) and to map the set of assumptions and parameter choices that are inputs into the model onto the set of outcomes that it can produce.
6. Synthesis and reporting Combine findings from experiments and sensitivity analysis and interpret conceptually. Compile statistical analyses and visualisations of results that clearly depict and document research procedures and findings.

Other Methods for Modelling a Complex System

  • System Dynamics
  • Markov Modelling

References

  1. Bazghandi, A. (2012). Techniques, advantages and problems of agent based modeling for traffic simulation. International Journal of Computer Science Issues (IJCSI), 9(1), 115.
  2. Zhang, W., Valencia, A., & Chang, N. B. (2021). Synergistic integration between machine learning and agent-based modeling: A multidisciplinary review. IEEE Transactions on Neural Networks and Learning Systems.
  3. Salgado, M., & Gilbert, N. (2013). Agent based modelling. In Handbook of quantitative methods for educational research (pp. 247-265). Brill.
  4. Wilensky, U., & Rand, W. (2015). An introduction to agent-based modeling: modeling natural, social, and engineered complex systems with NetLogo. Mit Press.
  5. Hammond, R. A. (2015). Considerations and best practices in agent-based modeling to inform policy. In Assessing the use of agent-based models for tobacco regulation. National Academies Press (US).

Key Points

  • ABM’s have been used in a wide variety of disciplines, yet there are limited applications in Pharmacy.

  • Steps: Hypothesis Specification -> Model Development -> Model Validation

  • Design principle: Start simple and build to complexity.