How-to articleMethodology & analyticsEconomics & finance

Agent-based modelling in an economics PhD: approaches, calibration, validation and tools

Agent-based models simulate economies from the bottom up, as many interacting agents with their own rules. This guide explains where the method came from, which kind of model suits your question, and how to calibrate, validate and report a model so that examiners can trust it.

What you will learn

  • Explain what an agent-based model is and how it differs from representative-agent and equilibrium models
  • Choose between theoretical, exploratory and empirically calibrated agent-based models
  • Calibrate a model to data and validate it against patterns it was not tuned to
  • Run sensitivity analysis and enough simulation runs to support your conclusions
  • Document a model so that others can understand and reproduce it

What you will unlearn

  • Agent-based modelling has replaced standard macroeconomic models.It is an established and growing approach, but equilibrium and econometric models remain the main tools in most policy work.
  • If the model reproduces the data, it is validated.Many different rule sets can reproduce the same aggregate pattern, so validation needs several independent patterns and sensitivity analysis.
  • One simulation run gives the model's result.Agent-based models are usually stochastic, so results must be summarised across many runs with different random seeds.
  • More detail makes a model more realistic.Every added rule adds parameters to justify; a model should be as simple as the question allows.

Skills you will practise

  • Model conceptualisation
  • Agent rule design
  • Calibration
  • Validation against stylised facts
  • Sensitivity analysis
  • Simulation programming
  • Model documentation

What agent-based modelling is

An agent-based model (ABM) represents a system as a population of autonomous agents, such as households, firms, banks or farmers, each following rules about what to do given what it observes. The agents interact with one another and with their environment, and aggregate outcomes such as prices, inequality or market crashes emerge from those interactions rather than being imposed (Macal, 2016). The idea of an agent as an autonomous, interacting decision-maker is shared with computer science (Wooldridge & Jennings, 1995).

This makes ABM attractive in economics when heterogeneity, networks, learning or out-of-equilibrium dynamics matter, and when agents depart from full rationality in the ways behavioural economics documents (Kahneman & Tversky, 1979). Social scientists have used the same approach to study phenomena from segregation to the spread of norms (Jackson et al., 2017). The trade-off is that results come from simulation rather than closed-form solutions, so the credibility of the model depends on careful design, calibration and testing.

From cellular automata to economics

Agent-based modelling grew out of work on cellular automata, grids of cells whose states change according to simple local rules. John von Neumann used them in the late 1940s and 1950s to study self-reproduction. John Conway's Game of Life, published in 1970, showed how complex patterns can arise from very simple rules. In the 1980s Tommaso Toffoli and Stephen Wolfram, the latter working at the Institute for Advanced Study and then the University of Illinois, studied cellular automata systematically. Cellular automata are still used in applied work, for example to model urban growth (Saganeiti et al., 2021).

Agent-based models differ from cellular automata because agents can move, hold memories and follow heterogeneous rules. Thomas Schelling's segregation model of 1971 is an early economic example. The Santa Fe Institute, founded in 1984, began work on the economy as a complex adaptive system in the late 1980s, and agent-based computational economics developed from the 1990s. Today ABM is widely used for financial markets, macroeconomic policy experiments, housing, energy and environmental economics, alongside, not instead of, equilibrium and econometric models.

Three kinds of model

Economists use agent-based models in three ways. Choosing among them is the first design decision in a thesis, because it determines what counts as validation.

Three uses of agent-based models in economics
ApproachPurposeAgentsHow it is judged
Theoretical (deductive)Explore the consequences of assumptions, often extending a known modelFew types, rules derived from theoryInternal consistency and insight into mechanisms
Exploratory (generative)Show whether a set of plausible micro-rules can generate a macro patternHeterogeneous, boundedly rationalPlausibility of rules and ability to generate the target pattern
Empirically calibrated (phenomenological)Reproduce observed statistical regularities and run policy experimentsParameters estimated or calibrated from dataFit to several stylised facts not used in calibration

A doctoral thesis can combine these uses, for example by starting with a simple theoretical version to understand the mechanism and then adding data to calibrate it. What matters is to say which claim each version supports. A theoretical model can show that a mechanism is possible; only a calibrated and validated model can support statements about the size of an effect in a real economy.

Recent applications

Three applied studies from 2021 illustrate the method. They come from agricultural, water and transport economics rather than core macroeconomics, which reflects how widely the method is used in applied fields where farmers, firms or households make interdependent decisions.

Applied agent-based studies
StudyProblemModelToolContribution
Xie et al. (2021)Potential for dry-season small-scale irrigation investment in sub-Saharan AfricaAgent-based model applied to Ethiopia under biophysical and economic constraintsSuitability analysis coupled with SWAT and SPAM dataMapped where irrigation is feasible while limiting environmental impact
Ghoreishi et al. (2021)Farmers' water conservation and basin water demand under droughtAgent-based agricultural water demand (ABAD) model, Bow River Basin, CanadaNetLogoShowed rebound effects relevant to water policy
Serrano-Hernandez et al. (2021)Urban e-grocery distribution in Pamplona, SpainAgent-based simulation with horizontal cooperation scenariosNot statedCooperation between distributors improved cost and service

Each study shows a pattern worth copying: a clearly bounded problem, agents whose decisions matter for the outcome, and data used to set the environment (Xie et al., 2021; Ghoreishi et al., 2021; Serrano-Hernandez et al., 2021).

Calibration, validation and sensitivity analysis

Calibration means choosing parameter values so that the model is consistent with data. Some parameters can be taken from surveys or the literature (for example household size or discount rates); others are tuned so that the model reproduces selected aggregate statistics. Record which parameters were set in which way.

Validation asks whether the model is credible for its purpose. For an empirically calibrated model, test it against patterns that were not used in calibration, such as the shape of a firm-size distribution, volatility clustering in returns or the timing of adoption. Matching several independent patterns is stronger evidence than matching one. For exploratory models, show that the rules are plausible and that the result does not depend on arbitrary choices.

Because outcomes depend on many parameters and on randomness, run each scenario many times with different random seeds and report distributions, not single runs. Then use sensitivity analysis to show which parameters drive the results; global methods vary all parameters together rather than one at a time (Saltelli et al., 2008).

Tools, documentation and reproducibility

NetLogo is widely used for teaching and for models of moderate size, as in the water study above. Mesa (Python) and Repast (Java and Python) suit larger models and integration with data analysis, and some researchers write models directly in Python, Julia or C++ for speed. Choose a tool your supervisor or collaborators can read.

Document the model so that someone else could rebuild it. The ODD protocol (Overview, Design concepts, Details) is a widely used standard for describing agent-based models. Share code, parameter files and random seeds, and follow general rules for reproducible computational research (Sandve et al., 2013; Peng, 2011).

Designing the model step by step

  1. State the question. Write the outcome you want to explain or the policy you want to test, and why an agent-based approach is needed rather than an existing equilibrium or econometric model.
  2. Define agents and environment. List agent types, their attributes and the spatial or network structure through which they interact. Leave out anything that does not affect the question.
  3. Specify decision rules. Ground each rule in theory, behavioural evidence or survey data, and note where you have had to assume.
  4. Set the schedule. Decide the order in which agents act in each time step, because the order can change results.
  5. Implement and verify. Test that the code does what the description says, for example with simple cases whose outcome you can predict.
  6. Calibrate, validate and analyse. Follow the steps in the previous section, then run the experiments that answer your question.
What to report about an agent-based model
ElementWhat to report in the thesis
PurposeQuestion, type of model and why ABM is appropriate
Agents and rulesAttributes, decision rules and their sources
Data and calibrationData sources, calibrated parameters and target statistics
ValidationPatterns used for validation that were not used in calibration
ExperimentsScenarios, number of runs, random seeds and summary statistics
SensitivityMethod and the parameters that matter most
CodeLanguage, version and where code and data are archived

Worked example (illustrative)

A hypothetical PhD asks how mortgage lending limits affect house price cycles. The researcher builds an empirically calibrated model with household agents (who differ in income, wealth and expectations), banks and a housing market. Income and wealth distributions come from a household survey; the share of households forming expectations by extrapolating recent price growth is calibrated so that the model matches the observed volatility of house prices. Validation uses patterns not targeted in calibration: the relationship between credit growth and price growth, and the distribution of loan-to-income ratios. Each policy scenario is run 200 times, and a global sensitivity analysis (Saltelli et al., 2008) shows that results depend most on the expectations parameter, which the thesis discusses as a limitation. The model is described using ODD and the code is archived with the thesis.

Common mistakes

  • Building a detailed model before stating the question it should answer.
  • Reporting a single simulation run as the result.
  • Calibrating and validating against the same statistics.
  • Varying parameters one at a time and missing interactions.
  • Leaving the model undocumented, so that examiners cannot check it.
  • Claiming that ABM is superior to equilibrium models in general rather than for a specific question.

For related reading, see economic data analysis in South Africa and optimisation algorithms in research.

Key takeaways

  • Agent-based models generate aggregate outcomes from interacting, heterogeneous agents (Macal, 2016; Jackson et al., 2017).
  • Choose a theoretical, exploratory or empirically calibrated model to match your question, because each is validated differently.
  • Calibrate and validate against different patterns, and report results across many runs.
  • Use global sensitivity analysis to show which assumptions drive your conclusions (Saltelli et al., 2008).
  • Document the model and share code so that it can be reproduced (Sandve et al., 2013; Peng, 2011).
Your next step

Want to apply this to your own study?

  1. 1Tell us your topic, data and deadline
  2. 2A statistician reviews your work with you
  3. 3You get a plan and a quote
Quantitative analysis

References

  1. Ghoreishi, M., Razavi, S., & Elshorbagy, A. (2021). Understanding human adaptation to drought: Agent-based agricultural water demand modeling in the Bow River Basin, Canada. Hydrological Sciences Journal.
  2. Jackson, J. C., Rand, D., Lewis, K., Norton, M. I., & Gray, K. (2017). Agent-based modeling: A guide for social psychologists. Social Psychological and Personality Science, 8(4), 387–395.
  3. Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263–291. https://www.econometricsociety.org/publications/econometrica/1979/03/01/prospect-theory-analysis-decision-under-risk
  4. Macal, C. M. (2016). Everything you need to know about agent-based modelling and simulation. Journal of Simulation, 10(2), 144–156.
  5. Peng, R. D. (2011). Reproducible research in computational science. Science, 334(6060), 1226–1227. https://doi.org/10.1126/science.1213847
  6. Saganeiti, L., Mustafa, A., Teller, J., & Murgante, B. (2021). Modeling urban sprinkling with cellular automata. Sustainable Cities and Society, 65, 102586.
  7. Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., Saisana, M., & Tarantola, S. (2008). Global sensitivity analysis: The primer. Wiley. https://doi.org/10.1002/9780470725184
  8. Sandve, G. K., Nekrutenko, A., Taylor, J., & Hovig, E. (2013). Ten simple rules for reproducible computational research. PLoS Computational Biology, 9(10), e1003285. https://doi.org/10.1371/journal.pcbi.1003285
  9. Serrano-Hernandez, A., de la Torre, R., Cadarso, L., & Faulin, J. (2021). Urban e-grocery distribution design in Pamplona (Spain) applying an agent-based simulation model with horizontal cooperation scenarios. Algorithms, 14(1), 20.
  10. Wooldridge, M., & Jennings, N. R. (1995). Intelligent agents: Theory and practice. The Knowledge Engineering Review, 10(2), 115–152. https://doi.org/10.1017/S0269888900008122
  11. Xie, H., You, L., Dile, Y. T., et al. (2021). Mapping development potential of dry-season small-scale irrigation in sub-Saharan African countries under joint biophysical and economic constraints: An agent-based modeling approach with an application to Ethiopia. Agricultural Systems, 186, 102987.

How to cite this article

Choose your referencing style, then copy. Check your university's or journal's guide for local variations.

PhD Research Lab Academy. (2021, April 23). Agent-based modelling in an economics PhD: approaches, calibration, validation and tools. PhD Research Lab. https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation/

PhD Research Lab Academy. “Agent-based Modelling in an Economics PhD: Approaches, Calibration, Validation and Tools.” PhD Research Lab, 23 Apr. 2021, www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation. Accessed [access date].

PhD Research Lab Academy (2021) Agent-based modelling in an economics PhD: approaches, calibration, validation and tools. PhD Research Lab. Available at: https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation/ (Accessed: [access date]).

PhD Research Lab Academy. “Agent-based Modelling in an Economics PhD: Approaches, Calibration, Validation and Tools.” PhD Research Lab. April 23, 2021. https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation.

PhD Research Lab Academy, ‘Agent-based Modelling in an Economics PhD: Approaches, Calibration, Validation and Tools’ (PhD Research Lab, 23 April 2021) <https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation> accessed [access date].

PhD Research Lab Academy. Agent-based modelling in an economics PhD: approaches, calibration, validation and tools [Internet]. PhD Research Lab; 2021 Apr 23 [cited [access date]]. Available from: https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation/

PhD Research Lab Academy, “Agent-based modelling in an economics PhD: approaches, calibration, validation and tools,” PhD Research Lab, Apr. 23, 2021. [Online]. Available: https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation. [Accessed: [access date]].

@online{how_to_conduct_agent_based_modelling_in_economics_for_your_phd_dissertation_2021,
  author = {{PhD Research Lab Academy}},
  title = {{Agent-based modelling in an economics PhD: approaches, calibration, validation and tools}},
  organization = {PhD Research Lab},
  date = {2021-04-23},
  url = {https://www.phdassistance.com/blog/how-to-conduct-agent-based-modelling-in-economics-for-your-phd-dissertation},
  urldate = {[access date]}
}

This article is for learning. Use it to understand the method and cite the original sources above in your own work; do not copy or submit it as your own.

Agent-based modelling in an economics PhDNeed help applying it to your study?
Quantitative analysis