block_entropy: Compute Block Entropy

View source: R/block_entropy.R

block_entropyR Documentation

Compute Block Entropy

Description

Compute Block Entropy

Usage

block_entropy(x, block_size = 1)

Arguments

x

vector of distinct options of numbers or characters

block_size

length of blocks in which the original sequence should be divided for analysis

Details

This function takes a vector x and uses it to compute its entropy for the specified block_size, often referred to as k. The default implementation sets the block_size to 1 which is equivalent to Shannon Entropy.

Value

block entropy of x for the specified block_size

References

Shannon, C. E. (n.d.). A Mathematical Theory of Communication. 55. https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf

Examples

block_entropy(c(1, 1, 1, 2, 2, 2))
block_entropy(c(1, 1, 1, 2, 2, 2), block_size = 2)


TImA97/randfindR documentation built on July 1, 2024, 7:56 p.m.