8. Average with unequal weights
All examples · Glossary: conditional expectation · Papers, proofs, Lean, and code
Take three real values \(x=(2,6,9)^{\mathsf T}\), with positive weights \(w=(1,3,2)\). Group the first two positions together and leave the third alone. We want a value that is constant within each group.
Compute each group's mean
The first group's weighted mean is
The second group has only the value 9. The averaged vector is therefore
Normalizing all weights by their total, six, would give the same group means. This is finite conditional expectation with respect to the chosen partition.
Average again
The first group now contains two copies of five. Its mean remains \((1\cdot5+3\cdot5)/4=5\). The third coordinate also stays fixed.
More generally, \(E\) fixes every vector of the form \((a,a,b)^{\mathsf T}\), and every output of \(E\) has that form. Hence \(E^2=E\).
Measure the residual using the stated weights
The residual is
Use the weighted inner product
For every group-constant vector \(y=(a,a,b)^{\mathsf T}\),
The residual is orthogonal to the retained subspace in this inner product. The matrix \(E\) is not symmetric in ordinary coordinates, so the choice of inner product matters.
Check the squared lengths
As expected from orthogonality, \(274=262+12\).
Try it
Use equal weights \((1,1,1)\) with the same input and partition.
Answer: The averaged vector is \((4,4,9)^{\mathsf T}\) and the residual is \((-2,2,0)^{\mathsf T}\). The ordinary squared lengths satisfy \(121=113+8\).
Continue reading: Inner product, norm, and finite projection operations. This calculation assumes known positive weights and a fixed finite partition. It does not estimate either from data.
Papers, proofs, Lean, and code
Terms in this example: Finite conditional expectation · Inner product · Orthogonal projector · Residual
Paper VI includes stochastic and Bayesian realizations. Its assumptions extend beyond this finite partition.
Paper VI: Transfer Semigroups: Stochastic, Bayesian, Fractional, and PDE Realizations
Read · Written proofs · Lean coverage · Code and setup · Evidence
Related library guide and code examples. The guide covers related constructions and their software interfaces.
Python arithmetic check for this example: weighted_averages(). This checks the displayed rational, modular or finite-set calculations exactly.
The Lean links open each work’s recorded coverage and sources. They do not certify this tutorial. A work may have limited coverage or no linked Lean or code. Its page states what is available.