2013-02-17 47 views
0

隨着prcomp()功能,我估計百分比變化解釋特徵值VS PVE(%的方差解釋)

prcomp(env, scale=TRUE) 

summary(pca)第二列顯示了所有PC這些值:

     PC1 PC2  PC3  PC4  PC5  PC6  PC7 
Standard deviation  7.3712 5.8731 2.04668 1.42385 1.13276 0.79209 0.74043 
Proportion of Variance 0.5488 0.3484 0.04231 0.02048 0.01296 0.00634 0.00554 
Cumulative Proportion 0.5488 0.8972 0.93956 0.96004 0.97300 0.97933 0.98487 

現在我想找到每個PC的特徵值是:

pca$sdev^2 
[1] 5.433409e+01 3.449329e+01 4.188887e+00 2.027337e+00 1.283144e+00 
[6] 6.274083e-01 5.482343e-01 

但是這些值似乎只是PVE本身的替代表示。那麼我在這裏做錯了什麼?

+0

你應該分享給出這個結果的數據。 「PVE本身的替代表示」是什麼意思? – Arun 2013-02-17 20:59:32

+0

Arun:0.5488 * 10大約是5.433。從我看的出版物中,特徵值與PVE似乎沒有那種關係。 – cryptic0 2013-02-17 21:01:19

+0

我的回答是否清除了混淆?每個方向的變化(或變化)由每個特徵值給出。方差的比例正好是每個特徵值與總和的比值。如果這沒有幫助,不知道你在找什麼。 – Arun 2013-02-17 21:17:14

回答

3

我不確定這是否是您的困惑。

pca$sdev^2 -> eigen values -> variance in each direction 
pca$sdev^2/sum(pca$sdev^2) = proportion of variance vector 

所以它們是相關的。

編輯:只是一個例子(說明這種關係),如果這會有所幫助。

set.seed(45) # for reproducibility 
# set a matrix with each column sampled from a normal distribution 
# with same mean but different variances 
m <- matrix(c(rnorm(200,2, 10), rnorm(200,2,10), 
       rnorm(200,2,10), rnorm(200,2,10)), ncol=4) 
pca <- prcomp(m) 

> summary(pca) # note that the variances here equal that of input 
# all columns are independent of each other, so each should explain 
# equal amount of variance (which is the case here). all are ~ 25% 
          PC1  PC2  PC3 PC4 
Standard deviation  10.9431 10.6003 10.1622 9.3200 
Proportion of Variance 0.2836 0.2661 0.2446 0.2057 
Cumulative Proportion 0.2836 0.5497 0.7943 1.0000 

> pca$sdev^2 
# [1] 119.75228 112.36574 103.27063 86.86322 

> pca$sdev^2/sum(pca$sdev^2) 
# [1] 0.2836039 0.2661107 0.2445712 0.2057142 
+0

我明白了。我的困惑主要是因爲我在出版物中查找表格(http://dx.doi.org/10.1111/mec.12043表2)。這裏是第一行: PC 1 Eig 24.27 PVE 51.00 – cryptic0 2013-02-17 21:21:12

+0

首先,你的第一個特徵向量是'54.33' ** NOT **'5.433'。其次,如果它的「24.27」和「51.00%」? 51%是24.27/sum(...)'。這爲什麼關心你? – Arun 2013-02-17 21:24:55

+0

也許[此帖](https://stat.ethz.ch/pipermail/r-help/2005-August/076610.html)另外有幫助。我不認爲有什麼可擔心的。 – Arun 2013-02-17 21:32:03