I want to produce a scree plot to assess if there is an 'elbow' in the eigenvalues to aid in my identification of the number of PCs to retain. However, upon reading further into the topic, I realised that the eigenvalues are only plotted when the correlation matrix is used and that the log of the eigenvalues is required if the PCA used the covariance matrix.
I'm not entirely clear on the difference between these two, but I used 'pca' in matlab to carry out my analysis and it says on the documentation that the 'latent' output (i.e. the eigenvalues) are 'the eigenvalues of the covariance matrix of X' (X is the data).
I normalised my data using zscore prior to executing pca. Does that make a difference? My ultimate question is: can I use the eigenvalues in my scree plot, or do I have to get the log of them to plot?
pca
in MATLAB uses the SVD of the centred dataset to perform PCA; this excellent thread elucidates the relation between the two. Using the SVD correspond to using the covariance matrix, not the correlation matrix. $\endgroup$cov(zscore(A)) - corr(A)
should be zero to numerical precision... (whereA
is the dataset matrix) $\endgroup$