stat.entropyFunction: Entropy of a bit-string

View source: R/stat.entropyFunction.r

stat.entropyFunctionR Documentation

Entropy of a bit-string

Description

The entropy of a bitstring (ex: 1010111000) is calculated.

Usage

stat.entropyFunction(bitString)

Arguments

bitString

- A vector of 0's and 1's.

Value

e - a floating point percentage, between 0 and 1.

Examples

stat.entropyFunction(c(1,0,0,0,1,0,0,0,0,0,0,0,0))       # Output: 0.6193822
stat.entropyFunction(c(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0)) # Output: 1
stat.entropyFunction(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)) # Output: 0

BRL-BCM/CTD documentation built on Nov. 2, 2023, 3:55 a.m.