transition_entropy: Calculate Transition Entropy for Sequences

View source: R/transition_entropy.R

transition_entropyR Documentation

Calculate Transition Entropy for Sequences

Description

This function calculates the transition entropy for sequences using n-grams. It performs bootstrapping to compute entropy and expected entropy over multiple iterations.

Usage

transition_entropy(sequences, ngram = 2, iterations = 20)

Arguments

sequences

A list of sequences (character vectors) to analyze.

ngram

The size of the n-gram (default is 2).

iterations

The number of bootstrap iterations (default is 20).

Value

A data frame with calculated entropies, expected entropies, and entropy ratios for each iteration.

Examples

sequences <- unlist(list("A B C", "B C A", "C A B"))
transition_entropy(sequences, ngram = 2, iterations = 20)


AnimalSequences documentation built on Sept. 30, 2024, 9:18 a.m.