Bayesian reconstruction of networks from noisy measurements, with examples.
The theory explaining these models is presented in "Bayesian inference of network structure from unreliable data", by J.-G. Young, G. T. Cantwell and M.E.J. Newman.
Here we provide several examples of models coded in Stan, as well as a tutorial reproducing one of the case studies of the paper.
The Stan models work with any Stan interface (Python, R, Julia, etc.).
- Examples: Standard models for Bernoulli/Poisson measurements with ER or SCM network priors.
- Templates: Extensible templates for custom models without writing boilerplate code.
Python is our preferred way to interact with Stan.
To follow our exact approach, install dependencies as follows.
uv sync # or: pip install cmdstanpy numpy
uv sync --extra tutorial # includes matplotlib, networkx, pandas, seaborn, jupyter
uv run python -m cmdstanpy.install_cmdstan # install the Stan compiler (one-time setup, may take a few minutes)You're then ready to follow the tutorial.
If you use this code, please consider citing:
"Bayesian inference of network structure from unreliable data"
J.-G. Young, G. T. Cantwell and M.E.J. Newman
J. Complex Netw. 8, cnaa046 (2021)
Code by Jean-Gabriel Young. Don't hesitate to get in touch at jean-gabriel.young@uvm.edu, or via the issues!
