我不确定是什么问题,我有一个矩阵定义为:
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;
操作非常基本,我可以打印y
,然后我得到结果
Intel MKL ERROR: Parameter 7 was incorrect on entry to DSYRK .
-5.5368 -0.2230
-0.2230 -0.0090
对角线上有负面元素。
使用相同的数据,我将我打印的y
复制到MATLAB并使用matlab cov
函数,我得到结果
0.0232 -0.0062
-0.0062 0.0078
不知道犰狳cov
功能背后发生了什么。
事先谢谢。