| simulate_tna_batches | R Documentation |
Generates repetitions sequence datasets with simulate_sequence_batches()
and fits one transition network to each with fit_tna(), so the estimated
networks can be held against the transition systems that generated them.
simulate_tna_batches(
repetitions = 1L,
model = c("tna", "ftna", "ctna", "atna"),
...,
seed = NULL
)
repetitions |
Number of fitted networks. A single positive whole number,
defaulting to |
model |
TNA estimator, one of |
... |
Arguments passed to |
seed |
Optional base seed. A single number, or |
A simulab_sim base data.frame of fitted edges, one row per
dataset and from/to pair, with columns dataset, from, to and
weight. Printing it shows true_transitions as the truth, keyed by the
same dataset. Components: sequences, the generated sequences in long form
with columns dataset, id, period and state; true_transitions, the
generating probabilities with columns dataset, from, to and
probability; and model_info, one row per dataset describing the fit.
if (requireNamespace("tna", quietly = TRUE)) {
head(simulate_tna_batches(
repetitions = 2, model = "tna", n = 20, n_states = 3, chain_length = 10, seed = 1
))
# One network with no arguments, recovered against its own truth.
network <- simulate_tna_batches(seed = 1)
head(validate_recovery(network, network, term = "to", estimate = "weight"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.