This repository accompanies the article "Reconstructing networks from simple and complex contagions" by Nicholas Landry, Will Thompson, Laurent Hébert-Dufresne, and Jean-Gabriel Young.
- The
Datafolder contains all of the data corresponding to the figures in the manuscript. - The
Figuresfolder contains PDF and PNG files for each of the figures in the paper. - The
testsfolder contains unit tests to validate the code written for generating our results. - The
lcs(Learning Complex Structure) folder contains all of the code necessary for the generation of time series, the generation of random networks, the inference of networks, and the measurement of reconstruction performance. - The
Extrafolder contains scripts and notebooks which are not used in the manuscript. - The
convergencefolder contains notebooks used for heuristically determining what the values for burn-in and sampling gap should be for our MCMC sampler.
- To run the unit tests, you need to pip install the package locally. Navigate to the local folder on your computer and run "pip install -e ."
- To run the unit tests, run "pytest" in the command line.
- The package is referenced as
lcs(Learning complex structure) when accessing the functionality.
plot_fig#.pygenerates all of the figures displayed in the manuscript.- The following scripts generate ensembles of random networks, contagion time-series data, and then attempts to infer these networks from the time-series data:
clustered_network.pycm.pyerdos_renyi.pysbm.pywatts-strogatz.py
- The following scripts collect the above data and measure the performance of the reconstructions:
collect_clustered_network.pycollect_cm.pycollect_erdos_renyi.pycollect_sbm.pycollect_watts-strogatz.py
zkc_*.pygenerates the data used in Figs. 1 and 3.collect_tmax_comparison.pycollect the data generated vs. tmax and measures the nodal performance displayed in Fig. 3.collect_zkc_infer_vs_tmax.pyandcollect_zkc_frac_vs_betacollect this data and measure the performance of the reconstructions for Figs. 1(c) and 1(d) respectively.
run_dynamical_inference.ipynbruns a single inference for a single network and time series.