Learn R Programming

AnimalSequences (version 0.2.0)

calculate_conditional_entropy: Calculate Conditional Entropy of B given A in Bits

Description

This function calculates the conditional entropy of B given A in bits between two categorical vectors

Usage

calculate_conditional_entropy(vectorA, vectorB)

Value

The conditional entropy of B given A in bits

Arguments

vectorA

A categorical vector representing the conditioning variable A

vectorB

A categorical vector representing the conditioned variable B

Examples

Run this code
vectorA <- c("A", "B", "A", "A", "B", "C", "C", "C", "A", "B")
vectorB <- c("X", "Y", "X", "Y", "X", "Y", "Y", "X", "X", "Y")
calculate_conditional_entropy(vectorA, vectorB)

Run the code above in your browser using DataLab