Is it Necessary to De-Mean my Data before Applying PCA, or does pca(X) do that Automatically?

6 ビュー (過去 30 日間)
I am aware that a first step in performing PCA for dimensionality reduction is de-meaning the data.
I have performed PCA after de-meaning manually with X=X-mean(X) and compared with plainly applying [COEFF,score,latent,~,explained]=pca(X) on my data.
By inspecting the eigenvalues and the percentage of variability described by each PC on both cases (i.e. latent and explained in the above case), I can see that I get two different results. Is manual de-meaning doing too much in this case?

採用された回答

the cyclist
the cyclist 2018 年 11 月 15 日
編集済み: the cyclist 2018 年 11 月 15 日
MATLAB's pca functions definitely de-means. It should make no meaningful difference if you de-mean ahead.
Are you sure you are de-meaning along the correct dimension? You should only de-mean along dimension 1 of your input.
Are you sure you're getting different output, beyond perhaps some floating-point differences (on the order of 1e-15) smaller than the results?
  1 件のコメント
Nikitas Provatakis
Nikitas Provatakis 2018 年 11 月 19 日
Thanks for your input. It turns out I was de-meaning along dimension 2 and that didn't exactly help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by