-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaptPlotYs.m
More file actions
57 lines (51 loc) · 1.53 KB
/
aptPlotYs.m
File metadata and controls
57 lines (51 loc) · 1.53 KB
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
function aptPlotYs(iYs,Yfit)
%APTPLOTYS Summary of this function goes here
% Detailed explanation goes here
global apt
if ~exist('iYs', 'var') || isempty(iYs)
iYs = 1:length(apt.Y);
end
if ~exist('Yfit', 'var') || isempty(Yfit)
loocv = true;
else
loocv = false;
end
for iY = iYs
if loocv
Yfit = apt.LOOCV(iY).YPredicted;
end
if apt.config.doLog10(iY)
figure
s1 = subplot(2,1,1);
scatter(apt.Y{iY},Yfit,'r');
hold on
plot([min(apt.Y{iY}),max(apt.Y{iY})],[min(apt.Y{iY}),max(apt.Y{iY})],'r--');
hold off
s2 = subplot(2,1,2);
scatter(10.^apt.Y{iY},10.^Yfit,'b');
hold on
plot([min(10.^apt.Y{iY}),max(10.^apt.Y{iY})],[min(10.^apt.Y{iY}),max(10.^apt.Y{iY})],'b--');
hold off
title(s1, 'on log10 scale')
title(s2, 'backtransformed to lin scale')
xlabel(s1,'measured')
xlabel(s2,'measured')
if isfield(apt,'LOOCV') && all(Yfit == apt.LOOCV(iY).YPredicted)
myYLab = 'predicted';
else
myYLab = 'fitted';
end
ylabel(s1,myYLab)
ylabel(s2,myYLab)
suptitle([apt.data(1).obsName{iY} '; n = ' num2str(sum(~isnan(apt.Y{iY})))])
else
figure
scatter(apt.Y{iY},Yfit,'b');
hold on
plot([min(apt.Y{iY}),max(apt.Y{iY})],[min(apt.Y{iY}),max(apt.Y{iY})],'b--');
xlabel('measured')
ylabel('fitted')
title([apt.data(1).obsName{iY} '; n = ' num2str(sum(~isnan(apt.Y{iY})))])
end
end
end