help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[U,S,V=svd() : V not orthonormal, and matrix mpy bug


From: stuart macgregor
Subject: [U,S,V=svd() : V not orthonormal, and matrix mpy bug
Date: Sat, 2 May 2020 01:11:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Am I missing something? I expected both U and V to be orthonormal.

Using Octave 5.2.0 (installed via flatpack, which fixed an earlier problem vs regular install)

Octave was configured for "x86_64-pc-linux-gnu".

Running Ubuntu 19.10 on Intel Core I9-9820X with Gnome34.2 64 bit, regularly updated.

The Matrix MLD is real.

>> [U,S,V]=svd(MLD,'econ'); >> size(U) ans =    36   36 >> U(:,1:4)'*U(:,1:4) ans =    1.0000e+00  -3.8510e-17  -1.0754e-16  -1.0355e-16   -3.8510e-17   1.0000e+00   7.3062e-18  -1.8824e-16   -1.0754e-16   7.3062e-18   1.0000e+00   6.6542e-17   -1.0355e-16  -1.8824e-16   6.6542e-17   1.0000e+00 >> V(:,1:4)'*V(:,1:4) ans =    1.9966201  -0.0022979   0.0052995   0.0075676   -0.0022979   1.9862628   0.0194220   0.0103522    0.0052995   0.0194220   1.9644382  -0.0056048    0.0075676   0.0103522  -0.0056048   1.9275569 >> diag(S(1:4,1:4)) ans =    3.766173    0.690411    0.263197    0.092771 >> size(MLD) ans =     36   295 >>

I also found a matrix multiply oddity:

>> B(:,2:8)'*B(:,2:8) ans = 1.0000e+00 2.7756e-17 -1.4919e-16 4.1633e-17 -2.1467e-17 3.4694e-17 -1.0408e-17 2.7756e-17 1.0000e+00 6.9389e-18 -2.0817e-16 2.7756e-17 -2.7756e-17 -1.7347e-18 -1.4919e-16 6.9389e-18 1.0000e+00 2.3592e-16 -6.9389e-17 -1.1709e-17 -2.7756e-17 4.1633e-17 -2.0817e-16 2.3592e-16 1.0000e+00 -2.6368e-16 1.4225e-16 -6.9389e-17 -2.1467e-17 2.7756e-17 -6.9389e-17 -2.6368e-16 1.0000e+00 1.2837e-16 8.3267e-17 3.4694e-17 -2.7756e-17 -1.1709e-17 1.4225e-16 1.2837e-16 1.0000e+00 2.4980e-16 -1.0408e-17 -1.7347e-18 -2.7756e-17 -6.9389e-17 8.3267e-17 2.4980e-16 1.0000e+00 >> B(:,1:8)'*B(:,1:8) ans = 0.4818556 0.1625315 -0.1614122 0.1034121 -0.1437415 -0.0224212 0.0613405 -0.0761984 0.1625315 0.3871704 -0.2118523 0.1128191 0.0150783 0.1026268 -0.0099027 0.0190180 -0.1614122 -0.2118523 0.2683112 0.0359601 0.0880460 0.0450180 0.0673382 0.0484130 0.1034121 0.1128191 0.0359601 0.1390827 0.0393239 -0.0328826 0.0326014 -0.0616807 -0.1437415 0.0150783 0.0880460 0.0393239 0.1017367 0.0868841 -0.0163814 -0.0592729 -0.0224212 0.1026268 0.0450180 -0.0328826 0.0868841 0.1351116 0.0356768 0.0187677 0.0613405 -0.0099027 0.0673382 0.0326014 -0.0163814 0.0356768 0.1817737 -0.0215152 -0.0761984 0.0190180 0.0484130 -0.0616807 -0.0592729 0.0187677 -0.0215152 -0.0428795


reply via email to

[Prev in Thread] Current Thread [Next in Thread]