| random_tna | R Documentation |
Construct a fully-functional tna object from synthetic parameters
without needing pre-existing sequence data. Random transition probabilities
are drawn from a Dirichlet distribution, sequences are simulated from the
resulting model, and a canonical tna object is fitted on those sequences.
Calling random_tna() with no arguments returns a fresh, sticky network
with a coherent alphabet, drawn fresh on every call.
random_tna(
n_states = NULL,
states = NULL,
category = NULL,
alpha = NULL,
diag_boost = NULL,
trans_matrix = NULL,
init_probs = NULL,
n_sequences = NULL,
seq_length = NULL,
type = "relative",
return_params = FALSE,
seed = NULL
)
n_states |
An |
states |
An optional |
category |
An optional |
alpha |
A positive |
diag_boost |
A non-negative |
trans_matrix |
An optional square |
init_probs |
An optional |
n_sequences |
An |
seq_length |
An |
type |
A |
return_params |
A |
seed |
An |
A tna object, or, when return_params = TRUE, a list with
the elements model (the tna object), trans_matrix (the true
transition matrix), init_probs (the true initial probabilities),
sequences (the simulated sequences as a wide data.frame), labels
(the state labels), and category (the label pool used).
Other data:
import_data(),
import_onehot(),
list_random_state_pools(),
prepare_data(),
print.tna_data(),
random_group_tna(),
random_tna_mmm(),
simulate.group_tna(),
simulate.tna()
# Fresh random model on every call
model <- random_tna()
# Explicit small-state demo using the engagement pool
model <- random_tna(n_states = 3, category = "engagement")
# Reproducible model
model <- random_tna(seed = 42)
# Recover the ground-truth parameters along with the model
out <- random_tna(seed = 7, return_params = TRUE)
str(out, max.level = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.