Erdos-Renyi network erdosrenyi
networkx
n (int) number of nodes
p (double) probability for edge creation
dir (boolean, default=false) directed graph
Random network random
BCT
n (int) number of nodes
k (int) number of edges
dir (boolean) directed graph
Weighted random network weightedrandom
Ann's toolbox
n (int) number of nodes
p (int) probability of edge/weight addition
Random geometric network randomgeometric
networkx
n (int) number of nodes
radius (float) distance threshold value
dim (int, default=2) dimension of graph
pos (float, default=None) position of nodes, m-by-dim matrix
Watts-Strogatz graph wattsstrogatz
networkx
n (int) number of nodes
k (int) each node is joined with its k nearest neighbors in a ring topology
p (float) the probability of rewiring each edge
dir (boolean, default=false)
Scale-free network scalefree
networkx
n (integer) number of nodes
alpha (float, default=0.41) probability for adding a new node connected to an existing node chosen randomly according to the in-degree distribution
beta (float, default=0.54) probability for adding an edge between two existing nodes
gamma (float, default=0.05) probability for adding a new node connected to an existing node chosen randomly according to the out-degree distribution
delta_in (float, default=0.2) bias for choosing ndoes from in-degree distribution
delta_out (float, default=0) bias for choosing ndoes from out-degree distribution
Modular network modular
Wu-Yan et al. 2018
n (int) number of nodes
k (int) desired number of edges
m (int) number of modules, n/m should be an integer
p (float, default=0.8) desired fraction of k within modules
dir (boolean, default=false) directed graph
Modular small-world network modularsmallworld
BCT
n (int) number of nodes (must be power of 2)
k (int) number of edges
sz_cl (int) size of clusters (power of 2)
Hierarchical modular small-world network hiermodsmallworld
BCT
mx_lvl (int) number of hierarchical levels, N = 2^mx_lvl
e (float) connection density fall-off per level (e>1 for fall-off and not fully connected)
All modules are fully connected and connection density decays as 1/(Ee^n), with n = index of hierarchical level.
sz_cl (int) size of clusters (power of 2)
Generative growth network generativegrowth
BCT
seed (int, n-by-n) seed connections
d (float, n-by-n) Euclidean distance/fiber length matrix
m (int) number of connections that should be present in final synthetic network
modeltype (string) specifies the generative rule (see below)
modelvar (array of string wrapped in a cell) basis for generative rules, e.g., [{'powerlaw'}, {'exponential'}]
params (either a vector in the case of the geometric model or a matrix for all other models) parameters at which the model should be evaluated
epsilon (float, default=1e-5) the baseline probability of forming a particular connection (should be a very small number)
Example:
load +net/+imported/demo_generative_models_data
n = net.generate('topology','generative',...
'seed',Aseed,...
'd',D, ...
'm',nnz(A)/2,...
'modeltype','neighbors',...
'modelvar',[{'powerlaw'},{'powerlaw'}],...
'params',[-2,0.2; -5,1.2; -1,1.5]);
Full list of model types (each model type realizes a different generative rule):
- 'sptl' spatial model
- 'neighbors' number of common neighbors
- 'matching' matching index
- 'clu-avg' average clustering coeff.
- 'clu-min' minimum clustering coeff.
- 'clu-max' maximum clustering coeff.
- 'clu-diff' difference in clustering coeff.
- 'clu-prod' product of clustering coeff.
- 'deg-avg' average degree
- 'deg-min' minimum degree
- 'deg-max' maximum degree
- 'deg-diff' difference in degree
- 'deg-prod' product of degree
Multivariate autoregressive model autoregressive
arfit, Neumaier et al. 2001
v (float, n
-by-m
) time series with m
variables & n
observations
pmin (int) pmin <= p <= pmax
for order parameter p
pmax (int)
selector (string, default='sbc'
) order selection criteria
'sbc'
Schwarz's Bayesian Criterion
'fpe'
Akaike's Final Prediction Error criterion
no_const (string, default=none) if 'zero'
, constant bias term is set to 0
Graphical lasso graphicallasso
Friedman et al. 2007
in development
Weighted Stochastic Block Model wsbm_gen
WSBM, Aicher et al. 2014
w_truth string for probability distribution for edge weights, available distributions include: Bernoulli, Binomial, Poisson, Geometric, NegBinomial, Normal, LogNormal, Exponential, Pareto, None
e_truth string for probability distribution for edge presence, available distributions include: Bernoulli, Binomial, Poisson, Geometric, NegBinomial, None, DC (Degree Corrected)
r k-by-k matrix linking pairs of groups to edge-bundles
theta_w r-by-d matrix of parameters for weight distributions
theta_e r-by-d matrix of parameters for edge distributions
group_sizes k-by-1 matrix of block sizes
degree_para n-by-2 vector of mean in- and out-degrees (for degree-corrected models only)
Example:
w_truth = 'Normal';
e_truth = 'Bernoulli';
r = [1,2,2,2;
2,1,2,2;
2,2,1,2;
2,2,2,1];
theta_w = [10,2; 10,2];
theta_e = [0.9; 0.1];
group_sizes = [50;50;50;50];
n = net.generate('wsbm_gen',...
'W_truth', w_truth,...
'E_truth', e_truth,...
'R', r,...
'theta_w', theta_w,...
'theta_e', theta_e,...
'group_sizes', group_sizes);
Above example creates a network with 4 modules that interact based on 2 edge-weight and 2 edge-presence probability distributions. Edges are drawn from a normal distribution with mean 10 and standard deviation 2. Edge presence is characterized by two Bernoulli distributions, one with edge likelihood 0.9 and the other with likelihood 0.1.