Read the equation
The identity subtracts joint entropy from the sum of the two marginal entropies. It measures statistical dependence when pxy is a normalized joint distribution with px and py as its marginals. The function trusts its three supplied arrays and inherits the entropy cutoff, so inconsistent inputs need not yield a valid nonnegative mutual information.
Terms & definitions
| Term | Meaning in this source |
|---|---|
| px | Marginal of X |
| py | Marginal of Y |
| pxy | Joint distribution of X and Y |
| I | Mutual information in bits |
How it works
Read the definition from its right-hand expression to the quantity on the left. Its surrounding source records the intended input, state, or parameter context. Where the source leaves an operation unspecified, this page preserves that gap.
Assumptions & limits
Source recovery establishes that the expression appears in this record. Its mathematical validity, implementation behavior, and interpretation must be assessed separately. See the linked source and research notes for the checks available for this version.
Original context
Read the surrounding source passage
if p[i] > EPSILON_PHI && q[i] > EPSILON_PHI {
kl += p[i] * math.Log(p[i]/q[i])
}
}
return kl
}
// MutualInformation computes I(X;Y) = H(X) + H(Y) - H(X,Y)
func MutualInformation(px, py, pxy []float64) float64 {
hx := ShannonEntropy(px)
hy := ShannonEntropy(py)
hxy := ShannonEntropy(pxy)
return hx + hy - hxy
}
// FisherInformation computes I(θ) = E[(∂log p/∂θ)²]
func FisherInformation(scores []float64) float64 {
if len(scores) == 0 {Exact original notation
MutualInformation computes I(X;Y) = H(X) + H(Y) - H(X,Y)