| mogen_transitions | R Documentation |
Returns a data frame of all transitions at a given Markov order, sorted by count (descending). Each row shows the full path as a readable sequence of states, along with the observed count and transition probability.
mogen_transitions(x, order = NULL, min_count = 1L)
x |
A |
order |
Integer. Which order's transitions to extract. Defaults to the optimal order selected by the model. |
min_count |
Integer. Minimum observed count to include (default 1). Use this to filter out rare transitions that have unreliable probabilities. |
At order k, each edge in the De Bruijn graph represents a (k+1)-step path.
For example, at order 2, the edge from node "AI -> FAIL" to node
"FAIL -> SOLVE" represents the three-step path AI -> FAIL -> SOLVE.
The path column reconstructs this full sequence for readability.
A data frame with columns:
The full state sequence (e.g., "AI -> FAIL -> SOLVE").
Number of times this transition was observed.
Transition probability P(to | from).
The context / conditioning states (k-gram source node).
The predicted next state.
seqs <- list(c("A","B","C","D"), c("A","B","C","A"), c("B","C","D","A"))
mg <- build_mogen(seqs, max_order = 2)
mogen_transitions(mg, order = 1)
trajs <- list(c("A","B","C","D"), c("A","B","D","C"),
c("B","C","D","A"), c("C","D","A","B"))
m <- build_mogen(trajs, max_order = 3)
mogen_transitions(m, order = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.