Perform principal component analysis on the nxn covariance matrix X
The following code
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)
Produces the following output
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
Package: statistics