brainconn.generative.generative_model

generative_model(A, D, m, eta, gamma=None, model_type='matching', model_var='powerlaw', epsilon=1e-06, copy=True)[source]

Generates synthetic networks using the models described in Betzel et al. (2016) Neuroimage. See this paper for more details.

Succinctly, the probability of forming a connection between nodes u and v is P(u,v) = E(u,v)**eta * K(u,v)**gamma where eta and gamma are hyperparameters, E(u,v) is the euclidean or similar distance measure, and K(u,v) is the algorithm that defines the model.

This describes the power law formulation, an alternative formulation uses the exponential function P(u,v) = exp(E(u,v)*eta) * exp(K(u,v)*gamma)

Parameters:
  • A (numpy.ndarray) – Binary network of seed connections
  • D (numpy.ndarray) – Matrix of euclidean distances or other distances between nodes
  • m (int) – Number of connections that should be present in the final synthetic network
  • eta (numpy.ndarray) – A vector describing a range of values to estimate for eta, the hyperparameter describing exponential weighting of the euclidean distance.
  • gamma (numpy.ndarray) – A vector describing a range of values to estimate for theta, the hyperparameter describing exponential weighting of the basis algorithm. If model_type=’euclidean’ or another distance metric, this can be None.
  • model_type (Enum(str)) –
    euclidean : Uses only euclidean distances to generate connection
    probabilities

    neighbors : count of common neighbors matching : matching index, the normalized overlap in neighborhoods clu-avg : Average clustering coefficient clu-min : Minimum clustering coefficient clu-max : Maximum clustering coefficient clu-diff : Difference in clustering coefficient clu-prod : Product of clustering coefficient deg-avg : Average degree deg-min : Minimum degree deg-max : Maximum degree deg-diff : Difference in degree deg-prod : Product of degrees

  • model_var (Enum(str)) – Default value is powerlaw. If so, uses formulation of P(u,v) as described above. Alternate value is exponential. If so, uses P(u,v) = exp(E(u,v)*eta) * exp(K(u,v)*gamma)
  • epsilon (float) – A small positive value added to all P(u,v). The default value is 1e-6
  • copy (bool) – Some algorithms add edges directly to the input matrix. Set this flag to make a copy of the input matrix instead. Defaults to True.