Author(s): Jack Terwilliger1, Julia Di Silvestri2, Seika Murase1, Anne Elizabeth Clark White3, Federico Rossano1
Affiliation: University of California, San Diego | 1Cognitive Science Department 2Biology Department 3Herbert Wertheim School of Public Health and Human Longevity Science
Pedestrian dynamics are characterized as complex physical systems constrained by social norms, like personal space. Yet, prior research has ignored the spatial norms imposed by others’ social interactions, such as conversations. Unlike physical obstacles, the boundaries of social interactions are latent — even more so than those of personal space — as if they are invisible walls, and must be inferred from signs of interactional involvement. In four field experiments with 4,911 participants, we show that pedestrians integrate others’ gaze, proximity, body orientation, and talk to avoid interrupting possible interactions. However, pedestrians also collectively violate these spatial norms by walking through an interaction if other pedestrians had already done so. These results demonstrate how physical mobility depends on pedestrians’ social computations.
This repository contains the data, statistical analysis, and figures from our investigation.
Fig. | A diagram of our field experiments. Actors (shown in orange) stood in busy pathways while displaying 5 distinct signs of interactional involvement (see depictions of Variables 1-5). Over various conditions, we observed whether pedestrians (shown in blue) walked between or around our actors and we measured pedestrians’ walking trajectories.
Fig. | (A) Video frames from experiment 1. (B) Video frames from experiment 2. (C) Breaching probabilities from experiment 1. Dots represent the posterior predicted breach probability and lines represent 95% credible intervals. (D) Breaching rates from experiment 2 plotted by condition and pedestrian walking direction. Conditions are depicted on the right side of the plot. (E) Pedestrian trajectories from experiment 2 are plotted and colored by direction. Green is rightward. Black is leftward. Actor body orientation is depicted by red arrows. Types of terrain are represented by the colored background. Off-white depicts a pedestrian pathway, yellow depicts patches of dirt and vegetation, and grey depicts an asphalt roadway.
Fig. | (Top) An example of breaching contagion where 46 pedestrians walk past an art mural while two actors silently stood 10 feet apart while facing and staring at each other. Before a group of 3 pedestrians walked between the actors, 22 pedestrians had walked around the actors. After the group of 3 pedestrians walked between the actors, 15 of 19 pedestrians then walked between the actors. (Bottom) Our statistical model’s running predicted breach probability over time which takes into account the number of breaches 5 seconds prior and crowding for a given point in time (black line). Breaches/non-breaches are indicated with circles. The moment the group of three breaches is indicated with a vertical red line.
analysis.R defines our statistical analysis, from loading each experiment's data through fitting Bayesian models (brms), computing marginal effects (marginaleffects), generating figures, and writing results/results.md. It depends on helper functions in src/data_analysis for plotting, preprocessing, and saving results, and on external R libraries we pinned using renv.
All reported effects are differences in breach probability, expressed in percentage points with 95% credible intervals (and a probability of direction when the interval crosses zero) — not odds ratios. See results/results.md after running for a plain-language summary of every effect, alongside a table checking the number of participants/pedestrians analyzed against the numbers reported in the paper.
To install the same versions of external R libraries we used (including cmdstanr, which also needs a working CmdStan toolchain), run:
make installTo run the analysis run:
make runDependencies can be installed without make by running the following R commands:
install.packages("renv")
renv::restore()
cmdstanr::check_cmdstan_toolchain()
cmdstanr::install_cmdstan() # only if a CmdStan installation isn't foundNote, using renv will compile old versions of some R libraries from source. This will require system tools and libraries cmake, gfortran, libharfbuzz, etc.
Each brm() model fit is cached under cache/<name>.rds. Re-running analysis.R reloads these cached fits instantly rather than resampling; delete a specific cache file (or run make clean-cache) to force a refit. On a clean cache/, the first run refits every model and can take a long time.
├── analysis.R # main analysis script
├── data/ # datasets
├── figures/ # .png/.svg generated by analysis
├── results/ # .csv/.md tests/models/descriptive statistics, results.md summary
├── cache/ # cached brms model fits (not versioned)
├── renv.lock # records R library dependencies
├── renv/ # for renv
└── src/
├── data_analysis/ # plotting, preprocessing, result-writing, and reporting helpers
└── computer_vision/ # pedestrian tracking/trajectory-smoothing pipeline (Kalman filtering)

