pca: missing first pc
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello community,
using the pca function i face the following problem: i have a data set X of 1000 observations (rows) and a little less variables (columns). The data consists of linear combinations of only two vectors.
if i compute pca(X) i find the coordinates of the second pc in coeff(:,1). The first one is missing.
if i compute pca(X') if find the coordinates of both in coeff(:,1) and coeff(:,2), where coeff(:,2) is equal to coeff(:,1) of pca(X).
best regards and thanks in advance Raphael
2 commentaires
Image Analyst
le 9 Août 2015
Show us. Make up a 2D matrix X and demonstrate what you say. It's hard to give you a specific fix for your problem when your problem statement is not specific.
Réponse acceptée
Sagar
le 9 Août 2015
Your question is not clear, pca(X) will give coefficient matrix whose first column represents coefficients of the first principal component and so on. You cannot do pca(X') because pca understands rows as observations and columns as variables.
3 commentaires
Sagar
le 9 Août 2015
First be sure to put variables in the columns and observations in the rows. After this, if you do pca, the first column of the COEFF matrix represents the first principal component and so on. The no. of principal components will be equal to the number of variables. I don't understand what you mean by "why i found the the second pc as the first column of the scores if i use my data in the wrong way".
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Dimensionality Reduction and Feature Extraction dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!