Course Overview¶
Computer Simulations for Philosophy, Politics and Economics
Spring 2021
Eric Pacuit
epacuit@umd.edu
University of Maryland
Computer simulations have been used for almost as long as there have been computers. The earliest scientific use of computer simulations were for physics and engineering. Increasingly people are also employing computer simulation to understand social behavior both in humans and other animals. This class is about the nuts and bolts of computer simulation of social behavior and about the underlying theory behind this work. The course also discusses the philosophical issues that arise when evaluating the use of computational and mathematical models in economics and philosophy. During the course, students will gain hands-on experience developing simulations in Python. Although some previous programming experience will be helpful, the course will be completely self-contained.
Warning
This class website is under active development, and content will be added throughout the duration of the course.
Topics (tentative)¶
Schelling’s Model of Segregation
Iterated Prisoner’s Dilemma
Opinion Dynamics: Hegselmann-Krause Model
Deliberation and Polarization
Epistemic Democracy and the Condorcet Jury Theorem
Simulating Elections
Computational Tools¶
Python 3
Jupyter Notebooks (https://jupyter.org/)
Literate programming: Interactive documents (written in markdown/LaTeX) explaining the model and the code.
Data science toolkit: scipy, numpy, pandas, …
Visualization: matplotlib, seaborn, altair, etc.
Special packages: mesa, axelrod, preflib tools
Mathematical Background¶
Networks (Graph Theory)
Basic Game Theory
Basic Probability Theory
Voting Theory
Agent-Based Modeling¶
Agent-based simulations are used in many different areas:
Ross A. Hammond, Considerations and Best Practices in Agent-Based Modeling to Inform Policy, NCBI, 2015.
In this coure, we are focused on simulations used in Philosophy (especially Social Epistemology), Politics and Economics:
Conor Mayo-Wilson and Kevin J.S. Zollman, The Computational Philosophy: Simulation as a Core Philosophical Method. Preprint, 2020.
J. McKenzie Alexander, The Structural Evolution of Morality. Cambridge University Press, 2007.
Mostapha Diss and Vincent Merlin (eds.), Evaluating Voting Systems with Probability Models: Essays by and in Honor of William Gehrlein and Dominique Lepelley. Springer, 2021.
Weekly Schedule¶
Mathematical background
Explain the model
Learn how to code the model
Explore the model
Evaluate the model
NetLogo¶
NetLogo (https://ccl.northwestern.edu/netlogo/) is a powerful framework for creating agent-based simulations. It is a programming environment created in Java (although you do not need to know Java to use NetLogo).
There is a web version of NetLogo: http://www.netlogoweb.org/
With NetLogo you can quickly create an agent-based model with animation (e.g., see the Schelling Model of Segregation)
There are a number of books written about NetLogo:
Uri Wilensky and William Rand, An Introduction to Agent-Based Modeling: Modeling Natural, Social, and Engineered Complex Systems with NetLogo, The MIT Press, 2015.
Steven F. Railsback and Volker Grimm, Agent-Based and Individual-Based Modeling: A Practical Introduction, Princeton University Press; 2nd edition (March 26, 2019).
Why not NetLogo?¶
Netlogo is its own programming language with its own quirks
Python is a standard tool used in AI, machine learning, and data science
Access to powerful packages for scientific and mathematical computing (scipy, numpy, etc.)
Many different options for visualizing and sharing your simulations
While NetLogo makes animating the model easier, we do not always need to visualize the dynamics of an agent-based model
A Brief Introduction to Python (as needed)¶
Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. (https://docs.python.org/3/tutorial/)
You don’t need to understand everything at this stage!
Python is an interpretted language.
Python is dynamically typed.
x = "hello"
print(x)
print(x + " world")
x = 7
print(x)
print(str(x) + " world")
x = [5, 10, 15]
print(x)
print(x + [20])
hello
hello world
7
7 world
[5, 10, 15]
[5, 10, 15, 20]