armadillo cov function doesn't work

110 views Asked by At

I am not sure what is the problem, I have a matrix define as:

int N  = 52;
mat y(N, 2);

//  some operation
y(0, 0) = ...;
y(0, 1) = ...;
y(1, 0) = ...;
......
y(51, 1) = ...;

cout << cov(y) << endl;

The operations are very basic ones and I can print y, Then I get the result

Intel MKL ERROR: Parameter 7 was incorrect on entry to DSYRK .
  -5.5368  -0.2230
  -0.2230  -0.0090

There is negative elements on the diagonal.

With the same data, I copy the y I printed to MATLAB and use matlab cov function and I get the result

 0.0232   -0.0062
-0.0062    0.0078

Have no idea what happened behind the cov function in armadillo.

Thanks beforehand.

0

There are 0 answers