Conditional expectation is an orthogonal projection when the projected quantity is square integrable. The ambient vectors are random variables, and the inner product is an expectation under a fixed probability law. This gives a precise meaning to the part of a quantity that can be recovered from an observation.
Fix the probability law and the space¶
Work on a probability space with law . The Hilbert space consists of real random variables with , identifying variables that agree almost surely. Its inner product and norm are
Let be an observation and the information it generates. Define the subspace
For ordinary real- or vector-valued observations, this is the space of all square-integrable functions . The space is closed: an -convergent sequence of -measurable variables has an almost surely convergent subsequence, and its limit has a -measurable version. Thus its limit belongs to .
The observation itself need not have a finite second moment. It is the projected quantity , and each comparison function , that must be in .
The residual is orthogonal to every function of the observation¶
Let . Conditional Jensen gives , so . By the defining property of conditional expectation,
for bounded . For a general , truncate and pass to the limit using Cauchy–Schwarz. The same identity holds because is square integrable. Therefore
This proves the projection claim directly: the candidate lies in the closed subspace and its residual is orthogonal to that subspace. Uniqueness is up to almost sure equality, as it must be in .
Pythagoras and least-squares prediction¶
For any , write . Expanding its squared norm and using orthogonality eliminates the cross term:
The first term is independent of . Consequently uniquely minimizes mean squared prediction error over all square-integrable functions of . The theorem concerns a chosen joint law of ; it does not by itself give a procedure for learning an unknown conditional mean from finite data.
Taking also proves . Applying conditional expectation twice changes nothing, so . These are the contraction and idempotence properties of orthogonal projection.
A nonlinear example¶
Let be uniform on and let be independent of with mean zero and variance . Set . Then
This is nonlinear in the observed value, but conditional expectation is still a linear operator on random variables: .
If prediction is restricted to affine functions , symmetry gives , so the best affine predictor is the constant . Since ,
Projecting onto the span of 1 and discards a predictable nonlinear component. Projecting onto retains it.
Vector quantities and total covariance¶
For a finite-dimensional random vector with , apply the scalar result to each component. Writing and gives . Both cross-covariance matrices vanish by the same orthogonality identity. Hence
The second term is positive semidefinite. It measures the variation in remaining after is known. The scalar version is the law of total variance used in the normal-mixture conditioning example.
In ordinary EM, posterior expectations are computed under the current model law. If they are viewed as projections, that law, and therefore the inner product, must be held fixed for the step. A later missing-information calculation will apply total covariance to a joint score after first proving how its marginal score is obtained.
Continue with Fisher geometry, which uses inner products on scores, or return to the Information Geometry hub.