Centering data in PCA - PC1 does not pass through 0

2 visualizaciones (últimos 30 días)
I've a question regarding the pca function. I'm using it on a [28x79] matrix and the resulting principal component coefficients are confusing me somewhat. According to the documentation, pca centers the column data by subtracting the mean. However, when I plot the coordinates of the coefficients of principal components 1-3 in state space (i.e x-axis contains principal component 1 (PC1), y-axis contains principal component 2 (PC2), z-axis contains principal component 3 (PC3), principal component 1 does not pass through 0. Instead the typical range is somewhere between [0.05 2]. Could you explain this? PC2 and PC3 behave as I would expect after centering, in that their range contains 0.
Thank you for your help.

Respuesta aceptada

Darshan Ramakant Bhat
Darshan Ramakant Bhat el 6 de Mzo. de 2017
I think you are mixing up something. The pca() documentation says " by default, pca centers the data and uses the singular value decomposition (SVD) algorithm". This means when you do _coeff = pca(X), the data X will be centered. That means the function will preprocess the data ' X' by subtracting the means from from its column.It is equivalent to doing
[m n]=size(X);
X_processed=zeros(m,n)
for i=1:n
X_processed(:,i)=X(:,i)-mean(X(:,i));
end
This is nothing to do with PCA coefficients, this can vary from any range. Try pca() function with X and X_processed, ideally you should get the same result.
I hope this answer will help you.
Regards
Darshan Bhat

Más respuestas (0)

Categorías

Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by