How to related PCA output to the original data?
8 次查看(过去 30 天)
显示 更早的评论
Hello,
I'm new to PCA and I would like to learn the outcome of pca function. I have read the document and checked others works but I'm a bit confused on how to related the results (wcoeff, latent, explained) to the original data. For example, I'm using the example from the document as below. I understand the (wcoeff) presents the eigenvector vectors. the (latent) presents the eigenvalues. the (explained) is the percentage of the total variance explained by each principal component. NOW, how are all these information are related to the main data which is the ingredients here? how do I know from looking at the results in (explained) that the 55 % is related to which variables or columns in the ingredients matrix?
load hald
[wcoeff,~,latent,~,exp
lained] = pca(ingredients,'VariableWeights','variance')
wcoeff = 4×4
-2.7998 2.9940 -3.9736 1.4180
-8.7743 -6.4411 4.8927 9.9863
2.5240 -3.8749 -4.0845 1.7196
9.1714 7.5529 3.2710 11.3273
latent = 4×1
2.2357
1.5761
0.1866
0.0016
explained = 4×1
55.8926
39.4017
4.6652
0.0406
16 个评论
Paul Gershon
2023-11-20
Is the answer to square all numbers in the coeff matrix and then do the division for relative contribution? For example:
PC1 PC2
var1: -2 0.3
var2: 5 3.8
Square it:
PC1 PC2
var1: 4 0.09
var2: 25 14.4
Now relative contribution of var2 to PC1 = 25/4? or is it 25/29? (the denominator is the sum for the column)?
Thanks!
Paul Gershon
2023-11-20
..Or is the answer not to square the coefficients, but simply to take absolute values because sign simply shows whether the point is pushed negative on the PC axis by the sign of the coefficient, but the sign is irrelevant to magnitude of contribution?
Thanks!
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!