Covariance Matrix VI
- Updated2025-07-30
- 2 minute(s) read
Computes the covariance matrix of the input sequence X.

Inputs/Outputs
X
—
X is the input sequence. Each column of X represents one vector of observed samples from one variable. Each row of X represents an observation from each variable.
covariance matrix V
—
covariance matrix V returns the covariance matrix of X. If X is an n-by-m 2D array, then the covariance matrix is a square m-by-m matrix.
mean vector
—
mean vector returns the mean of each column variable in X. |
Given m vectors of observed samples where the ith column contains the variate xi, the covariance matrix is defined as:
Vij = cov(xi, xj) = (xi – µi)(xj – µj)where µi is the mean of variate xi. Each element Vij of covariance matrix V is the covariance between variates xi and xj. The diagonal of covariance matrix V contains the standard variances of each xi variate.
mean vector returns the computed mean of each variate as shown by the following equation:
mean vectori = µi
X
—
covariance matrix V
—
mean vector
—