Definition

The covariance matrix is a square matrix that summarizes the pairwise covariances between the components of a random vector. For a random vector , the covariance matrix is defined as:

Each entry represents the covariance between and :

Key Properties

  1. Symmetry:
    The covariance matrix is Symmetric Matrix:

  2. Diagonal Elements:
    The diagonal elements represent the variances of the individual components:

  3. Positive Semidefiniteness:
    The covariance matrix is Positive Semi-Definite Matrix:

  4. Dimension:
    If is an -dimensional random vector, then is an matrix.

Examples

Univariate Example:

For a single random variable , the covariance matrix is:

Multivariate Example:

For , where , the covariance matrix is:

Data Matrix Representation:

For a dataset , where rows are observations and columns are variables, the sample covariance matrix is:

where is the row-wise mean of .