# forum.alglib.net

ALGLIB forum
 It is currently Wed Aug 10, 2022 5:29 pm

 All times are UTC

### Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: covm returns a matrix that is not symmetricPosted: Mon Mar 30, 2020 6:10 pm

Joined: Mon Mar 30, 2020 6:05 pm
Posts: 1
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.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot] and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for: