| simulate_tna_network | R Documentation |
Simulate a grouped TNA transition network
simulate_tna_network(
groups,
nodes_per_group,
group_names = NULL,
within_probability = 0.4,
between_probability = 0.15,
loops = FALSE,
seed = NULL,
batch = NULL
)
groups |
Number of node groups. |
nodes_per_group |
Nodes per group, scalar or vector. |
group_names |
Optional group names. |
within_probability, between_probability |
Edge probabilities within and between node groups. |
loops |
Permit self transitions when drawing the underlying edges. A
node left with no outgoing edge is nevertheless given a self transition of
probability one, so self-loops can appear even when |
seed |
Optional random seed. |
batch |
Optional single positive whole number. When given, the
simulator runs |
A tidy simulab_sim base data.frame holding the non-zero
transitions only, one row per edge, with columns from, to, and
probability. as.data.frame(x, what = ) also returns nodes
(node, group), adjacency (the long row/column/weight table of
the underlying directed Bernoulli graph), and transitions (the full
nodes^2-row transition table including zeros). The transition matrix is
row-stochastic: every from node's probabilities sum to one.
result <- simulate_tna_network(groups = 3, nodes_per_group = 4, seed = 1)
head(result)
components(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.