Supporting code for the paper
The code in this repository allows for repeat and independent analysis of the one described in the paper "Evidence that coronavirus superspreading is fat-tailed", by Felix Wong and James J. Collins. The code requires MATLAB 2019b or later to run.
In the folder "SSEs", three different datasets are provided as detailed in the main text. Load any single one of them before proceeding with the analysis code below.
There are a total of seven files included in the main folder:
- sspreader.m
This file is the main analysis script. It loads all the data and generates most figures and analyses shown in Fig. 1 of the main text.
- sspreader_robustness.m
This file performs the robustness check shown in Fig. 1H of the main text.
- merging_imputation.m
This file performs the robustness check shown in Fig. 1I of the main text.
- cross_comparison.m
This file plots the summary statistics shown in Fig. 1J,K of the main text.
- hillestimator.m
Auxiliary script for computing the Hill estimator.
- pickandestimator.m
Auxiliary script for computing the Pickands estimator.
- DedHestimator.m
Auxiliary script for computing the Dekkers-Einmahl-de Haan estimator.
- polyparci.m
Auxiliary script for estimating polynomial fit confidence intervals.
- frechetmodeling.m
Script for modeling the maxima of samples of a Fréchet distribution.
Please note: Datasets S1 and S2 of the paper contains more details of, and references for, superspreading events.
In the folder "network", there are MATLAB scripts for reproducing the network models of transmissions detailed in the main text.
- graph_model.m
This file is the main simulation script. It generates BA or WS random graphs and runs the simulations shown in Fig. 2B-E of the main text.
- SEIR.m
This file simulates a well-mixed SEIR model and plots the resultant total infected curve.
- graph_statistics.m
This file computes the statistics of graph models (e.g., their mean degrees after thresholding). Run this after graph_model.m has been run.
- WattsStrogatz.m
Auxiliary script for generating a WS random graph with specified parameters.
Please note: Dataset S3 of the paper contains more details regarding simulation parameters.
To run the main analysis, simply load any one of the datasets in "SSEs", then run in MATLAB:
sspreader
Most analysis results should appear. To run robustness checks after the main analysis has been executed, run in MATLAB the relevant script, e.g.,
sspreader_robustness
To model removing the tails and taking the maxima of samples of a Fréchet distribution, run in MATLAB:
frechetmodeling
To model simulations of a network-based model of transmission or a well-mixed SEIR model, run in MATLAB:
graph_model
or
SEIR
For questions or comments about this code, please reach out to felix j wong at gmail (no spaces, add domain name).