Calculates the covariance matrix of an array.
COVM(a)
a |
- |
An array. |
An array.
a = {{1.00, 3.00, 2.20},
{1.10, 4.00, 2.40},
{1.20, 5.00, 2.60}}
b = covm(a)
b == {{0.01, 0.10, 0.02},
{0.10, 1.00, 0.20},
{0.02, 0.20, 0.04}}
c = diag(sqrt(b))
d = colstdev(a)'
c == d
The mean is removed from each column before the covariance is computed. The standard deviations of each column can be calculated by:
diag(sqrt(covm(a)))
See ACOV to compute the auto-covariance of a series.
See XCOV to compute the cross-covariance of two series.