compare_tna_models: Compare multiple TNA estimators on the same sequences

View source: R/tna.R

compare_tna_modelsR Documentation

Compare multiple TNA estimators on the same sequences

Description

Compare multiple TNA estimators on the same sequences

Usage

compare_tna_models(
  data,
  models = c("tna", "ftna", "ctna", "atna"),
  format = c("auto", "long", "wide"),
  id = "id",
  period = "period",
  state = "state",
  group = NULL,
  ...
)

Arguments

data

Sequence data accepted by fit_tna().

models

One or more TNA model types.

format, id, period, state, group

Input arguments passed to fit_tna().

...

Estimator arguments.

Value

A tidy edge-list simulab_sim base data.frame with one row per model/group/edge and columns model, from, to, and weight (with group inserted when group is supplied). A stacked model_info table, one row per fitted model and group, is available through as.data.frame(). The fitted native models are stored as a named list and returned by as_tna_model().

Examples

data <- simulate_sequences(n = 40, n_states = 3, chain_length = 12, seed = 1)
if (requireNamespace("tna", quietly = TRUE)) {
  compare_tna_models(data, models = c("tna", "ftna"))
}

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