Computes the covariance matrix of the input sequence X.


icon

Inputs/Outputs

  • c2ddbl.png 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.

  • i2ddbl.png 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.

  • i1ddbl.png 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