Hello, I started to use Matlab's built in PCA on a large data set in terms of variables (around 70 Observations but 100,000 variables in matrix M).
Using standard PCA I get results (N-1 PC's).
[coeff,scores,latent,~,explained] = pca(M);
When I run weighted PCA on the same data
[wcoeff,scores,latent,~,explained] = pca(M,'VariableWeights','variance');
I get the following error message:
Error using svdInput to SVD must not contain NaN or Inf.Error in pca>localSVD (line 477) [U,sigma,coeff] = svd(x,'econ');Error in pca (line 347) [U,sigma, coeff, wasNaN] = localSVD(x, n,...Error in ScriptA (line 62) [wcoeff,scores,latent,~,explained] = pca(M,'VariableWeights','variance');
What am I doing wrong? Or what is the problem with matrix M that I need to resolve? Thank you, Daniel
Best Answer