Model and figure-replication code for public goods games with weakest-link group risk on hypergraphs

Published: 16 September 2026| Version 1 | DOI: 10.17632/tpp893gkt6.1
Contributor:
Sina Keyhanian

Description

Python code reproducing every analytical result and figure in the associated article. The module implements the exact finite-population selection gradient under Wright-Fisher dynamics via terminating Gauss hypergeometric sums over hypergeometric partner sampling, the continuum approximation and its error bound, closed forms for the two critical benefit multipliers, the interior equilibrium and the risk-dominance threshold, the stationary environmental transition probability, and the absorbing Markov chain solved by fundamental-matrix algebra for both the uniform and the star hypergraph under Wright-Fisher and death-birth updating. Also included are the Euler-Maruyama validation routine and the preprocessing scripts that build the firm-level hypergraph from a GS1 EPCIS event log and the outbreak severity statistics from the CDC National Outbreak Reporting System. Contents: model.py (core module); scripts reproducing Figures 1-7 and Tables 2-3; a README listing the exact command for each panel; requirements.txt pinning library versions. Random seed 20260907 is fixed throughout, so every reported figure is bit-reproducible. The two source datasets are not redistributed here: the CDC NORS data are publicly available from the U.S. Centers for Disease Control and Prevention, and the GS1 EPCIS log is a publicly available synthetic dataset on Kaggle. The preprocessing scripts document the exact parsing steps, including the thousands- separator handling in the NORS illness counts.

Files

Institutions

Categories

Computational Physics, Stochastic Process, Evolutionary Game Theory

Licence