Canonical: https://knowlpedia.com/probability/covariance-matrix/

# Covariance matrix

The matrix of centered pairwise products of a random vector with finite second moment.

For a random vector \(X=(X_1,\ldots,X_d)\) with finite second moment, its **covariance matrix** is
\[
\operatorname{Cov}(X)=\mathbb E[(X-\mathbb EX)(X-\mathbb EX)^T].
\]
Its \((i,j)\) entry is the scalar [covariance](https://knowlpedia.com/probability/covariance/) \(\operatorname{Cov}(X_i,X_j)\). Equivalently, it is \(\mathbb E[XX^T]-(\mathbb EX)(\mathbb EX)^T\).

## Positivity and degeneracy

For every \(a\), \(a^T\operatorname{Cov}(X)a=\operatorname{Var}(a\cdot X)\ge0\). It is positive definite precisely when no nonzero linear combination \(a\cdot X\) is almost surely constant. The deterministic choice of a probability average on a torus gives the same matrix construction for a periodic vector field.

## Velocity fluctuations

[Reynolds averaging stress](https://knowlpedia.com/fluid-dynamics/reynolds-averaging-stress/) is the covariance matrix of a fluctuating velocity. Its sign in a momentum equation depends on which side contains the tensor divergence.
