-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfiguresSV.m
88 lines (75 loc) · 2.2 KB
/
figuresSV.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
%% plot SV results for benchmark models
path(pathdef) % sets path to factory default
addpath matlabtoolbox/emtools/
addpath matlabtoolbox/emtexbox/
initscript
initwrap
doYGAP = false;
preamble4figurescripts
%% read results
type(fullfile(datadir, strcat('settings.', filext)));
% load SV
Nsv = 3 + Nyield; % = Ngap
SV = NaN(T, length(fractiles) + 2, Nsv);
for n = 1 : Nsv
SV(:,:,n) = importdata(fullfile(datadir, sprintf('SV%d.%s', n, filext)));
end
Nsvorth = 2;
if strcmpi(modellabel, 'rbarsvYgap')
Nsvorth = 3;
end
SVorth = NaN(T, length(fractiles) + 2, Nsvorth);
for n = 1 : Nsvorth
SVorth(:,:,n) = importdata(fullfile(datadir, sprintf('SVORTH%d.%s', n, filext)));
end
%% SV
for n = 1 : Nsv
newfigure(sprintf('SV %s', svlabel{n}))
% plotCIlines(SV(:,ndxmean,n), SV(:,ndxtails,n), dates)
plotCI(SV(:,ndxmean,n), SV(:,ndxtails2,n), dates, 0)
plot(dates, SV(:,ndxmean,n), 'w--', 'linewidth', 2)
hold on
ylim([0 max(ylim)])
xlim(dates([1 end]))
set(gca, 'xtick', yearticks)
datetick('x', 'keeplimits', 'keepticks')
% grid on
box off
set(gca, 'fontsize', 16)
wrapcf(sprintf('%sSV%s', modellabel, svlabel{n}), wrap)
end
%% SVorth
n = 1;
newfigure(sprintf('SVorth %d', n))
plotCI(SVorth(:,ndxmean,n), SVorth(:,ndxtails2,n), dates, 0)
plot(dates, SVorth(:,ndxmean,n), 'w--', 'linewidth', 2)
hold on
ylim([0 max(ylim)])
xlim(dates([1 end]))
set(gca, 'xtick', yearticks)
datetick('x', 'keeplimits', 'keepticks')
% grid on
% wrapcf(sprintf('SVorth%d', n), wrap)
box off
set(gca, 'fontsize', 16)
wrapcf(sprintf('%sSVpibar', modellabel), wrap)
if strcmpi(modellabel, 'rbarsvYgap')
n = 3;
newfigure(sprintf('SVorth %d', n))
plotCIybase(SVorth(:,ndxmean,n), SVorth(:,ndxtails2,n), dates, 0)
plot(dates, SVorth(:,ndxmean,n), 'w--', 'linewidth', 2)
hold on
ylim([0 max(ylim)])
xlim(dates([1 end]))
set(gca, 'xtick', yearticks)
datetick('x', 'keeplimits', 'keepticks')
% grid on
% wrapcf(sprintf('SVorth%d', n), wrap)
box off
set(gca, 'fontsize', 16)
wrapcf(sprintf('%sSVrbar', modellabel), wrap)
end
%% finish
finishwrap
dockAllFigures
finishscript