Principle Component Analysis (PCA) bi-plot vector magnitude

3 ビュー (過去 30 日間)
James
James 2014 年 8 月 7 日
コメント済み: Ahmet Cecen 2014 年 8 月 8 日
Hi,
I am trying to project data from five dimensions onto two dimensions in order to help with visualization. I am able to successfully create a 2D PCA plot using the pca command. Moreover, I am able to capture a good chunk of the variance (~90%) with two components.
However, I noticed that the coefficient matrix generated when using the pca function (or princomp) yields a matrix of coefficients (p by n where p is the number of variables and n is the number of principle components of interest) with values that are all between -1 and 1.
With this in mind, I was wondering how best to graphically project each variable [vector in higher dimension] onto the 2D PCA space? or is this simply what a bi-plot of PCA coefficients does? If so, how do I obtain PCA coefficients which are not restricted to between -1 and 1 (i.e. not scaled, but show their true magnitudes).
JTC

採用された回答

Ahmet Cecen
Ahmet Cecen 2014 年 8 月 8 日
編集済み: Ahmet Cecen 2014 年 8 月 8 日
I am not sure how princomp works, but here is a quick way to do this.
1) mean center your data, meaning subtract the mean across all data points across each dimension from each dimension.
2) [U,S,V]=svd(Data,0);
3) Assuming your dimensions are across columns (meaning your data point are row vectors), PCA weights are U*S, your variance vector is diag(S^2), your PCA vectors are S*V'.
Your results wont be normalized in any way, but they will be centered, and that is desirable in most cases.
  2 件のコメント
James
James 2014 年 8 月 8 日
編集済み: James 2014 年 8 月 8 日
Thanks! I've accepted your answer. After reviewing the algebra, it occurred to me that the PCA vectors should actually be V*S'. Let me know if you agree or disagree.
Ahmet Cecen
Ahmet Cecen 2014 年 8 月 8 日
Nope, actually it is just V'. S is a diagonal scaling matrix and redundant in finding the PCA vectors, my bad. Check this for a some of the easier explanations I have seen. Go down to the "relation to principal component analysis" section.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by