MATLAB Answers

BOB
0

Principal Component Analysis Reconstructing Centred Data

Asked by BOB
on 19 Apr 2019
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

  0 Comments

Sign in to comment.

0 Answers