A covariance matrix describes how the components of a random vector vary together. Its diagonal holds variances. Each off-diagonal entry is the covariance between a pair of components.
Definition and properties
For a column vector \(X\) with mean \(\mu\):
\[\Sigma=\operatorname E[(X-\mu)(X-\mu)^\mathsf T],\qquad \Sigma_{ij}=\operatorname{Cov}(X_i,X_j).\]The multiplication order matters: the centered column times its transpose is an outer product. Reversing the order produces a scalar. The matrix is symmetric and positive semidefinite because \(z^\mathsf T\Sigma z=\operatorname{Var}(z^\mathsf T X)\geq 0\).
Estimating covariance from samples
For \(N\) independent observations drawn from the same distribution with finite second moments, the usual unbiased estimator is:
\[\hat\Sigma=\frac{1}{N-1}\sum_{i=1}^N(x_i-\bar x)(x_i-\bar x)^\mathsf T.\]With centered observations, the sample covariance rank is at most \(N-1\). Even a large sample can yield a singular matrix if some channels are redundant. Use the R estimator to inspect a sample covariance.
Applications
- PCA uses covariance eigenvectors to identify directions of greatest variation.
- Linear discriminant analysis compares variability within and between classes.
- Covariance diagnostics can flag redundant measurements. Use correlation if you need a unitless comparison; zero covariance does not in general imply independence.


