SVD did not converge (while using in PCA)
Show older comments
I have different train data (15 different matrices) and I am supposed to reduce their dimension from n*t to n*p. (each one individually) I am using matlab 2013 built-in PCA to reduce data dimension, and I use Matlabs' default way to compute eigen vectors (SVD), but I get an error "SVD did not converge" for "just some of train data". for some train data it works well.
also, I wrote my own mfile for PCA and the same error is appeared for some cases.
I really don't know what's the problem and I need you help and comments please.
thanks
Answers (3)
Brian
on 17 Oct 2013
0 votes
I had the same problem and found that it was solved by centering the data.
E.g. pca(data, 'Centered', true, 'NumComponents', numComponents)
it might work if you normalise the features you feed to the pca so that each feature have std=1 across examples (i.e., if your input matrix is M, dim(M) = numex x featdim, then std( M(:,1) ) = 1
However, the problem might still happen. You can try the following whenever you have a crash with the normal pca
"pca( x, 'Algorithm','eig' );"
this uses the "eigenvalue" routine instead of the "svd" routine. But do it just when the normal one crashes, as it is slower
I faced the similar problem: svd did not converge on linux machine, but converge in windows machine. After I replaced the matlab built-in function svd with svdecon from: http://www.mathworks.com/matlabcentral/fileexchange/47132-fast-svd-and-pca The converge problem was gone.
You may try to use this file, may be it can solve your problem too.
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!