evaluate_tna_estimation: Evaluate TNA estimation against generated truth

View source: R/experiments.R

evaluate_tna_estimationR Documentation

Evaluate TNA estimation against generated truth

Description

Draws a transition system per replication, simulates sequences from it, fits each estimator in models, and scores the fitted edges against the generating probabilities. Fitted weights are row-normalized before the comparison, so estimators on different weight scales are all read as transition probabilities.

Usage

evaluate_tna_estimation(
  repetitions = 100L,
  n = 200L,
  chain_length = 25L,
  n_states = 6L,
  models = c("tna", "ftna", "ctna", "atna"),
  concentration = 1,
  diagonal_concentration = 0,
  missing_tail = c(0L, 5L),
  threshold = 0,
  seed = NULL,
  ...
)

Arguments

repetitions

Number of simulation replications. A single positive whole number, defaulting to 100.

n

Number of sequences per replication. A single whole number of at least 2, defaulting to 200.

chain_length

Sequence length. A single whole number of at least 2, defaulting to 25.

n_states

Number of states. A single whole number of at least 2, defaulting to 6.

models

TNA estimators to evaluate. A character vector of at least one of "tna", "ftna", "ctna" and "atna", all four by default.

concentration, diagonal_concentration

Transition-system parameters passed to generate_transition_system(), defaulting to 1 and 0.

missing_tail

Trailing missing positions passed to simulate_sequences(), defaulting to c(0L, 5L).

threshold

Absolute weight threshold above which an edge counts as present, in both the agreement and the recovery metrics. A single non-negative number, defaulting to 0.

seed

Optional base seed. A single number, or NULL (the default). Replication i draws its transition system with seed + i - 1 and its sequences with that offset plus 100000.

...

Arguments passed to fit_tna().

Value

A simulab_sim base data.frame with one row per replication and model, holding iteration, model, the compare_networks() agreement metrics and the evaluate_edge_recovery() summary. Components: truth, the generating probabilities with columns iteration, from, to and weight; and estimated_edges, the row-normalized fitted edges with columns iteration, model, from, to and weight.

Examples

if (requireNamespace("tna", quietly = TRUE)) {
  evaluate_tna_estimation(
    repetitions = 2, n = 30, chain_length = 10, n_states = 3,
    models = "tna", seed = 1
  )
}

simulab documentation built on Oct. 15, 2026, 5:08 p.m.