| simulate_group_sequences | R Documentation |
Simulate grouped actor sequences
simulate_group_sequences(
groups = 2L,
actors = 50L,
transitions = NULL,
chain_length = 20L,
initial = NULL,
group_names = NULL,
states = NULL,
n_states = 5L,
state_categories = c("metacognitive", "cognitive"),
seed = NULL,
...,
batch = NULL
)
groups |
Number of groups, defaulting to |
actors |
Actors per group, scalar or one value per group, defaulting
to |
transitions |
A common transition matrix, one matrix per group, or
|
chain_length |
Sequence length, defaulting to |
initial |
Common initial probabilities, one vector per group, or
|
group_names |
Optional group labels. |
states, n_states, state_categories |
State-space arguments passed to
|
seed |
Optional random seed. Group-specific deterministic offsets are used without leaking RNG state. |
... |
Advanced sequence arguments passed to |
batch |
Optional single positive whole number. When given, the
simulator runs |
A long-form simulab_sim base data.frame with one row per actor
sequence position and columns group, id, period, and state. Actor
identifiers are made unique across groups as G<group>_A<actor>.
as.data.frame(x, what = ) also returns transitions (group, from,
to, probability), wide (one row per actor: id, S1, S2, ...,
group), and groups (group, actors).
result <- simulate_group_sequences(
groups = 2, actors = 20, chain_length = 12, n_states = 3, seed = 1
)
head(result)
components(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.