Gibbs Sampler and other functions for PAPER (Preferential Attachment Plus Erdos--Renyi) model for random networks
Project description
PAPER
Implementation of Gibbs sampler for computing posterior root probabilities under the PAPER (preferential attachment plus Erdos--Renyi) model for random networks.
See details in the arXiv paper: https://arxiv.org/abs/2107.00153
Installation
$ pip install PAPER
Usage
>>> from PAPER.gibbsSampling import gibbsToConv
>>> from PAPER.tree_tools import createNoisyGraph
>>> graf = createNoisyGraph(n=100, m=200, alpha=0, beta=1, K=1)[0]
>>> mcmc_out = gibbsSampling.gibbsToConv(graf, DP=False, method="full",
K=1, tol=0.1)
See example.py for interpreting the inference output. Some sample network datasets are provided.
Notes
- No preprocessing required on input graph. If the input graph is disconnected, the largest connected component is used.
- The algorithm performs roughly 1 outer Gibbs iteration in 1 second on a graph with 10,000 edges. The number of iterations to convergence depends on the input graph.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paper-network-0.0.1.tar.gz
(66.8 kB
view hashes)
Built Distribution
Close
Hashes for paper_network-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5bc0627faa2b97336bff91395792240d3cfb49eceb34a78ee3cd1f0e347bead |
|
MD5 | fe159c920ced02abf74eca8518ccd3d2 |
|
BLAKE2b-256 | e9c8dc99f02eb73ece49ebef0421a0b24ccf56ac4f36120608ae609a3bab3520 |