ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Mutual information from consistent marginals and a joint distribution

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…

Implementation mathematicsSource recovered; runtime not executed
Learn with the Atlas

Study this idea step by step

Follow a lesson that explains this source definition, then practice the underlying idea.

Open guided lesson
gh-eq-3860fd0977e16222source-comment-equation
MutualInformationcomputesI(X;Y)=H(X)+H(Y)−H(X,Y)MutualInformation computes I(X;Y) = H(X) + H(Y) - H(X,Y)

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

TermMeaning 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)

Related builds

Sources & provenance

01
Go mathematical helpers
Lines 106–106 · 33aa84f2aa61
02
Go mathematical helpers
Lines 106–106 · 33aa84f2aa61

Search equations, builds, manuscript text, and recovered sources.