View source: R/block_entropy.R
block_entropy | R Documentation |
Compute Block Entropy
block_entropy(x, block_size = 1)
x |
vector of distinct options of numbers or characters |
block_size |
length of blocks in which the original sequence should be divided for analysis |
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.
block entropy of x
for the specified block_size
Shannon, C. E. (n.d.). A Mathematical Theory of Communication. 55. https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf
block_entropy(c(1, 1, 1, 2, 2, 2))
block_entropy(c(1, 1, 1, 2, 2, 2), block_size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.