Function Reference: pcacov

statistics: COEFF = pcacov(X)
statistics: [COEFF, latent] = pcacov(X)
statistics: [COEFF, latent, explained] = pcacov(X)

Perform principal component analysis on the NxN covariance matrix X.

  • COEFF : a NxN matrix with columns containing the principal component coefficients
  • latent : a vector containing the principal component variances
  • explained : a vector containing the percentage of the total variance explained by each principal component

References

  1. Jolliffe, I. T., Principal Component Analysis, 2nd Edition, Springer, 2002

Source Code: pcacov

Example: 1

 

 X = [ 7    26     6    60;
       1    29    15    52;
      11    56     8    20;
      11    31     8    47;
       7    52     6    33;
      11    55     9    22;
       3    71    17     6;
       1    31    22    44;
       2    54    18    22;
      21    47     4    26;
       1    40    23    34;
      11    66     9    12;
      10    68     8    12
     ];
 covx = cov(X);
 [COEFF,latent,explained] = pcacov(covx)

COEFF =

  -0.067800   0.646018  -0.567315   0.506180
  -0.678516   0.019993   0.543969   0.493268
   0.029021  -0.755310  -0.403553   0.515567
   0.730874   0.108480   0.468398   0.484416

latent =

   517.7969
    67.4964
    12.4054
     0.2372

explained =

   8.6597e+01
   1.1288e+01
   2.0747e+00
   3.9662e-02