Covariances and covariance matrices #
Covariance is unchanged by almost-everywhere changes to either observable. This file also
packages the coordinate covariances of a measure on a finite-dimensional Euclidean space as a
matrix and connects that matrix to Mathlib's basis-free covarianceBilin.
The MemLp id 2 μ hypothesis in the comparison theorem is essential. Mathlib deliberately sets
covarianceBilin μ to zero when this hypothesis fails, whereas its scalar covariance is
totalized coordinate by coordinate.
Main results #
TauCeti.covMatrixis the matrix of coordinate covariances of a measure.TauCeti.covarianceBilin_eq_covMatrixidentifies the matrix and bilinear-form views of covariance when the measure has a finite second moment.TauCeti.posSemidef_covMatrixproves that covariance matrices are positive semidefinite under the same moment hypotheses.TauCeti.integral_inner_toEuclideanLin_sub_integral_eq_trace_mul_covMatrixcomputes the mean of a quadratic form of the centred variable as a trace against the covariance matrix.TauCeti.integral_inner_toEuclideanLin_sub_integral_eq_trace_mul_covMatrix_mapis the same identity for a square-integrable random vector and the covariance matrix of its law.TauCeti.integral_norm_sub_sq_eq_norm_integral_sub_sq_add_trace_covMatrixdecomposes the second moment about a point into the squared distance from the mean to that point and the trace of the covariance matrix.TauCeti.covarianceBilin_eq_smul_innerSLshows that a law invariant under every linear isometry has covariance equal to its second moment divided by the dimension, times the inner product.
References #
- Roadmap:
TauCetiRoadmap/StandardDistributions/README.md, Layer 5, item 1, Covariance matrices.
Covariance is unchanged by almost-everywhere changes to either observable.
The covariance matrix of a measure on a finite-dimensional Euclidean space. Its (i, j)
entry is the scalar covariance of the ith and jth coordinate projections.
Instances For
An entry of covMatrix is the covariance of the corresponding coordinate projections.
Covariance matrices are symmetric.
A covariance matrix is Hermitian (equivalently, symmetric over ℝ).
For a finite measure with finite second moment, the entrywise covariance matrix represents Mathlib's basis-free covariance bilinear form.
The covariance matrix of a finite measure with finite second moment is positive semidefinite.
The mean of the quadratic form of a matrix B on the centred variable of a Euclidean-valued
probability measure with finite second moment is the trace of B times the covariance matrix.
The mean of the quadratic form of a matrix B on the centred variable of a square-integrable
Euclidean-valued random vector X is the trace of B times the covariance matrix of the law of
X.
The second moment of a Euclidean-valued probability measure about a point c is the squared
distance from its mean to c plus the trace of its covariance matrix.
Covariance of an isotropic law. A finite measure on a finite-dimensional real inner product space that is invariant under every linear isometry has covariance a multiple of the inner product, the multiple being the second moment divided by the dimension. No moment hypothesis is needed: without a finite second moment both sides vanish.