View source: R/generate_category_graphs.R
| generate_category_graphs | R Documentation |
This function generates a list of adjacency matrices representing brain networks
belonging to the same category (e.g., Control group). Every graph has the same
community structure, and each edge is an independent Bernoulli variable with the
within- or between-community probability. By default all graphs share the same
probabilities; optionally, the probabilities of each graph can be shifted at random
(see intra_prob_variation and inter_prob_variation).
generate_category_graphs(
n_graphs = 10,
n_nodes = 100,
n_communities = 4,
community_sizes = NULL,
base_intra_prob = 0.8,
base_inter_prob = 0.2,
intra_prob_variation = 0,
inter_prob_variation = 0,
seed = NULL
)
n_graphs |
An integer specifying the number of graphs to generate. Default is 10. |
n_nodes |
An integer specifying the total number of nodes (brain regions). Default is 100. |
n_communities |
An integer specifying the number of communities. Default is 4. |
community_sizes |
An integer vector specifying the sizes of each community. If NULL, communities are of equal size. Default is NULL. |
base_intra_prob |
A numeric value between 0 and 1, or a numeric vector
of length |
base_inter_prob |
A numeric value between 0 and 1 specifying the base probability of an edge existing between nodes from different communities. Default is 0.2. |
intra_prob_variation |
A numeric value |
inter_prob_variation |
A numeric value |
seed |
An optional integer for setting the random seed to ensure reproducibility. Default is NULL. |
A list of symmetric binary adjacency matrices with no self-loops, representing brain networks with similar community structures.
# Generate a set of 5 graphs for the Control category
control_graphs <- generate_category_graphs(n_graphs = 5, n_nodes = 100, n_communities = 4,
base_intra_prob = 0.8, base_inter_prob = 0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.