-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnipals_figures.m
executable file
·61 lines (51 loc) · 1.9 KB
/
nipals_figures.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
figure
plot(1:1:size(RESULTS.Eigenvalues,1), RESULTS.Eigenvalues, 'o-',...
'MarkerFaceColor', 'black',...
'MarkerEdgeColor', 'black')
text(1:1:size(RESULTS.Eigenvalues,1)+0.01,RESULTS.Eigenvalues+0.01,...
num2str(RESULTS.Variance, 4), 'HorizontalAlignment','left')
title('Scree plot')
xlabel('Eigenvalue index')
ylabel('Eigenvalue')
figure
plot(RESULTS.Scores(:,1), RESULTS.Scores(:,2), '.')
text(RESULTS.Scores(:,1)+0.01, ...
RESULTS.Scores(:,2)+0.01, ...
TABLE.Properties.RowNames)
title('Scores plot')
xlabel('PLS-1')
ylabel('PLS-2')
figure
plot(RESULTS.Loadings(:,1), RESULTS.Loadings(:,2), 'o', ...
'MarkerFaceColor', 'black',...
'MarkerEdgeColor', 'black')
text(RESULTS.Loadings(:,1)+0.01, RESULTS.Loadings(:,2)+0.01, ...
TABLE.Properties.VariableNames,...
'HorizontalAlignment','left')
title('Loadings plot')
xlabel('PLS-1')
ylabel('PLS-2')
figure
plot(scaledata(RESULTS.Scores(:,1),-1,1), ...
scaledata(RESULTS.Scores(:,2),-1,1), '.')
text(scaledata(RESULTS.Scores(:,1),-1,1)+0.01, ...
scaledata(RESULTS.Scores(:,2),-1,1)+0.01, ...
TABLE.Properties.RowNames)
hold on
plot(scaledata(RESULTS.Loadings(:,1),-1,1), ...
scaledata(RESULTS.Loadings(:,2),-1,1), 'o',...
'MarkerFaceColor', 'black',...
'MarkerEdgeColor', 'black')
text(scaledata(RESULTS.Loadings(:,1),-1,1)+0.01, ...
scaledata(RESULTS.Loadings(:,2),-1,1)+0.01, ...
TABLE.Properties.VariableNames,...
'HorizontalAlignment','left')
title('Biplot - data scaled in [-1,1]')
xlabel('PLS-1')
ylabel('PLS-2')
axis([-1.2 1.2 -1.2 1.2]);
figure
plot(RESULTS.Residual_Matrix, '*')
title('RESIDUALS')
xlabel('Row index')
ylabel('Residual')