|covm returns a matrix that is not symmetric
|Page 1 of 1|
|Author:||jdb [ Mon Mar 30, 2020 6:10 pm ]|
|Post subject:||covm returns a matrix that is not symmetric|
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.
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:
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.
|Page 1 of 1||All times are UTC|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group