LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SVD Factorization BUG?

Comparing the SVD factorization Block in Labview and the svd function implemented in Matlab 6.5, I noticed that for the same matrix input the last resulting columns of the U and V matrix have the opposite sign.
Is it a bug of the factorization?
0 Kudos
Message 1 of 7
(2,816 Views)
Have you tried to create the original matrix from the components? These may be two different but valid answers. The help for svd factorization states:


SVD produces three matrices U,, and V so that
where U and are orthogonal matrices, is an n-by-n diagonal matrix with the elements of array S on the diagonal in decreasing order.

Where A=U*Ssubo*Vtranspose.
0 Kudos
Message 2 of 7
(2,814 Views)
Today morning i tried to make reobtain the original matrix input from both the kind of factorization and of course there is no kind of error.
Bytheway, if you use the SVD in PCA analysis to calculate the loading and scores, you obtain the equivalent "meaning" but with different numbers.
I was concearning about which kind of algorhymt was used for implementation.
0 Kudos
Message 3 of 7
(2,814 Views)
I did not realize that SVD was used in PCA.
I think that you are right on the money about the algorithms being different. I would not know what algorithm is used in LabVIEW. You might see if "numerical recipes for c" addresses the issue and then compare the results of that algorithm to LabVIEW. Remember this does not guarantee that the algorithms are really the same.
0 Kudos
Message 4 of 7
(2,814 Views)
I'm finishing to implement step-by-step the pca procedure of matlab in labview exaclty to compare the final results and see what is the real difference. Further on the way to pass from one kind of matrix to the other it is quite simple(just multiply for a diagonal identity matrix with the last element -1).
But obviously introduces some more machine time and memory consuming for big dimensions.
I will update this issues as soon.
PS: numerical receipe for c ... you mean pca?
0 Kudos
Message 5 of 7
(2,814 Views)
I was refering to the possiblity of a svd algorithm in numerical receipe in C. There have be a couple of people in the last year that have been looking for PCA VIs. Posting you finished VIs would be well appreciated. You can do it on NI's site or here or at a non-NI but still LabVIEW site.
0 Kudos
Message 6 of 7
(2,814 Views)
not only the last resulting columns change the sign, other columns also.
0 Kudos
Message 7 of 7
(2,746 Views)