PCA에서 수행 된 단계와 비교하여 요인 분석에서 수행 된 단계


12

PCA (주성분 분석)를 수행하는 방법을 알고 있지만 요인 분석에 사용해야하는 단계를 알고 싶습니다.

PCA를 수행하기 위해 다음과 같은 행렬 고려하십시오 .A

         3     1    -1
         2     4     0
         4    -2    -5
        11    22    20

상관 관계 행렬을 계산했습니다 B = corr(A).

        1.0000    0.9087    0.9250
        0.9087    1.0000    0.9970
        0.9250    0.9970    1.0000

그런 다음 고유 값 분해를 수행 [V,D] = eig(B)하여 고유 벡터를 생성했습니다.

        0.5662    0.8209   -0.0740
        0.5812   -0.4613   -0.6703
        0.5844   -0.3366    0.7383

고유 값 :

        2.8877         0         0
             0    0.1101         0
             0         0    0.0022

1

PCA 단계와 비교하여 요인 분석 단계를 이해하도록 도와주세요.

답변:


24

이 답변은 PCA와 요인 분석의 구체적인 계산 유사점과 차이점을 보여줍니다. 이들 간의 일반적인 이론적 차이점은 질문 / 답변 1 , 2 , 3 , 4 , 5를 참조하십시오 .

아래에서는 단계적으로 홍채 데이터주성분 분석 (PCA) ( "세토 사"종만)을 수행 한 다음 동일한 데이터의 요인 분석을 수행합니다. 요인 분석 (FA) 은 PCA 접근법을 기반으로하는 반복 주축 ( PAF ) 방법 으로 수행 되므로 PCA와 FA를 단계별로 비교할 수 있습니다.

홍채 데이터 (세토 사 만 해당) :

  id  SLength   SWidth  PLength   PWidth species 

   1      5.1      3.5      1.4       .2 setosa 
   2      4.9      3.0      1.4       .2 setosa 
   3      4.7      3.2      1.3       .2 setosa 
   4      4.6      3.1      1.5       .2 setosa 
   5      5.0      3.6      1.4       .2 setosa 
   6      5.4      3.9      1.7       .4 setosa 
   7      4.6      3.4      1.4       .3 setosa 
   8      5.0      3.4      1.5       .2 setosa 
   9      4.4      2.9      1.4       .2 setosa 
  10      4.9      3.1      1.5       .1 setosa 
  11      5.4      3.7      1.5       .2 setosa 
  12      4.8      3.4      1.6       .2 setosa 
  13      4.8      3.0      1.4       .1 setosa 
  14      4.3      3.0      1.1       .1 setosa 
  15      5.8      4.0      1.2       .2 setosa 
  16      5.7      4.4      1.5       .4 setosa 
  17      5.4      3.9      1.3       .4 setosa 
  18      5.1      3.5      1.4       .3 setosa 
  19      5.7      3.8      1.7       .3 setosa 
  20      5.1      3.8      1.5       .3 setosa 
  21      5.4      3.4      1.7       .2 setosa 
  22      5.1      3.7      1.5       .4 setosa 
  23      4.6      3.6      1.0       .2 setosa 
  24      5.1      3.3      1.7       .5 setosa 
  25      4.8      3.4      1.9       .2 setosa 
  26      5.0      3.0      1.6       .2 setosa 
  27      5.0      3.4      1.6       .4 setosa 
  28      5.2      3.5      1.5       .2 setosa 
  29      5.2      3.4      1.4       .2 setosa 
  30      4.7      3.2      1.6       .2 setosa 
  31      4.8      3.1      1.6       .2 setosa 
  32      5.4      3.4      1.5       .4 setosa 
  33      5.2      4.1      1.5       .1 setosa 
  34      5.5      4.2      1.4       .2 setosa 
  35      4.9      3.1      1.5       .2 setosa 
  36      5.0      3.2      1.2       .2 setosa 
  37      5.5      3.5      1.3       .2 setosa 
  38      4.9      3.6      1.4       .1 setosa 
  39      4.4      3.0      1.3       .2 setosa 
  40      5.1      3.4      1.5       .2 setosa 
  41      5.0      3.5      1.3       .3 setosa 
  42      4.5      2.3      1.3       .3 setosa 
  43      4.4      3.2      1.3       .2 setosa 
  44      5.0      3.5      1.6       .6 setosa 
  45      5.1      3.8      1.9       .4 setosa 
  46      4.8      3.0      1.4       .3 setosa 
  47      5.1      3.8      1.6       .2 setosa 
  48      4.6      3.2      1.4       .2 setosa 
  49      5.3      3.7      1.5       .2 setosa 
  50      5.0      3.3      1.4       .2 setosa 

분석에 포함 할 4 개의 숫자 변수가 있습니다 : SLength SWidth PLength PWidth , 분석은 공분산을 기반으로 하므로 중심 변수를 분석하는 것과 같습니다 . (표준화 된 변수를 분석 할 상관 관계 분석을 선택한 경우 상관 관계 기반 분석은 공분산 기반 분석 과 다른 결과를 생성 합니다.) 중심 데이터를 표시하지 않습니다. 이 데이터 매트릭스를 호출 해 봅시다 X.

PCA 단계 :

Step 0. Compute centered variables X and covariance matrix S.

Covariances S (= X'*X/(n-1) matrix: see /stats//a/22520/3277)
.12424898   .09921633   .01635510   .01033061
.09921633   .14368980   .01169796   .00929796
.01635510   .01169796   .03015918   .00606939
.01033061   .00929796   .00606939   .01110612

Step 1.1. Decompose data X or matrix S to get eigenvalues and right eigenvectors.
          You may use svd or eigen decomposition (see /stats//q/79043/3277)

Eigenvalues L (component variances) and the proportion of overall variance explained
           L            Prop
PC1   .2364556901   .7647237023 
PC2   .0369187324   .1193992401 
PC3   .0267963986   .0866624997 
PC4   .0090332606   .0292145579    

Eigenvectors V (cosines of rotation of variables into components)
              PC1           PC2           PC3           PC4
SLength   .6690784044   .5978840102  -.4399627716  -.0360771206 
SWidth    .7341478283  -.6206734170   .2746074698  -.0195502716 
PLength   .0965438987   .4900555922   .8324494972  -.2399012853 
PWidth    .0635635941   .1309379098   .1950675055   .9699296890 

Step 1.2. Decide on the number M of first PCs you want to retain.
          You may decide it now or later on - no difference, because in PCA values of components do not depend on M.
          Let's M=2. So, leave only 2 first eigenvalues and 2 first eigenvector columns.

Step 2. Compute loadings A. May skip if you don't need to interpret PCs anyhow.
Loadings are eigenvectors normalized to respective eigenvalues: A value = V value * sqrt(L value)
Loadings are the covariances between variables and components.

Loadings A
              PC1           PC2           
SLength    .32535081     .11487892
SWidth     .35699193    -.11925773
PLength    .04694612     .09416050
PWidth     .03090888     .02515873

Sums of squares in columns of A are components' variances, the eigenvalues

Standardized (rescaled) loadings.
St. loading is Loading / sqrt(Variable's variance);
these loadings are computed if you analyse covariances, and are suitable for interpretation of PCs
(if you analyse correlations, A are already standardized).
              PC1           PC2      
SLength    .92300804     .32590717
SWidth     .94177127    -.31461076
PLength    .27032731     .54219930
PWidth     .29329327     .23873031

Step 3. Compute component scores (values of PCs).

Regression coefficients B to compute Standardized component scores are: B = A*diag(1/L) = inv(S)*A
B
              PC1           PC2  
SLength   1.375948338   3.111670112 
SWidth    1.509762499  -3.230276923 
PLength    .198540883   2.550480216 
PWidth     .130717448    .681462580 

Standardized component scores (having variances 1) = X*B
      PC1           PC2
  .219719506   -.129560000 
 -.810351411    .863244439 
 -.803442667   -.660192989 
-1.052305574   -.138236265 
  .233100923   -.763754703 
 1.322114762    .413266845 
 -.606159168  -1.294221106 
 -.048997489    .137348703 
  ...

Raw component scores (having variances = eigenvalues) can of course be computed from standardized ones.
In PCA, they are also computed directly as X*V
      PC1           PC2
  .106842367   -.024893980 
 -.394047228    .165865927 
 -.390687734   -.126851118 
 -.511701577   -.026561059 
  .113349309   -.146749722 
  .642900908    .079406116 
 -.294755259   -.248674852 
 -.023825867    .026390520 
  ...

FA (반복 주축 추출 방법) 단계 :

Step 0.1. Compute centered variables X and covariance matrix S.

Step 0.2. Decide on the number of factors M to extract.
          (There exist several well-known methods in help to decide, let's omit mentioning them. Most of them require that you do PCA first.)
          Note that you have to select M before you proceed further because, unlike in PCA, in FA loadings and factor values depend on M.
          Let's M=2.

Step 0.3. Set initial communalities on the diagonal of S.
          Most often quantities called "images" are used as initial communalities (see /stats//a/43224/3277).
          Images are diagonal elements of matrix S-D, where D is diagonal matrix with diagonal = 1 / diagonal of inv(S).
          (If S is correlation matrix, images are the squared multiple correlation coefficients.)

With covariance matrix, image is the squared multiple correlation multiplied by the variable variance.
S with images as initial communalities on the diagonal
.07146025  .09921633  .01635510  .01033061
.09921633  .07946595  .01169796  .00929796
.01635510  .01169796  .00437017  .00606939
.01033061  .00929796  .00606939  .00167624

Step 1. Decompose that modified S to get eigenvalues and right eigenvectors.
        Use eigen decomposition, not svd. (Usually some last eigenvalues will be negative.)

Eigenvalues L
F1   .1782099114
F2   .0062074477
    -.0030958623
    -.0243488794

Eigenvectors V
               F1            F2 
SLength   .6875564132   .0145988554   .0466389510   .7244845480
SWidth    .7122191394   .1808121121  -.0560070806  -.6759542030
PLength   .1154657746  -.7640573143   .6203992617  -.1341224497
PWidth    .0817173855  -.6191205651  -.7808922917  -.0148062006

Leave the first M=2 values in L and columns in V.

Step 2.1. Compute loadings A.
Loadings are eigenvectors normalized to respective eigenvalues: A value = V value * sqrt(L value)
               F1            F2 
SLength   .2902513607   .0011502052
SWidth    .3006627098   .0142457085
PLength   .0487437795  -.0601980567
PWidth    .0344969255  -.0487788732

Step 2.2. Compute row sums of squared loadings. These are updated communalities.
          Reset the diagonal of S to them

S with updated communalities on the diagonal
.08424718  .09921633  .01635510  .01033061
.09921633  .09060101  .01169796  .00929796
.01635510  .01169796  .00599976  .00606939
.01033061  .00929796  .00606939  .00356942

REPEAT Steps 1-2 many times (iterations, say, 25)

Extraction of factors is done.

Final loadings A and communalities (row sums of squares in A).
Loadings are the covariances between variables and factors.
Communality is the degree to what the factors load a variable, it is the "common variance" in the variable.
               F1            F2                        Comm
SLength   .3125767362   .0128306509                .0978688416
SWidth    .3187577564  -.0323523347                .1026531808
PLength   .0476237419   .1034495601                .0129698323
PWidth    .0324478281   .0423861795                .0028494498

Sums of squares in columns of A are factors' variances.

Standardized (rescaled) loadings and communalities.
St. loading is Loading / sqrt(Variable's variance);
these loadings are computed if you analyse covariances, and are suitable for interpretation of Fs
(if you analyse correlations, A are already standardized).
               F1            F2                        Comm
SLength   .8867684574   .0364000747                .7876832626
SWidth    .8409066701  -.0853478652                .7144082859
PLength   .2742292179   .5956880078                .4300458666
PWidth    .3078962532   .4022009053                .2565656710

Step 3. Compute factor scores (values of Fs).
        Unlike component scores in PCA, factor scores are not exact, they are reasonable approximations.
        Several methods of computation exist (/stats//q/126885/3277).
        Here is regressional method which is the same as the one used in PCA.

Regression coefficients B to compute Standardized factor scores are: B = inv(S)*A (original S is used)
B
              F1           F2  
SLength  1.597852081   -.023604439
SWidth   1.070410719   -.637149341
PLength   .212220217   3.157497050
PWidth    .423222047   2.646300951

Standardized factor scores = X*B
These "Standardized factor scores" have variance not 1; the variance of a factor is SSregression of the factor by variables / (n-1).
      F1           F2
  .194641800   -.365588231
 -.660133976   -.042292672
 -.786844270   -.480751358
-1.011226507    .216823430
  .141897664   -.426942721
 1.250472186    .848980006
 -.669003108   -.025440982
 -.050962459    .016236852
  ...

Factors are extracted as orthogonal. And they are.
However, regressionally computed factor scores are not fully uncorrelated.
Covariance matrix between computed factor scores.
      F1      F2
F1   .864   .026
F2   .026   .459

Factor variances are their squared loadings.
You can easily recompute the above "standardized" factor scores to "raw" factor scores having those variances:
raw score = st. score * sqrt(factor variance / st. scores variance).

추출 후 (위 그림 참조) 선택적 회전이 발생할 수 있습니다. FA에서는 회전이 자주 이루어집니다. 때로는 PCA에서 정확히 같은 방식으로 수행됩니다. 회전은 로딩 행렬 A 를 어떤 형태의 "간단한 구조"로 회전시켜 요인의 해석을 크게 촉진합니다 (회전 된 점수를 다시 계산할 수 있음). 회전은 수학적으로 FA를 PCA와 구별하는 것이 아니기 때문에 별도의 큰 주제이므로 다루지 않습니다.


초기 커뮤니티로 "이미지"에 대해 이야기 할 때 다른 초기 답변 (초기 커뮤니티를 선택하는 다양한 방법을 설명)에 대한 링크를 제공하지만 "이미지"는 언급하지 않습니다. 흥미롭게 들립니다. 이전 답변을 확장하고 싶습니까?
amoeba는 Reinstate Monica

그러나 요인 분석 그것은 나를 위해 조금 이상해 보인다, 지금 나는 그것에 대해 생각하고 추측 할 수 없다
dato datuashvili
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.