Bootstrap a TNA model
Arguments
- data
Sequence data in long or wide form.
- model
TNA estimator, one of
"tna"(the default),"ftna","ctna","atna".- repetitions
Single whole number of bootstrap samples, at least 2, default
100.- fraction
Single number in
(0, 1]giving the fraction of sequences drawn with replacement in each repetition, default1. At least two sequences are always drawn.- format, id, period, state, group
Arguments describing the shape and column names of
data. They are used to reshapedatabefore resampling; the resampled sequences are then fitted in wide form, so onlygroupis forwarded tofit_tna().groupresamples within each group.- seed
Optional single seed, restored on exit and recorded on the result.
- ...
Further arguments passed to
fit_tna().
Value
A simulab_sim edge list with one row per repetition and
transition: a leading iteration column followed by the columns
fit_tna() returns. The summary component holds one row per edge (per
group, when group is given) with the bootstrap mean, sd, and the
2.5% and 97.5% percentiles as lower and upper.
Examples
data <- simulate_sequences(n = 40, n_states = 3, chain_length = 12, seed = 1)
if (requireNamespace("tna", quietly = TRUE)) {
head(bootstrap_tna(data, model = "tna", repetitions = 5, seed = 1))
}