Debian Codegraph @

tests/reporting/ResidTablePage.m

raw
1 function rep = ResidTablePage(rep, countryAbbr, countryName, db_q, dc_q, trange, vline_after)
2 % Copyright © 2011-2023 Dynare Team
3 %
4 % This file is part of Dynare.
5 %
6 % Dynare is free software: you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation, either version 3 of the License, or
9 % (at your option) any later version.
10 %
11 % Dynare is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
15 %
16 % You should have received a copy of the GNU General Public License
17 % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
18
19 seriesNames = {{'RES_RS_'}, ...
20 {'RES_RR_BAR_'}, ...
21 {'RES_BLT_'}, ...
22 {'RES_BLT_BAR_'}, ...
23 {'RES_YY_'}, ...
24 {'RES_Y_'}, ...
25 {'RES_LGDP_BAR_'}, ...
26 {'RES_G_'}, ...
27 {'RES_UNR_GAP_'}, ...
28 {'RES_UNR_G_'}, ...
29 {'RES_UNR_BAR_'}, ...
30 {'RES_RR_DIFF_'}, ...
31 {'RES_LZ_BAR_'}, ...
32 {'RES_DOT_LZ_BAR_'}, ...
33 {'RES_PIETAR_'}, ...
34 {'RES_PIE_'}, ...
35 {'RES_PIEX_'}, ...
36 {'RES_PIE_GAS_'}, ...
37 {'RES_PIE_CONSFOOD_'}};
38
39 otherThree = {'EA6', 'LA6', 'RC6'};
40 notForOtherThree = {'RES_BLT_', 'RES_BLT_BAR_', 'RES_UNR_GAP_', 'RES_UNR_G_', 'RES_UNR_BAR_'};
41
42 notForUS = {'RES_RR_DIFF_', 'RES_LZ_BAR_'};
43
44 firstThree = {'US', 'EU', 'JA'};
45 notForFirstThree = {'RES_DOT_LZ_BAR_', 'RES_PIETAR_'};
46
47 rep.addTable('title', countryName, ...
48 'range', trange, ...
49 'vlineAfter', vline_after);
50
51 for i=1:length(seriesNames)
52 if (any(strcmp(countryAbbr, otherThree)) && ...
53 any(strcmp(seriesNames{i}{1}, notForOtherThree))) || ...
54 (any(strcmp(countryAbbr, 'US')) && any(strcmp(seriesNames{i}{1}, notForUS))) || ...
55 (any(strcmp(countryAbbr, firstThree)) && any(strcmp(seriesNames{i}{1}, notForFirstThree)))
56 continue
57 end
58 rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]});
59 delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
60 delta.tex_rename_('$\Delta$');
61 rep.addSeries('data', delta, ...
62 'tableShowMarkers', true, ...
63 'tableAlignRight', true);
64 end
65 end