
This function calculates the transition entropy for sequences using n-grams. It performs bootstrapping to compute entropy and expected entropy over multiple iterations.
transition_entropy(sequences, ngram = 2, iterations = 20)
A data frame with calculated entropies, expected entropies, and entropy ratios for each iteration.
A list of sequences (character vectors) to analyze.
The size of the n-gram (default is 2).
The number of bootstrap iterations (default is 20).
sequences <- unlist(list("A B C", "B C A", "C A B"))
transition_entropy(sequences, ngram = 2, iterations = 20)
Run the code above in your browser using DataLab