我用matlab和numpy分别计算一个矩阵的协方差矩阵的svd
协方差矩阵C如下:
[[ 0.0234 -0.0163 0.0365 -0.0128 -0.02 -0.0035]
[-0.0163 0.015 -0.036 0.0237 0.0226 0.0131]
[ 0.0365 -0.036 0.0879 -0.0631 -0.0565 -0.0366]
[-0.0128 0.0237 -0.0631 0.0667 0.0461 0.045 ]
[-0.02 0.0226 -0.0565 0.0461 0.0378 0.0284]
[-0.0035 0.0131 -0.0366 0.045 0.0284 0.0316]]
matlab 我用的是[S,V,D]=svd(C) 得到的左奇异值矩阵是:
-0.2092 -0.5972 0.7307 0.0138 0.1771 0.1845
0.2425 0.2147 -0.0333 -0.0530 0.1885 0.9250
-0.6097 -0.3457 -0.5817 -0.0897 0.3789 0.1368
0.5077 -0.4820 -0.2040 -0.6779 -0.0777 -0.0516
0.4103 0.0314 0.0042 0.2079 0.8437 -0.2748
0.3154 -0.4944 -0.2914 0.6973 -0.2675 0.1161
python下用的是 S,V,D = np.linalg.svd(C) 得到的左奇异值矩阵是:
[[-0.20921514 -0.59749956 0.76524853 0.01523281 -0.07740799 -0.0859881 ]
[ 0.24275938 0.21484707 0.18670492 -0.30492966 -0.83214763 0.27312655]
[-0.6097302 -0.34474984 -0.46282739 -0.47710968 -0.23340079 -0.11427101]
[ 0.50780692 -0.48229673 -0.32809901 0.28313025 -0.30970581 -0.4751764 ]
[ 0.41021901 0.03258051 0.14509198 -0.76032239 0.3218534 -0.35766946]
[ 0.31524355 -0.49427819 -0.19137955 -0.14456604 0.21807131 0.74244866]]
计算结果前两列还比较接近,后面几列就越差越大了,请问有没有知道为什么?