forum.alglib.net

ALGLIB forum
It is currently Tue Dec 10, 2024 3:03 am

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.



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: covm returns a matrix that is not symmetric
PostPosted: Mon Mar 30, 2020 6:10 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group