0

関数を使用prcomp()して、推定パーセント分散を説明しました

prcomp(env, scale=TRUE)

の 2 列目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 自体の単なる代替表現のように見えます。それで、私はここで何が間違っていますか?

4

1 に答える 1

5

これがあなたの混乱であるかどうかはわかりません。

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
于 2013-02-17T21:08:53.810 に答える