Be the first to rate this file! 36 downloads (last 30 days) File Size: 2.16 KB File ID: #22118

Sign correction in SVD and PCA

by Rasmus Bro

 

16 Nov 2008

Code covered by BSD License  

Determines the right sign of the singular vectors in SVD (score- and loading vectors in PCA)

Download Now | Watch this File

File Information
Description

Although the Singular Value Decomposition (SVD) and eigenvalue decomposition (EVD) are well-established and can be computed via state-of-the-art algorithms, it is not commonly mentioned that there is an intrinsic sign indeterminacy that can significantly impact the conclusions and interpretations drawn from their results. We provide a solution to the sign ambiguity problem by determining the sign of the singular vector from the sign of the inner product of the singular vector and the individual data vectors. The data vectors may have different orientation but it makes intuitive as well as practical sense to choose the direction in which the majority of the vectors point. This can be found by assessing the sign of the sum of the signed inner products.

More info at: R. Bro, E. Acar, and T. G. Kolda. Resolving the sign ambiguity in the singular value decomposition. J.Chemom. 22:135-140, 2008 and at www.models.life.ku.dk

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
03 Feb 2009 Wolfgang

Hallo,

this is exactly what i was looking for. Sadly i get this message:

??? Cell contents reference from a non-cell array object.

Error in ==> sign_flip at 23
  F(i) = size(loads{i},2);

05 Feb 2009 Rasmus Bro

If you look in the help file, you will see that you have to input the 'whole' SVD in order to perform the sign_flip. So you have to do the following

[u,s,v]=svd(X);

loads{1}=u*s;
loads{2}=v;

and then you input loads instead of u. Then it should work.

09 Sep 2009 Admiral

Was wondering if you could provide some guidance on how to use this with princomp? Am also trying to get some help on interpreting the results. Any/all info greatly appreciated. Thanks.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
svd Cristina McIntire 17 Nov 2008 11:27:30
evd Cristina McIntire 17 Nov 2008 11:27:30
chemometrics Rasmus Bro 17 Nov 2008 11:27:50
datamining Rasmus Bro 17 Nov 2008 11:27:50
pca Rasmus Bro 17 Nov 2008 11:27:50
evd Evrim Acar 18 Feb 2009 19:43:04
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com