Principal Component Analysis Reconstructing Centred Data

3 views (last 30 days)
Hi, I have the following dataset which I have performed PCA on:
DATASET =
10.0000 6.0000
11.0000 4.0000
8.0000 5.0000
3.0000 3.0000
2.0000 2.8000
1.0000 1.0000
As I understand, the "score" output multiplied by the "coeff" output reconstructs the centered data. I assume by centred data it means fixing the data to the origin as descrbed in this tutorial video "https://www.youtube.com/watch?v=FgakZw6K1QQ"? If so why does my data when centred manually not equal the outputs of score*coeff? The score*coeff results in:
>> score*coeff
ans =
4.7231 -0.8092
4.2295 -2.9901
2.5422 -0.3156
-2.5933 1.3053
-3.4936 1.7842
-5.4078 1.0253
But then, the mean of the first column minus every value in that column (for the centred values of the first variable) and the mean of the second column minus every value in that column (for the centred values of the second variable) equals different values, even though this is presumably how you centre the data around the origin?
>> CentredVariable1 = mean(DATASET(:,1))-DATASET(:,1)
CentredVariable1 =
-4.1667
-5.1667
-2.1667
2.8333
3.8333
4.8333
>> CentredVariable2 = mean(DATASET(:,2))-DATASET(:,2)
CentredVariable2 =
-2.3667
-0.3667
-1.3667
0.6333
0.8333
2.6333

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!