Agent-Based Models

How can we use them?

Jennifer A. Stark Ph.D.

Data Engineer & Analyst, SpareRoom

PyDataMCR Co-organiser

My Dark Past …

As a Neuroscience Post Doc

As a Research Assistant

As a Computational Journalism Post Doc

- "Algorithmic Accountability"

Uber Story

"Because with Uber there is no destination discrimination — no refusals based on what you look like or where you live." – Uber Under the Hood, Medium

Predictors of wait time for a car:

  • Race, ethnicity
  • Income & poverty
  • Population density
  • Additional predictors:

  • Violent crime
  • "place" density, eg restaurants, offices, schools…
  • Unable to measure:

  • Competition (taxis)
  • Traffic flow
  • Access to smart phone, credit cards…
  • All the million interactions and human behaviors
  • “Cycles, Systems, & Loops”

    Can we design or simulate a complex system with these attributes??

    Yes! (move your mouse)

    Agent Based Models

  • Computer Simulation to understand complex systems
  • World, agents with rules, time
  • Gives rise to emergent behaviour
  • Tools!

    Simpy

    Mesa (GitHub: /projectmesa/mesa)

  • what can they do?
  • Can they do things?
  • Let's find out!
  • Agent Based Models: Abstract models

  • Facilitate theory building
  • Check your assumptions
  • Understand observed patterns - can you recreate them?
  • Schelling's segregation model - bias? How much bias??
  • Agent Based Models: Empirical models

  • To predict outcomes (empircal models)
  • Traffic, evacuations

  • ...Uber story somewhere in between...
  • References:

    The Mesa Project

    The Mesa Project - Jackie Kazil PyDataDC 2016

    Forecasting Social Inequality - James Allen PyData London 2017

    p5.js - JavaScript library based on Processing to make coding fun and accessible

    p5 agents - from Nature of Code book: p5 examples

    Simpy - Discrete event simulation for Python

    Explorable Explanations - Hub for learning through play

    LOOPY - a tool for thinking in systems

    Reveal.js - used for this presentation