You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Found a test case where numeric.svd returns an incorrect decomposition #62
//tested with numeric.js version 1.2.6
var countsMatrix = [[0,0,1,1,0,0,0,0,0],[0,0,0,0,0,1,0,0,1],[0,1,0,0,0,0,0,1,0],[0,0,0,0,0,0,1,0,1],[1,0,0,0,0,1,0,0,0],[1,1,1,1,1,1,1,1,1],[1,0,1,0,0,0,0,0,0],[0,0,0,0,0,0,1,0,1],[0,0,0,0,0,2,0,0,1],[1,0,1,0,0,0,0,1,0],[0,0,0,1,1,0,0,0,0]];
var svd = numeric.svd(countsMatrix);
var U = svd.U;
var UTranspose = numeric.transpose(U);
//U should be a unitary matrix, so transpose(U) * U should be the identity matrix:
//http://web.mit.edu/be.400/www/SVD/Singular_Value_Decomposition.htm
var shouldBeIdentity = numeric['*'](UTranspose, U);
//However, it isn't the identity matrix:
console.log(JSON.stringify(shouldBeIdentity));
Activity
valette commentedon Jan 6, 2016
Same here:
svd works fine on this matrix:
M = [
[5, 0, 0],
[0, 1, 0],
[ 0, 0, 1]
]
https://jsfiddle.net/bwrkerqv/
but fails on that one (which is the same with switched columns/rows):
M = [
[1, 0, 0],
[0, 1, 0],
[ 0, 0, 5]
]
https://jsfiddle.net/vyvj1o9f/