ALGLIB forum
It is currently Thu Jul 25, 2024 1:52 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 

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.

      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];
  <float>(i, j) = cij;

The result is a matrix whose columns store the same value. For example:
.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.

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 2 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group