Overview and syllabus

Introduction

Hello, and welcome to the course website for Agent-Based Modeling, EBS 181/281, developed and taught by Dr. Matthew Turner, and offered for the first time Spring 2025 for Stanford Doerr School of Sustainability undergraduates and graduate students! Join the course to develop a nuanced understanding of human social behavior while learning advanced, transferable agent-based modeling computational skills using the R programming language.

Course structure

We meet twice weekly, currently scheduled for Monday and Wednesday 11:30am-12:50pm, but subject to change, location pending. Each week will have twin themes, one social science phenomenon (e.g., political polarization) and one computational technique or skill (e.g., data science essentials for agent-based modeling). Lectures will include relevant computer and software engineering topics for designing efficient agent-based modeling programs that can be run on a supercomputing cluster. Stanford students will run their models on the Sherlock computing cluster here at Stanford.

Syllabus

ATTENTION: This is a for a four-workshop short course that previews the full ten-week quarter-long series! See below for a description of what to expect for the full quarter-long schedule will look like.

Week Lecture description Lab description Readings
1 Agent-based modeling as software, for sustainability Use R to create agent-based models and inspect memory use Acerbi, Mesoudi, and Smolla (2022), Chapter 1; Chapter 2, “Names and Values” in Hadley Wickham’s Advanced R
2 Adaptive reinforcement learning Reinforcement-learning agents play \(n\)-armed bandits, i.e., \(n\) “slot machines” representing behaviors Steyvers, Lee, and Wagenmakers (2009); Toyokawa, Whalen, and Laland (2019); Matthew A. Turner et al. (2023a); Sutton and Barto (2018), Chapters 1 and 2
3 Models of group and social network structure Use igraph and other libraries to create and visualize social networks; study advanced program logic Flache and Macy (2011); Matthew A. Turner and Smaldino (2018); Matthew A. Turner et al. (2023b); Ross, McElreath, and Redhead (2024)
4 Agent-based modeling as a generative approach, like Bayesian modeling Evolutionary, agent-based King Markov; parallel and cluster computing McElreath (2020), Chapters 9; Stanford Sherlock Computing Cluster documentation

The ten-week course will consist of ten full lectures and ten sections focused on computing skills with some lecture, but mostly hands-on practice to make sure students learn the skills they need to complete weekly project assignments. Weekly assignments will combine software development and writing, requiring students to write a mini 2-page journal article-style papers every week. Students will motivate and explain a model they help program, analyze model outputs and explain the results, and explain the broader importance of the work. These papers will follow the IMAD structure: Introduction, Model (or Methods), Analysis, and Discussion, also known as the IMRaD structure where “Results and” replaces “Analysis”.

Weekly assignments, midterm and final exams, midterm and final projects

Initial idea, subject to change!

  • Weekly assignments: There will be eight weekly assignments total, taking weeks off for midterm and final weeks to focus on projects and exams. Each will be worth 10 points.
  • Midterm and final exams: There will be a midterm and final written exam possibly including written mathematics, mathematical derivations, and pseudocode solutions to logic or programming problems. The midterm exam will be worth 20 points; the final will be 30 points.
  • Midterm project: 30 points
  • Final project: 40 points

Weekly assignment

10 points per weekly assignment: I, 2pts; M 2pts, Code 3pts; R 3pts; D 1 pt. 

Midterm exam:

Written responses, formal calculations, explaining formalisms, writing pseudocode 20 pts

Final exam:

Written responses, formal calculations, explaining formalisms, writing pseudocode 40 pts

Midterm project:

Pick one of the weekly assignments and expand upon it based upon your own interests. Same grading as weekly project, but scaled up to 20 points. Minimum 2000 words in IMAD/IMRaD format.

Final project

I will suggest several potential final projects, and students may invent their own. Same grading distribution as weekly project, but scaled up to 40 points. Minimum 3000 words in IMAD/IMRaD format.

References

Acerbi, Alberto, Alex Mesoudi, and Marco Smolla. 2022. Individual-based models of cultural evolution: A step-by-step guide using R. London: Routledge. https://acerbialberto.com/IBM-cultevo/.
Flache, Andreas, and Michael W. Macy. 2011. Small Worlds and Cultural Polarization.” The Journal of Mathematical Sociology 35 (1-3): 146–76.
McElreath, Richard. 2020. Statistical Rethinking. 2nd ed. Boca Raton, FL: CRC Press.
Ross, Cody T., Richard McElreath, and Daniel Redhead. 2024. Modelling animal network data in R using STRAND.” Journal of Animal Ecology 93 (3): 254–66. https://doi.org/10.1111/1365-2656.14021.
Steyvers, Mark, Michael D. Lee, and Eric Jan Wagenmakers. 2009. A Bayesian analysis of human decision-making on bandit problems.” Journal of Mathematical Psychology 53 (3): 168–79. https://doi.org/10.1016/j.jmp.2008.11.002.
Sutton, Richard S, and Andrew G Barto. 2018. Reinforcement Learning : An Introduction. 2nd ed. Cambridge, MA: MIT Press.
Toyokawa, Wataru, Andrew Whalen, and Kevin N Laland. 2019. Social learning strategies regulate the wisdom and madness of interactive crowds.” Nature Human Behaviour. https://doi.org/10.1101/326637.
Turner, Matthew A., Cristina Moya, Paul E. Smaldino, and James Holland Jones. 2023a. The form of uncertainty affects selection for social learning.” Evolutionary Human Sciences 5. https://doi.org/10.1017/ehs.2023.11.
Turner, Matthew A, Alyson L Singleton, Mallory J Harris, Ian Harryman, Cesar Augusto Lopez, Ronan Forde Arthur, Caroline Muraida, and James Holland Jones. 2023b. Minority-group incubators and majority-group reservoirs support the diffusion of climate change adaptations.”
Turner, Matthew A., and Paul E. Smaldino. 2018. Paths to Polarization: How Extreme Views, Miscommunication, and Random Chance Drive Opinion Dynamics.” Complexity. https://doi.org/10.1155/2018/2740959.