transition_entropy {AnimalSequences}R 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)


[Package AnimalSequences version 0.2.0 Index]