Ignore:
Timestamp:
Jul 27, 2018, 2:27:02 AM (4 years ago)
Author:
Peter
Message:

add function calculating correlation matrix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/statistics.cc

    r3550 r3745  
    5050void test_benjamini_hochberg(test::Suite&);
    5151void test_benjamini_hochberg_unsorted(test::Suite&);
     52void test_correlation(test::Suite& suite);
    5253void test_entropy(test::Suite&);
    5354void test_mad(test::Suite&);
     
    142143  test_median_empty(suite);
    143144  test_mutual_information(suite);
     145  test_correlation(suite);
    144146  return suite.return_value();
     147}
     148
     149
     150void test_correlation(test::Suite& suite)
     151{
     152  utility::Matrix x(10,100);
     153  utility::Matrix C = statistics::correlation(x);
     154  if (!suite.equal(C(0,0), 1.0)) {
     155    suite.add(false);
     156    suite.err() << "correlation element(0, 0) not unity\n";
     157  }
    145158}
    146159
Note: See TracChangeset for help on using the changeset viewer.