Description Usage Arguments Details Value Author(s) Examples
Generate an adjacency matrix and a partial correlation matrix encoding the same conditional independencies. It allows to specify the desired number of nodes, the number of edges and the topology.
1 |
N |
Integer. Number of nodes |
m |
Integer. Number of edges. |
topology |
Character. The topology on which the network is based. One of "ER" = Erdos-Renyi random network. "BA" = Barabasi & Albert scale-free network. "WS" = Watts & Strogatz random networks. |
exact.m |
Logical. Specify whether the network should have exactly |
force.connected |
Logical. Specify whether the network should be connected. |
negpro |
Integer in [0,1]. The desired proprtion of negative edges. Suggested value is 0 for the simulation, otherwise positive-definiteness problems are more likely to occur. |
not |
List of matrices. A list of adjacency matrices to prevent extracting networks isomorphic to networks extraced at earlier stages. |
pw_ba |
Numeric, specify the power of the preferential attachment. Only relevant if |
p_ws |
Numeric in [0,1]. Probability of random rewiring. Only relevant if |
minpcor |
Numeric. Minimum allowed value for partial correlation. |
maxpcor |
Numeric. Maximum allowed value for partial correlation. |
maxiter |
Vector of three integers, specifying the maximum allowed iterations for three stages of computation.
|
verbose |
Logical. Do you want the function to tell you how it is going and where it is struggling? |
This function creates a network with the desired topology, allowing to regulate directly the number of edges (which is not always possible using igraph functions). The number of edges is ensured for topology = "ER"
or topology = "WS"
by specifiying the nearest number of edge larger than m and then removing edges randomly. If force.connected = TRUE
, then whenever an edge is removed, a check is done to preven removing a bridge, therefore disconnecting the network (see bridges
).
The function also tests for graph isomorphisms: if the obtained graph is isomorphic to a graph in the "not" list, the function keeps searching until a non-isomorphic graph is found (or until maxiter[1]
calls are done).
A list of two elements
ggm |
Adjacency matrix |
pcm |
Partial correlation matrix |
Giulio Costantini
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.