Information theory
Mutual information
info.mutual-informationAlso called mutual information, mi, mutual info, information gain
where
where
Information shared by two discrete variables, from their joint probability table P, in nats: the KL divergence of the joint distribution from the product of its marginals p (rows) and q (columns).
Notation
joint probability table, entries summing to one
P ∈ ℝm×n: entries > 0, summing to 1
number of values of X
Size, at least 2
number of values of Y
Size, at least 2
Result: the mutual information, in nats
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
Given
Result
≈ 0.130812035941
Given
Result
≈ 0.0108908167969
Given
Result
≈ 0.0225480503791
Common mistakes
Uses log base 2
The result is in bits.
Fix: Use the natural logarithm, or multiply by ln 2.
Source
Cover and Thomas 2006
Cover, Thomas M.; Thomas, Joy A. Elements of Information Theory. 2nd ed. Wiley-Interscience, 2006. doi:10.1002/047174882X