Simulate Data from a Group Transition Network Analysis Model
# S3 method for group_tna
simulate(
object,
nsim = 1,
seed = NULL,
max_len = 100L,
na_range = c(0L, 0L),
zero_row = "self",
format = "wide",
...
)A data.frame of the simulated sequence data.
A group_tna object. The edge weights must be transition
probabilities or frequencies, i.e., the model must have
type = "relative" or type = "frequency".
An integer vector giving the number of sequences to simulate
per group. If a single integer is provided, the same number of sequences
is generated per each group. The default is 1.
an object specifying if and how the random number
generator should be initialized (‘seeded’).
For the "lm" method, either NULL or an integer that will be
used in a call to set.seed before simulating the response
vectors. If set, the value is saved as the "seed" attribute
of the returned value. The default, NULL will not change the
random generator state, and return .Random.seed as the
"seed" attribute, see ‘Value’.
An integer vector giving the maximum length of the simulated
sequences per group. When no missing values are generated, this is the
length of all simulated sequences. If a single integer is provided, the
maximum length is the same for each group.
An integer vector of length 2 giving the minimum and
maximum number of missing values to generate for each sequence. The number
of missing values is drawn uniformly from this range. If both values are
zero (the default), no missing values are generated.
A character string describing how to process zero rows
in the weight matrix. The option "self" (the default) assigns
probability 1 to the corresponding state (self loop) and option
"uniform" assigns a uniform distribution.
A character string indicating whether the data should be
returned in wide or long format.
Ignored.
Other data:
import_data(),
import_onehot(),
prepare_data(),
print.tna_data(),
simulate.tna()
model <- group_tna(
group_regulation,
group = rep(c("High", "Low"), each = 1000)
)
sim <- simulate(model, nsim = 10, max_len = 10)
Run the code above in your browser using DataLab