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
//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));
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: