Skip to content

Latest commit

 

History

History
138 lines (119 loc) · 7.9 KB

README.md

File metadata and controls

138 lines (119 loc) · 7.9 KB

Topology API

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):

  1. 'sptl' spatial model
  2. 'neighbors' number of common neighbors
  3. 'matching' matching index
  4. 'clu-avg' average clustering coeff.
  5. 'clu-min' minimum clustering coeff.
  6. 'clu-max' maximum clustering coeff.
  7. 'clu-diff' difference in clustering coeff.
  8. 'clu-prod' product of clustering coeff.
  9. 'deg-avg' average degree
  10. 'deg-min' minimum degree
  11. 'deg-max' maximum degree
  12. 'deg-diff' difference in degree
  13. '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

Euclidean distance euclidean
x (float) vector of position in x-axis
y (float) vector of position in y-axis
z (float, default=0) vector of position in z-axis

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.