Hi there,
I am trying to use the alglib "covm" function to find the covariance matrix for some data but the results of the covm function are not symmetric.
In the following code block 'x' stores the data, 'c' stores the covariance matrix and dim is the dimension of an observation in x.
Code:
covm(x, c);
covariance = cv::Mat_<float>(dim, dim);
for (int i = 0; i < dim; i++)
{
for (int j = 0; j < dim; j++)
{
float cij = *c[i, j];
covariance.at<float>(i, j) = cij;
}
}
The result is a matrix whose columns store the same value. For example:
Code:
.0096 .0149
.0096 .0149
Shouldn't the results be a symmetric matrix with these values? I think I must be making a newbie mistake somewhere. Thank you for your help and time.