tna 1.5.8
-
permutation_test(): comparing two models with scaled edge weights gives a message (classtna_message_scaling). Each network is scaled on its own, so comparing scaled weights is not warranted; the test still runs.
tna 1.5.7
-
estimate_cs(): the CS-coefficient is the largest passing proportion, whatever the order ofdrop_prop. -
permutation_test():adjustcorrects over the edges tested (present in either network), not every cell.
tna 1.5.6
-
group_model(),group_tna(),group_ftna()andgroup_ctna(): window parameters inparamsand windows recorded byimport_onehot()had no effect, so a grouped model of the same call astna()gave different weights. They are now used, as inbuild_model().
tna 1.5.4
Corrections to numerical results. Results from the functions below can differ from earlier versions.
-
bootstrap_cliques()resampled from the first sequences only, as many as there were cliques (for example, 22 of 2,000 sequences), so its p-values and confidence intervals were invalid. Each bootstrap sample now draws as many sequences as the data has. -
reliability()counted the transitions of the model it was given for every requested type, sotypesonly switched the row normalization on or off:"co-occurrence","gap","attention", and the other types all gave the frequency result. Each type is now estimated asbuild_model()defines it. The defaulttypesis the type of the model (it was"relative"for every model). -
compare(): the Canberra distance omitted the edges present in only one network (each contributes 1), and the distance correlation was reported squared. The states of the two networks are matched by name, so two networks listing the same states in a different order are compared correctly; networks with different states, or a matrix without state names, are an error of classtna_error_states(they were compared by position). -
summary()of a model reported the standard deviation of the in-strength as that of the out-strength and vice versa (the means are equal by construction). -
estimate_cs(): a subsample in which the correlation is undefined (the measure is constant in it) was dropped from the share of draws abovethreshold, which could raise the CS-coefficient. It now counts as a draw below the threshold. -
BetweennessRSPcounted the correction for walks absorbed at a target once for every state, also for states that cannot reach it. In a network that is not strongly connected (for example, with a state that is never entered) the values were wrong. Only sources that reach the target are counted; strongly connected networks are unchanged. -
simulate():zero_rowwas replaced by the value offormat, sozero_row = "uniform"had no effect for frequency models, and states that are never left (such as a state that only ends sequences) moved arbitrarily in relative models.zero_rownow applies to both model types.max_len = 1andna_rangevalues with equal ends or a zero lower end no longer fail. -
prune(method = "disparity")set the absent edges of a state with no outgoing or no incoming edges toNA. They stay 0. -
build_model()of a widedata.framediscardedwindow_size,window_span, andwindowedgiven inparams. They are now used. - Backward (and bidirectional) attention paired every time point with itself, adding a self-loop of full weight at every observation. Only earlier time points are attended to, as forward attention uses only later ones.
-
group_model()kept the unused factor levels ofgroup, so a level with no sequences became an empty network withNaNinitial probabilities. Unused levels are dropped. -
print()of a model without initial probabilities (for example,build_model()of a matrix) failed.plot()of a model failed whennode_sizeorvsizewas given, andplot_sequences(show_n = FALSE)failed. -
permutation_test()andestimate_cs()took the observed network from the weights of the model but rebuilt the resamples from the sequence data, so a pruned model was compared with unpruned resamples (a model tested against its own pruned version showed significant differences). The observed network is now rebuilt from the sequence data too, as inbootstrap(). Results for unpruned models are unchanged. -
end_statewas not added when no sequence filled the last column of the data (for example, in a subset of the rows, or with an empty trailing column). It is now always added after the last observation. -
build_model()of atsnobject ordered the time points by first appearance in the data, not by time, which could reverse transitions. They are now ordered by time. -
cliques(sum_weights = TRUE)appliedthresholdto each direction before summing them, so a pair whose summed weight exceeded the threshold could be missed. The threshold now applies to the sum, as documented. This also affectsbootstrap_cliques()with a positivethreshold. -
import_onehot(window_type = "sliding")widened the windows of width 3 or more (each lag was applied to the already widened rows), and treated width 1 as width 2. Each window now covers exactlywindow_sizerows, and the incomplete windows at the start are dropped. Width 2 is unchanged. -
plot_associations()drew every residual in the reverse direction (from target to source). -
plot()of grouped communities colored every state of a group with the same color. Each community now has its own color, as for a single group.
tna 1.5.3
- Documentation revision. The help pages describe what the functions return as they do now:
summary()of a model (a table of 13 metrics, not a list),communities(),cliques(),compare(),compare_sequences()(the defaultsubis1:5),permutation_test(),bootstrap()(with itsmodelelement),reliability(),prepare_data(),import_data(),import_onehot(),simulate(),plot_compare(), andpruning_details(). The default ofna.rmingroup_model()isTRUE, as in the code, and a missinggroupis an error.prune()documents its four methods, including that only"threshold"and"lowest"keep the network weakly connected, andreprune()has its own help page. - Examples no longer reach into result objects with
$or subset the data with brackets;print(<tna_data>)examples use thedataargument (they usedwhich, which was ignored).centralities(),prune(), andcluster_sequences()cite the methods they implement. - Vignettes and articles: the tables of the getting-started vignette, the grouped-sequences vignette, and the README use
print()andsummary()instead of$weights,$inits, and$centralities$stats; the clusters are built withgroup_tna(<clustering>);bootstrap()calls no longer pass athresholdthat the default method ignores; the time threshold ofprepare_data()is in seconds; the frequency and attention articles restore theiroptions(), and the frequency article compares the scaled weights withcompare().
tna 1.5.2
-
summary()of a permutation test returns the centrality results withwhat = "centralities"(the edges remain the default). - New
summary()method forreliability()results: all 22 split-half metrics, with their category, as a tidy table (print()shows four). - New article “Validating a transition network” covering
markov_order(),bootstrap()and bootstrap pruning,estimate_cs(),reliability(),permutation_test()(including edge betweenness),compare_sequences(), and theactorargument for nested data. - Every vignette and article ends with a list of the package articles, the TNA tutorials and book chapters, and the Dynalytics resources (package sites, tools, CarmNotes, and selected articles).
tna 1.5.1
- Small examples on a subset of the data come before the
\donttest{}blocks ofcompare_sequences(),estimate_cs(),plot_frequencies()for groups, and the print, plot and summary methods of sequence comparisons and stability results. Theas.igraph()methods have examples. -
permutation_test()for groups and theplot()methods of bootstrap and reliability results document what they return. - The vignette “A showcase of the main tna functions” restores the
options()it changes. - The plots of the README are no longer part of the package, which reduces the installed size from 6.3 to 4.1 MB.
tna 1.5.0
compare_sequences()now rejects arguments it does not use. A misspelled argument such ascorrection = "fdr"(the argument isadjust) was silently ignored and the default Bonferroni correction applied; the vignette on grouped sequences had this mistake and now usesadjust = "fdr"as its text describes.Fixed
build_model()andgroup_model()for data with a single time point: the sequences were joined into one row, which created transitions that do not exist (andgroup_model()failed).Fixed
group_model()andgroup_tna()with acharactergroup: when the data did not start with the alphabetically first group, every network was labelled with another group’s name. Groups keep their order of first appearance and now hold their own sequences.Fixed scaling across groups (
groupwise = FALSE, the default) dropping the state names of the weight matrices, which madecommunities()andcompare()fail.Fixed
centralities()naming the states1,2, … instead of their labels when the only measures requested wereDiffusionorBetweennessRSP(whose computations return unnamed values); the centrality table ofpermutation_test(measures = "Diffusion")had the same problem.New
summary()methods fortna_permutation,group_tna_permutation,tna_stability, andgroup_tna_stabilityobjects return tidy tables: one row per edge (from,to,diff_true,effect_size,p_value) and one row per measure (measure,cs_coefficient).Permutation effect sizes are
NAwhere the permuted differences do not vary, instead ofInforNaN(permutation_test()for edges and centralities, andcompare_sequences()). Whether they vary is judged against the magnitude of the compared values, so the rule does not depend on the measurement scale.Grouped models with scaled edge weights (
group_model(scaling = ), with either value ofgroupwise) and the networks they contain are no longer resampled:bootstrap(),bootstrap_cliques(),permutation_test(),estimate_cs(),reliability(), andcompare_sequences()raise an error of classtna_error_scaling. Scaling across groups depends on every group, so a resample of one group cannot reproduce it. Before,bootstrap()andpermutation_test()refused such a group as a whole, butestimate_cs()on the group, and every resampling function on one of its networks (for examplebootstrap(model[[1]])), rebuilt the resamples without the scaling and compared them with the scaled network. Resampling of single scaled models (tna(x, scaling = )) is unchanged.Fixed
centralities(measures = "BetweennessRSP")returning a single row for a network with a state that has no outgoing transitions;BetweennessRSPisNAfor every state there.summary()of anestimate_cs()result keeps its columns when nothing could be estimated, and a grouped summary no longer fails when one group has no results.New
markov_order()tests whether sequences are described by a first-order Markov chain, the assumption of a transition network, or depend on states further back. Each order is tested against the order below with the likelihood-ratio statistic (Anderson & Goodman, 1957) and a conditional permutation test that shuffles the next states within each context. The orders are tested in sequence, and the results also report the log-likelihood, AIC, and BIC of the multi-order model of each order (Scholtes, 2017). Methods fortnaandgroup_tnaobjects, withprint(),summary(), andplot()methods.plot()draws two panels: the log-likelihood, AIC, and BIC across the orders with the selected order marked, and the permutation null density of each order with the observed statistic (panel = "ic"or"permutation"draws one; unknown arguments are errors). Because the tests stop at the first order that does not reject, a dependence that skips an order is not selected: a warning of classtna_warning_markov_orderand a printed note flag a higher order whose test rejects and AIC or BIC choosing another order. The same warning is raised wheniteris too small for any p-value to fall belowlevel.estimate_cs()gains the argumentedges: withedges = TRUE, the stability of the edge weights is estimated alongside the centralities and returned as the elementEdges. Only the edges present in the network are compared, because an edge absent from the data cannot appear in a subsample and would only add agreeing zeros.Diffusioncentrality is now always normalized to the range from 0 to 1 (min-max), whatever the value ofnormalize, incentralities()and in everything that uses it (permutation_test(measures = ),compare(),estimate_cs(), plots). Its raw values grow with powers of the edge weights and exceed1e30for frequency models. Where diffusion does not vary across the states (a relative model withloops = TRUE), it isNaN.-
Fixed resampling of edge betweenness networks. The resampling functions rebuilt a model from
betweenness_network()with all weights equal to zero, sopermutation_test()gave the smallest possible p-value and an infinite effect size to every edge whose betweenness differed,bootstrap()returned no edges, every CS-coefficient ofestimate_cs()was 0, andreliability()compared empty networks.betweenness_network()now records the model it was built from. Inpermutation_test(),bootstrap(), andestimate_cs(), every resample rebuilds that model and recomputes edge betweenness, sopermutation_test()on two edge betweenness networks tests their differences in edge betweenness;reliability()uses the transitions of that model.betweenness_network()also has a method forgroup_tnaobjects, sopermutation_test(betweenness_network(models))compares edge betweenness between all groups in one call.Edge betweenness networks created by earlier versions must be rebuilt to be resampled, and
betweenness_network()refuses a network that is already an edge betweenness network.
tna 1.4.0
- New
actorargument for sequences nested in actors (for example, several sessions per student) in every resampling method:permutation_test(),bootstrap(),estimate_cs(),reliability(),compare_sequences(), andprune(method = "bootstrap")throughbootstrap().actoris a column name of the data the model was built from, or a vector with one identifier per sequence. With one sequence per actor, every method gives the same result as withoutactor.- Permutation tests reassign whole actors between groups and shuffle the sequences of actors present in several groups within the actor (Good, 2005). A warning is given when the actors allow too few distinct permutations to reach the significance level.
- Bootstraps resample whole actors with replacement (cluster bootstrap; Davison & Hinkley, 1997).
- Case-dropping (
estimate_cs()) drops whole actors, and split-half reliability puts all sequences of an actor in the same half.
- Models keep the non-sequence columns of their data (one row per sequence), so
actorcan name any of them. This includes models built fromprepare_data()output, grouped models, andcluster_data()ofprepare_data()output. Withconcat > 1, the columns that are constant within each concatenated block are kept. Grouped models record the rows of each group, so anactorvector for the full data applies to every group, including groups from mixture models.
tna 1.3.1
CRAN release: 2026-09-28
- Fixed
prepare_data()emitting a dplyr grouping message when computing sessions per user; the summarise now drops its grouping explicitly.
tna 1.3.0
- Fixed case-insensitive argument matching to preserve canonical option names, allowing
cluster_data()andcluster_sequences()to pass"ward.D"and"ward.D2"correctly tostats::hclust(). - Made state ordering deterministic across system locales for individual and grouped models.
- Fixed numerical instability in randomized-shortest-path betweenness and prevented normalization from amplifying floating-point noise in constant centrality measures.
- Added deterministic timezone handling to
prepare_data(): UTC is the default, explicit offsets are honored, fractional seconds are retained, and offset-free timestamps can use a user-specified Olson timezone. -
prepare_data(time_threshold = FALSE)now disables gap-based session splitting while retaining timestamp parsing and event ordering. -
prepare_data()now supports explicit session columns and collision-safe composite actor/session identities, including high-cardinality groupings. Disabled time splitting now bypasses gap computation and keeps missing-time events in their actor-session sequence. - Documented the
time_datacomponent returned byprepare_data(). -
prune()now warns about inactive method-specific arguments and treats a supplied bootstrap object as a request for bootstrap pruning. - Added reproducible
seedarguments to network and clique bootstrapping. - Added weighted PageRank to
centralities(). -
plot.tna_permutation()now dispatches to the dedicated permutation renderer ofcograph::splot(), so permutation-specific options such asshow_nonsig,show_stars,show_effect,edge_nonsig_color,edge_nonsig_style, andedge_nonsig_alphaare honored. - Fixed qgraph-style plotting arguments (such as
edge.label.cex) being ignored by matrix-based network plots (e.g. permutation and disparity plots). - Added a
binsargument toplot.tna_reliability()for controlling the number of histogram bins.
tna 1.2.3
CRAN release: 2026-04-26
- Resolved CRAN warning “Data files with namespace references not in the recursive strong package dependencies” by rebuilding
engagement_mmmas atna_mmmobject that carries no foreign class references. The new sibling S3 methodsgroup_model.tna_mmm()andmmm_stats.tna_mmm()preserve all existing example behaviour without requiringseqHMMat example-run time. Realmhmmobjects fromseqHMMcontinue to work via the original*.mhmmmethods. - Added
random_tna(),random_group_tna(),random_tna_mmm(), andlist_random_state_pools()for constructing synthetic TNA models with no external dependencies. - Lowered the minimum required R version from 4.4.0 to 4.1.0 (the floor set by the native
|>pipe used in the package).
tna 1.2.1
- The
testargument ofcompare_sequences()is nowTRUEby default for backward compatibility. - Fixed an issue with
bootstrap()when the model contained weights that were zero. - Fixed issues with several distance measures in
cluster_sequences(). - Fixed edge ordering in
betweenness_network(). - The packages no longer depends on
qgraph. - Network plotting functionality now relies on
cographinstead.
tna 1.2.0
CRAN release: 2026-02-12
- Added the function
reliability()for reliability analysis oftnamodels. - The
import_onehot()function has been redesigned with new features. - Replaced the Z tests and chi-squared tests in
compare_sequences()with a permutation test. - Removed the chi-squared test from
plot_mosaic(). - The
correctargument ofcompare_sequences()has been renamed toadjustto align with other similar arguments. - Added several new arguments to the
plotmethod oftnaobjects for plotting heterogeneous networks. - The
plotmethod forcommunitiesnow uses the first available method by default. - The
stringdistpackage has been moved to Suggests. - Added additional checks for missing columns when using tidy selections in various functions that were previously silently ignored.
tna 1.1.0
CRAN release: 2025-10-18
- Added the function
cluster_sequences()to cluster sequence data using string distance measures of thestringdistpackage. - Added the function
compare_sequences()to compare the frequencies of patterns between groups for sequence data. -
prepare_data()now accepts a character vector for theactorargument.
tna 0.7.0
- Added the function
import_onehot()to read one-hot data. - The function
plot_sequences()gains the argumentncolfor selecting the number of columns of the facets.
tna 0.6.1
- The
groupcolumn is now automatically removed fromcolsingroup_model().
tna 0.6.0
- Added a new method
plot_sequences()for sequence index plots and state distribution plots.
tna 0.5.1
- Fixed the handling of missing values in
group_model()withstslistobjects. - Fixed an issue with
plot.group_tna_permutation()that resulted in plotting arguments not being passed toqgraph.
tna 0.4.9
- Switched to
matrixas the internal data format used by TNA models for performance improvements across all functions.
tna 0.4.8
- Fixed an issue with
prepare_data()that resulted in excessive console output.
tna 0.4.7
- Added the function
import_data()to read wide format sequence data into long format.
tna 0.4.6
- Added the function
plot_frequencies()that can be used to plot the state frequency distribution for bothtnaandgroup_tnaobjects.
tna 0.4.5
- The function
permutation_test()is now a method for both ungrouped (build_model()) and grouped (group_model()) models. For grouped models, the function performs the test between every unique pair of groups. - A new argument
adjusthas been added forpermutation_test()to optionally adjust p-values usingp.adjust. By default, the p-values are not adjusted (adjust = "none"). - A new argument
groupwisehas been added forgroup_model(). WhenFALSE(the default), scaling methods listed inscalingare performed globally over the groups. WhenTRUE, the scaling is performed within each group instead (this was the default behavior in previous versions of the package). - Added a
simulate()method fortnaobjects. For models withtype = "relative", this function simulates sequence data based on the initial probabilities and transition probability matrix.
tna 0.4.4
- The
plot.tna_centralities()andplot.group_tna_centralities()functions now plot the centralities in the same order as provided in themeasuresargument. - The
plot.tna()andplot_model()functions now use the median edge weight as the default value for thecutargument. - Fixed the
fromandtocolumns inbootstrap()output, which were inverted from the true edge direction. - A plot method has been added for the
bootstrap()output, which plots the corresponding network where non-significant edges have been pruned.
tna 0.4.3
- The
permutation_test()function now properly checks that its argumentsxandycan be compared. - The p-value calculations of
permutation_test()andbootstrap()have been adjusted by adding 1 to both the number of permutations/bootstrap samples and the number of extreme events so that these estimates are never zero. The documentation has also been clarified regarding p-values emphasizing that these are estimates only.
tna 0.4.2
- The
plot_compare()function now supportsnegColandposColfor specifying the color of the positive and negative differences in transition and initial probabilities. - The
plot_mosaic()function now plots the x-axis on the top and rotates the labels 90 degrees only when there are more than three groups.
tna 0.4.1
- The
detailedargument ofestimate_centrality_stability()has been removed. Previously this argument had no effect on the output of the function. - Removed several duplicated entries in the documentation.
tna 0.4.0
CRAN release: 2025-03-01
- The
prepare_data()function now produces an object of classtna_data, which can be directly used as an argument tobuild_model()and other methods. - The
prepare_data()function now supportsorderwhen used together withtimeandactor. - The
prepare_data()function gains theunused_fnargument oftidyr::pivot_wider()to process any extra columns. The default is to keep all columns and use the first value. - Added the function
compare()to comparetnamodels and weight matrices. This function produces an object of classtna_comparisonwhich hasprint()andplot()methods. - Added the function
plot_mosaic()which can be used to produce mosaic plots of transition counts for frequency-based transition network models and to contrast the state counts between groups. - Fixed an issue with
plot.tna_communities()which now checks for the availability of a particular community detection method before plotting. - Made several arguments in the plot methods of the package accessible to the user.
tna 0.3.2
-
event2sequence()has been renamed toprepare_data(). The function is now also more general and can process more date formats. - Added a
methodargument tobootstrap(). The new default option"stability"implements a bootstrapping scheme where the edge weights are compared against a range of “consistent” weights (see the documentation for details). The old functionality can be accessed withmethod = "threshold". - Fixed an issue with
permutatation_test()whenxandyhad a differing number of columns. - Community detection methods can now be selected using the
methodsargument incommunities(). - The
build_model()function has gained the argumentcolswhich can be used to subset the columns of the data forstslistanddata.frameinputs. - Removed all
verbosearguments in favor ofoptions(rlib_message_verbosity = "quiet").andoptions(rlib_warning_verbosity = "quiet").
tna 0.3.1
- Fixed an issue when checking the validity of
charactertype arguments. - Improved the
bootstrap()function to determine edge significance based on deviation from the observed value, rather than a fixed threshold. - Added a helper function
event2sequence()to parse event data into sequence data.
