Skip to contents

Network Estimation

Core functions for building networks from data

build_network() print(<netobject>) print(<netobject_group>) print(<netobject_ml>) plot(<netobject>) plot(<netobject_group>) plot(<netobject_ml>) summary(<netobject>) summary(<netobject_group>) print(<summary.netobject>) `[`(<summary.netobject_group>) print(<summary.netobject_group>)
Estimate a network
build_tna()
Estimate a transition network analysis (TNA) model
build_ftna()
Estimate a frequency transition network analysis (FTNA) model
build_atna()
Estimate an attention transition network analysis (ATNA) model
build_cna()
Estimate a co-occurrence network analysis (CNA) model
build_ngram()
Estimate an n-gram transition network analysis model
build_gap()
Estimate a gap transition network analysis model
build_reverse()
Estimate a reverse transition network analysis model
build_latency()
Estimate a latency network analysis model
build_wtna()
Estimate a window transition network analysis (WTNA) model
wtna() print(<wtna_mixed>)
Build a window-based transition network from one-hot data
build_cor()
Estimate a correlation network
build_pcor()
Estimate a partial correlation network
build_glasso()
Estimate an EBIC graphical lasso network
build_ising()
Estimate an Ising model
build_mgm()
Estimate a mixed graphical model (MGM)
estimate_network()
Estimate a network (deprecated)
register_estimator()
Register a network estimator
get_estimator()
Retrieve a registered estimator
list_estimators()
List the registered estimators
remove_estimator()
Remove a registered estimator
cooccurrence()
Build a co-occurrence network of items in transactions
build_mlvar() print(<net_mlvar>) summary(<net_mlvar>) plot(<net_mlvar>)
Estimate multilevel vector autoregression networks
build_gimme() coefs(<net_gimme>)
Estimate person-specific networks with GIMME

Bayesian Inference

Dirichlet-Multinomial posterior inference for transition networks. certainty() is the closed-form counterpart of bootstrap_network(); bayes_compare() is the complement of permutation().

certainty() print(<net_certainty>)
Estimate the Bayesian certainty of transition network edges
bayes_compare() print(<net_bayes>) summary(<net_bayes>) plot(<net_bayes>) print(<net_bayes_group>) plot(<net_bayes_group>) summary(<net_bayes_group>)
Compare two transition networks with a Bayesian Dirichlet model
subtract_networks() print(<netdifference>)
Subtract one network from another
as_netdifference()
Convert a network comparison to a difference network

Higher-Order Networks

Methods for capturing higher-order dependencies

build_hon() print(<net_hon>) summary(<net_hon>)
Build a higher-order network from sequences
build_honem() print(<net_honem>) summary(<net_honem>) plot(<net_honem>)
Embed the nodes of a higher-order network with HONEM
build_hypa() print(<net_hypa>) summary(<net_hypa>)
Detect over- and under-represented paths with HYPA
build_mogen() print(<net_mogen>) summary(<net_mogen>) plot(<net_mogen>)
Fit a multi-order generative model to sequences
pathways()
Extract pathways from a higher-order network
mogen_transitions()
Extract the transitions of a MOGen model
path_counts()
Count the paths of k states in trajectories
bipartite_groups()
Build a hypergraph from group memberships
clique_expansion()
Project a hypergraph onto a pairwise network
hypergraph_centrality()
Compute the eigenvector centralities of a hypergraph
build_hypergraph() print(<net_hypergraph>) summary(<net_hypergraph>)
Build a hypergraph from a network's cliques
hypergraph_measures() print(<hypergraph_measures>)
Compute the structural measures of a hypergraph
hypergraph_cluster() print(<net_hypergraph_cluster>) summary(<net_hypergraph_cluster>) node_clusters() plot(<net_hypergraph_cluster>)
Cluster the nodes of a hypergraph spectrally
hypergraph_transduction() print(<net_hypergraph_transduction>) summary(<net_hypergraph_transduction>) label_predictions() label_scores() plot(<net_hypergraph_transduction>)
Classify unlabelled hypergraph nodes by label spreading
hypergraph_laplacian()
Compute the normalised Laplacian of a hypergraph

Markov Analysis

Order, structure, entropy, and stability of Markov chains

chain_structure() print(<chain_structure>) plot(<chain_structure>) summary(<chain_structure>) print(<chain_structure_group>) summary(<chain_structure_group>) print(<summary_chain_structure>)
Classify the states and structure of a Markov chain
markov_order_test() print(<net_markov_order>) print(<net_markov_order_group>) summary(<net_markov_order>) plot(<net_markov_order>)
Test the Markov order of a sequential process
markov_stability() print(<net_markov_stability>) print(<net_markov_stability_group>) summary(<net_markov_stability>) summary(<net_markov_stability_group>) plot(<net_markov_stability>) plot(<net_markov_stability_group>)
Describe the stability of each state of a Markov chain
passage_time() print(<net_mpt>) print(<net_mpt_group>) summary(<net_mpt>) summary(<net_mpt_group>) plot(<net_mpt>) plot(<net_mpt_group>)
Compute the mean first passage times of a Markov chain
path_dependence() print(<net_path_dependence>) summary(<net_path_dependence>) print(<summary.net_path_dependence>) plot(<net_path_dependence>)
Measure the path dependence of each context at order k
transition_entropy() print(<net_transition_entropy>) print(<net_transition_entropy_group>) summary(<net_transition_entropy_group>) plot(<net_transition_entropy_group>) summary(<net_transition_entropy>) plot(<net_transition_entropy>)
Compute the transition entropy of a Markov chain
entropy_network()
Decompose the entropy rate into a network of transitions
entropy_trajectory() print(<net_entropy_trajectory>) summary(<net_entropy_trajectory>) plot(<net_entropy_trajectory>)
Track transition entropy over time in sliding windows
entropy_bayes() print(<net_entropy_bayes>) print(<net_entropy_bayes_group>) summary(<net_entropy_bayes_group>) plot(<net_entropy_bayes_group>) summary(<net_entropy_bayes>) plot(<net_entropy_bayes>)
Estimate transition entropy with Bayesian credible intervals
stability_landscape() summary(<net_landscape>) print(<net_landscape>) plot(<net_landscape>)
Estimate the stability landscape of a transition network
landscape_surface() summary(<net_landscape_surface>) print(<net_landscape_surface>) plot(<net_landscape_surface>)
Trace a stability landscape across a sequence measure
landscape_trend() summary(<net_landscape_trend>) print(<net_landscape_trend>) plot(<net_landscape_trend>)
Trace a stability landscape along time or a covariate

Network Pruning

Non-destructive edge pruning and restoration

net_prune()
Prune weak or non-significant edges from a network
net_deprune()
Undo the pruning of a network
net_reprune()
Re-apply the pruning of a network
net_pruning_details() print(<net_pruning_details>)
List the edges a pruning removed

Bootstrap & Inference

Statistical inference for network estimation

bootstrap_network() print(<net_bootstrap>) summary(<net_bootstrap>) print(<net_bootstrap_group>) summary(<net_bootstrap_group>) print(<wtna_boot_mixed>) summary(<wtna_boot_mixed>) plot(<net_bootstrap>) plot(<net_bootstrap_group>)
Bootstrap a network estimate
vertex_bootstrap() print(<net_vertex_bootstrap>) summary(<net_vertex_bootstrap>) plot(<net_vertex_bootstrap>)
Bootstrap network-level statistics by resampling nodes
vertex_compare() print(<net_vertex_comparison>) summary(<net_vertex_comparison>) plot(<net_vertex_comparison>)
Test whether network-level statistics differ between two networks
boot_glasso() print(<boot_glasso>) summary(<boot_glasso>) plot(<boot_glasso>)
Bootstrap a graphical lasso network
permutation() print(<net_permutation>) summary(<net_permutation>) print(<net_permutation_group>) summary(<net_permutation_group>) print(<wtna_perm_mixed>) summary(<wtna_perm_mixed>) plot(<net_permutation>) plot(<net_permutation_group>)
Test whether two networks differ by permutation
permutation_diagnostics()
Diagnose the effect of nesting on a permutation test
nct() print(<net_nct>) summary(<net_nct>) as.data.frame(<net_nct>)
Compare two networks with the network comparison test
compare_model() print(<net_comparison>) plot(<net_comparison>)
Compare two networks descriptively
compare_networks() print(<net_network_comparison>) plot(<net_network_comparison>)
Compare two or more networks
summary(<net_network_comparison>) edge_differences() node_differences() global_differences() network_metrics() print(<net_table>) `[`(<net_table>)
Tabulate the results of a network comparison
rename_models()
Rename the networks of a network group
magnitude_difference() print(<magnitude_difference>) summary(<magnitude_difference>) plot(<magnitude_difference>)
Measure how far frequency and probability networks disagree

Reliability & Stability

Assess reliability and stability of network estimates

Clustering & Grouping

Cluster-based and multilevel network analysis

build_clusters() print(<net_clustering>) summary(<net_clustering>) plot(<net_clustering>) print(<tidy_covariates>)
Cluster sequences by dissimilarity
cluster_data()
Cluster sequences (deprecated)
cluster_choice() print(<cluster_choice>) summary(<cluster_choice>) plot(<cluster_choice>)
Compare clusterings across k, dissimilarities and methods
cluster_diagnostics() print(<net_cluster_diagnostics>) plot(<net_cluster_diagnostics>) summary(<net_cluster_diagnostics>)
Collect the quality measures of a clustering
cluster_summary()
Aggregate a network's weights to clusters of nodes
cluster_mmm()
Cluster sequences with a mixed Markov model
cluster_network()
Cluster sequences and estimate one network per cluster
build_mcml() print(<mcml_layer>) print(<mcml>) summary(<mcml>)
Build an MCML model of cluster and within-cluster transitions
build_mcml_pc() print(<mcml_pc>) summary(<mcml_pc>) plot(<mcml_pc>)
Build an MCML model of a psychometric network
composites()
Compute cluster scores from a psychometric MCML fit
item_loadings()
Tabulate the item loadings of a psychometric MCML fit
macro_network()
Build the cluster-level network with chosen clusters expanded
build_mmm() print(<net_mmm>) summary(<net_mmm>) plot(<net_mmm>) print(<net_mmm_clustering>) plot(<net_mmm_clustering>)
Fit a mixed Markov model
compare_mmm() print(<mmm_compare>) summary(<mmm_compare>) plot(<mmm_compare>)
Compare mixed Markov models across numbers of subgroups
session_ids()
Identify the session behind each sequence

Simplicial Complex Analysis

Topological analysis of networks

build_simplicial() print(<simplicial_complex>) plot(<simplicial_complex>)
Build a simplicial complex
simplicial_features()
Tabulate the topological features of one or many networks
persistent_homology() print(<persistent_homology>) plot(<persistent_homology>)
Compute the persistent homology of a network
bottleneck_distance()
Compute the bottleneck distance between persistence diagrams
persistence_landscape() print(<persistence_landscape>) plot(<persistence_landscape>)
Compute the persistence landscape of a persistence diagram
q_analysis() print(<q_analysis>) plot(<q_analysis>)
Describe the q-connectivity of a simplicial complex
betti_numbers()
Count the holes of a simplicial complex
euler_characteristic()
Compute the Euler characteristic of a simplicial complex
simplicial_degree()
Count the simplices that contain each node
verify_simplicial() print(<net_simplicial_check>)
Verify a simplicial complex against igraph

Data Preparation

Convert and prepare data for network estimation

prepare() print(<nestimate_data>)
Prepare an event log for network estimation
human_long ai_long
Coded turns of human-AI vibe coding sessions
prepare_for_tna()
Prepare sequence data for the tna package
action_to_onehot()
Convert an action column to one-hot columns
wide_to_long()
Convert wide sequences to long format
long_to_wide()
Convert long event data to wide sequences
convert_sequence_format()
Convert sequence data to counts, one-hot codes or transitions
actor_endpoints()
Tabulate the first and last states of each sequence
mark_first_state()
Fill leading missing cells with a start state
mark_terminal_state()
Fill trailing missing cells with an end state
mark_phases()
Split each actor's sequence into phases

Utilities

Helper functions and extractors

predictability()
Compute the predictability of each node
frequencies() summary(<nest_transition_counts>)
Count the transitions between states in sequences
state_frequencies()
Count state frequencies in trajectories
net_aggregate_weights()
Aggregate edge weights into one value
net_centrality() print(<net_centrality>) summary(<net_centrality>) print(<net_centrality_group>) summary(<net_centrality_group>) `[`(<net_centrality_group>) `[`(<net_centrality>) plot(<net_centrality>) plot(<net_centrality_group>)
Compute centrality measures for a network
net_edge_betweenness() plot(<net_edge_betweenness>)
Weight a network's edges by their betweenness
coefs()
Tabulate the temporal coefficients of an mlVAR fit
as_tna()
Convert the layers of an MCML model to a group of networks
as_htna()
Build a node-level network with clusters as node groups
as_networks()
Convert a psychometric MCML fit to a group of networks
as_netobject()
Convert a network from another package to a netobject
validate_netobject()
Validate the structure of a network object
extract_edges()
Extract the edge list of a network
extract_initial_probs() print(<nest_initial_probs>) summary(<nest_initial_probs>)
Extract the initial-state probabilities of a network
extract_transition_matrix() print(<nest_transition_matrix>) summary(<nest_transition_matrix>)
Extract the transition matrix of a network
state_colors()
Get the state colours of an object
set_state_colors() `state_colors<-`()
Set the state colours of a network object

Sequence Analysis

Sequence visualization, pattern comparison, and association mining

sequence_plot() print(<mcml_sequence_plot>)
Draw a sequence index plot, heatmap or distribution plot
distribution_plot()
Draw a state distribution plot
plot_state_frequencies() print(<nestimate_facet_plot>) print(<nestimate_facet_list>) print(<state_freq>) plot(<state_freq>)
Plot state frequencies as treemaps or bars
state_distribution()
Tabulate the state distribution of each group
mosaic_plot()
Draw a mosaic plot of transition or co-occurrence counts
mosaic_analysis() plot(<mosaic_analysis>) print(<mosaic_analysis>) summary(<mosaic_analysis>)
Test and draw the association of two categorical variables
mosaic_test()
Test the association of a mosaic with and without clustering
extract_sequences()
Extract sequences in wide format
sequence_patterns() print(<net_sequence_patterns>) summary(<net_sequence_patterns>) `[`(<net_sequence_patterns>)
Discover sequential patterns
sequence_metrics() print(<net_sequence_metrics>) summary(<net_sequence_metrics>) `[`(<net_sequence_metrics>)
Compute descriptive indices for each sequence
sequence_compare() print(<net_sequence_comparison>) summary(<net_sequence_comparison>) plot(<net_sequence_comparison>)
Compare subsequence patterns between groups
extract_pathways()
Cut an event log into pathways
association_rules() print(<net_association_rules>) summary(<net_association_rules>) plot(<net_association_rules>)
Discover association rules in transactions or sequences

Predict and evaluate missing connections

predict_links() print(<net_link_prediction>) summary(<net_link_prediction>)
Predict missing or future links in a network
evaluate_links()
Evaluate link predictions against known edges

Outcome Modelling

Relate network and sequence features to an outcome

pattern_outcome()
Model a binary outcome from sequential patterns
outcome_model() print(<net_outcome_model>) summary(<net_outcome_model>) plot(<net_outcome_model>)
Model a unit-level outcome from sequence or network predictors
effects_table()
Tabulate the effects of an outcome model

Transition Regression

Regress the next state on covariates, one multinomial logit per current state

Data

Example datasets

human_long ai_long
Coded turns of human-AI vibe coding sessions
daily_actions
Simulated learning actions over seven days
srl_strategies
Simulated counts of self-regulated learning strategies
learning_activities
Online learning activity indicators
group_regulation_long
Group regulation actions in collaborative learning
chatgpt_srl
ChatGPT scores on self-regulated learning scales
trajectories
Student engagement trajectories