Reporting is no longer a submodule
parent
50a53a22ee
commit
742a3101b1
|
@ -14,9 +14,6 @@
|
|||
path = matlab/modules/dseries
|
||||
url = ../../Dynare/dseries.git
|
||||
branch = master
|
||||
[submodule "matlab/modules/reporting"]
|
||||
path = matlab/modules/reporting
|
||||
url = ../../Dynare/reporting.git
|
||||
[submodule "contrib/jsonlab"]
|
||||
path = contrib/jsonlab
|
||||
url = https://github.com/fangq/jsonlab.git
|
||||
|
|
|
@ -57,8 +57,7 @@ p = {'/../contrib/jsonlab/' ; ...
|
|||
'/kalman/likelihood' ; ...
|
||||
'/lmmcp/' ; ...
|
||||
'/modules/dseries/src/' ; ...
|
||||
'/modules/reporting/macros/'; ...
|
||||
'/modules/reporting/src/' ; ...
|
||||
'/reporting/' ; ...
|
||||
'/moments/'; ...
|
||||
'/ms-sbvar/' ; ...
|
||||
'/ms-sbvar/identification/' ; ...
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 5dc59f4e843408bcb5c649849843adfbd56fad80
|
|
@ -1,12 +0,0 @@
|
|||
*~
|
||||
\#*\#
|
||||
*.pdf
|
||||
*.aux
|
||||
*.log
|
||||
*.out
|
||||
*.tex
|
||||
*.csv
|
||||
*.toc
|
||||
*synctex.gz
|
||||
.DS_Store
|
||||
test/tmpRepDir
|
|
@ -1,30 +0,0 @@
|
|||
variables:
|
||||
MATLAB_VERSION: R2023b
|
||||
OLD_MATLAB_VERSION: R2014a
|
||||
|
||||
before_script:
|
||||
- git clone https://git.dynare.org/Dynare/dseries.git
|
||||
|
||||
test_matlab:
|
||||
stage: test
|
||||
script:
|
||||
- make check-matlab MATLAB=/opt/MATLAB/$MATLAB_VERSION/bin/matlab
|
||||
artifacts:
|
||||
paths:
|
||||
- test/my/report/dir/report.pdf
|
||||
|
||||
test_old_matlab:
|
||||
stage: test
|
||||
script:
|
||||
- make check-matlab MATLAB=/opt/MATLAB/$OLD_MATLAB_VERSION/bin/matlab
|
||||
artifacts:
|
||||
paths:
|
||||
- test/my/report/dir/report.pdf
|
||||
|
||||
test_octave:
|
||||
stage: test
|
||||
script:
|
||||
- make check-octave
|
||||
artifacts:
|
||||
paths:
|
||||
- test/my/report/dir/report.pdf
|
|
@ -1,15 +0,0 @@
|
|||
> Copyright © 2013-2017 Dynare Team
|
||||
>
|
||||
> License: GPL-3+
|
||||
> Dynare Reporting is free software: you can redistribute it and/or modify
|
||||
> it under the terms of the GNU General Public License as published by
|
||||
> the Free Software Foundation, either version 3 of the License, or
|
||||
> (at your option) any later version.
|
||||
>
|
||||
> This code is distributed in the hope that it will be useful, but
|
||||
> WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
> General Public License for more details.
|
||||
|
||||
> A copy of the GNU General Public License is available here
|
||||
> <https://www.gnu.org/licenses/>.
|
|
@ -1,11 +0,0 @@
|
|||
OCTAVE ?= octave-cli
|
||||
MATLAB ?= matlab
|
||||
|
||||
all: check-octave check-matlab
|
||||
|
||||
check-octave:
|
||||
@cd test ;\
|
||||
$(OCTAVE) --no-init-file --silent --no-history --eval "addpath([pwd() '/../dseries/src']); addpath([pwd() '/../src']); runtest;" && [ -f my/report/dir/report.pdf ]
|
||||
|
||||
check-matlab:
|
||||
@$(MATLAB) -nosplash -nodisplay -r "addpath([pwd '/dseries/src']); addpath([pwd '/src']); cd test; runtest; quit" && [ -f test/my/report/dir/report.pdf ]
|
|
@ -1,38 +0,0 @@
|
|||
# Dynare Reporting
|
||||
|
||||
Originally designed to provide reporting functionality for
|
||||
[Dynare](https://www.dynare.org), it has been moved to its own repository in the
|
||||
hopes that it can be used without obliging the user to download Dynare in its
|
||||
entirety.
|
||||
|
||||
# License
|
||||
|
||||
Dynare Reporting is covered by the GNU General Public Licence version 3 or
|
||||
later (see [LICENSE.md](LICENSE.md) in the Dynare Reporting distribution for
|
||||
specifics).
|
||||
|
||||
# Obtain the code that Dynare Reporting depends on
|
||||
|
||||
Dynare ```reporting``` depends on the Dynare
|
||||
[```dseries```](https://git.dynare.org/Dynare/dseries) repository and on
|
||||
utility functions from the [```dynare```](https://git.dynare.org/Dynare/dynare)
|
||||
repository, located in ```dynare/matlab/utilities/general```
|
||||
|
||||
# Use the Dynare Reporting code
|
||||
|
||||
- Open MATLAB/Octave
|
||||
- Change into the ```reporting``` directory
|
||||
- Ensure that the [```dseries```](https://git.dynare.org/Dynare/dseries)
|
||||
directory is in your path and initialized correctly (follow the directions on
|
||||
the repository site)
|
||||
- Add ```<<dynare>>/matlab/utilities/general``` to your path where
|
||||
```<<dynare>>``` refers to the base of your Dynare installation
|
||||
- Run ```initialize_reporting_toolbox```
|
||||
- Use the reporting code as outlined in the Dynare documentation
|
||||
|
||||
# Run the example code
|
||||
|
||||
- Follow the steps above
|
||||
- Change into the ```reporting/test``` directory
|
||||
- Modify the paths in ```reporting/test/runtest.m``` appropriately
|
||||
- Run the ```runtest``` matlab script
|
|
@ -1,106 +0,0 @@
|
|||
function make_report_irfs(M_, oo_, ticks_every, showOutput)
|
||||
% Builds canned IRF report
|
||||
%
|
||||
% INPUTS
|
||||
% M_ [struct]
|
||||
% oo_ [struct]
|
||||
% ticks_every [int] number of spaces between ticks. Default 5.
|
||||
% showOutput [bool] showOutput the report. Default true
|
||||
%
|
||||
% OUTPUTS
|
||||
% None
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% None
|
||||
|
||||
% Copyright © 2015-2023 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
if ~isfield(oo_, 'irfs')
|
||||
disp('make_report_irfs: oo_.irfs does not exist');
|
||||
return
|
||||
end
|
||||
fields = fieldnames(oo_.irfs);
|
||||
if isempty(fields)
|
||||
disp('make_report_irfs: oo_.irfs is empty');
|
||||
return
|
||||
end
|
||||
if ~isfield(M_, 'exo_names')
|
||||
disp('make_report_irfs: M_.exo_names does not exist');
|
||||
return
|
||||
end
|
||||
if ~isfield(M_, 'endo_names')
|
||||
disp('make_report_irfs: M_.endo_names does not exist');
|
||||
return
|
||||
end
|
||||
if ~isfield(M_, 'fname')
|
||||
disp('make_report_irfs: M_.fname does not exist');
|
||||
return
|
||||
end
|
||||
|
||||
if nargin < 3
|
||||
ticks_every = 5;
|
||||
else
|
||||
assert(isint(ticks_every));
|
||||
end
|
||||
if nargin < 4
|
||||
showOutput = true;
|
||||
else
|
||||
assert(islogical(showOutput));
|
||||
end
|
||||
n6 = 1;
|
||||
justAddedPage = 0;
|
||||
calcxticks = false;
|
||||
r = report('filename', [M_.fname '_canned_irf_report.tex'], 'showOutput', showOutput);
|
||||
for i = 1:length(M_.exo_names)
|
||||
newexo = 1;
|
||||
for j = 1:length(M_.endo_names)
|
||||
idx = ismember(fields, [M_.endo_names{j} '_' M_.exo_names{i}]);
|
||||
if (mod(n6 - 1, 6) == 0 && ~justAddedPage) || ...
|
||||
(newexo && any(idx))
|
||||
r = r.addPage('title', {'Canned Irf Report'; ['shock ' ...
|
||||
strrep(M_.exo_names{i},'_','\_')]});
|
||||
r = r.addSection('cols', 2);
|
||||
n6 = 1;
|
||||
justAddedPage = 1;
|
||||
newexo = 0;
|
||||
end
|
||||
if any(idx)
|
||||
if ~calcxticks
|
||||
data = dseries(oo_.irfs.(fields{idx})');
|
||||
xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1;
|
||||
xTickLabels = regexp(num2str(xTicks-1), '(?:\s)+', 'split');
|
||||
calcxticks = true;
|
||||
end
|
||||
r = r.addGraph('data', dseries(oo_.irfs.(fields{idx})'), ...
|
||||
'title', M_.endo_names{j}, '_', '\_'), ...
|
||||
'titleFormat', '\Huge', ...
|
||||
'showGrid', false, ...
|
||||
'yTickLabelZeroFill', false, ...
|
||||
'yTickLabelPrecision', 1, ...
|
||||
'showZeroLine', true, ...
|
||||
'zeroLineColor', 'red', ...
|
||||
'xTicks', xTicks, ...
|
||||
'xTickLabels', xTickLabels);
|
||||
n6 = n6 + 1;
|
||||
justAddedPage = 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
r.write();
|
||||
r.compile();
|
||||
end
|
|
@ -1,28 +0,0 @@
|
|||
function initialize_reporting_toolbox()
|
||||
%function initialize_reporting_toolbox()
|
||||
%
|
||||
% Function to set the necessary paths for the Reporting toolbox
|
||||
%
|
||||
% Copyright © 2015-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
% Find reporting source directory
|
||||
reporting_src_root = strrep(which('initialize_reporting_toolbox'), 'initialize_reporting_toolbox.m', '');
|
||||
|
||||
% Add path to reporting source
|
||||
addpath([reporting_src_root '/../macros']);
|
||||
end
|
|
@ -1,34 +0,0 @@
|
|||
function rep = AnnualTable(rep, db_a, dc_a, seriesRootName, arange)
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
shortNames = {'US', 'EU', 'JA', 'EA6', 'LA6', 'RC6'};
|
||||
longNames = {'Coca Cola', 'Kinder Bueno', 'Pizza', ...
|
||||
'Vegetarianism Is Good', 'OS X', 'Dothraki'};
|
||||
|
||||
rep.addSeries('tableSubSectionHeader', 'A group', ...
|
||||
'tableRowColor', 'red!22');
|
||||
for i = 1:length(shortNames)
|
||||
db_a.tex_rename_([seriesRootName shortNames{i}], longNames{i});
|
||||
rep.addSeries('data', db_a{[seriesRootName shortNames{i}]});
|
||||
delta = dc_a{[seriesRootName shortNames{i}]}-db_a{[seriesRootName shortNames{i}]};
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
end
|
|
@ -1,38 +0,0 @@
|
|||
function rep = CommResidTablePage(rep, db_q, dc_q, trange, vline_after)
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
seriesNames = {{'RES_LRPOIL_GAP_WORLD'}, ...
|
||||
{'RES_LRPOIL_BAR_WORLD'}, ...
|
||||
{'RES_LRPOIL_G_WORLD'}, ...
|
||||
{'RES_LRPFOOD_GAP_WORLD'}, ...
|
||||
{'RES_LRPFOOD_BAR_WORLD'}, ...
|
||||
{'RES_LRPFOOD_G_WORLD'}};
|
||||
|
||||
rep.addTable('title', 'Commodities', ...
|
||||
'range', trange, ...
|
||||
'vlineAfter', vline_after);
|
||||
|
||||
for i = 1:length(seriesNames)
|
||||
rep.addSeries('data', db_q{seriesNames{i}{1}});
|
||||
delta = db_q{seriesNames{i}{1}} - dc_q{seriesNames{i}{1}};
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
end
|
|
@ -1,113 +0,0 @@
|
|||
function rep = CountryGraphPage(rep, countryAbbr, db_q, dc_q, prange, srange)
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
startpoint = strings(prange(1));
|
||||
shaded = strings(srange(1));
|
||||
endpoint = strings(prange(end));
|
||||
rep.addGraph('title', 'Interest Rate', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0, ...
|
||||
'writeCSV', true);
|
||||
rep.addSeries('data', db_q{['RS_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['RS_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'Output Gap', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{['Y_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['Y_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'Headline Inflation (y/y)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'Headline Inflation (q/q)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'GDP Growth (q/q)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'Core Inflation (y/y)', ...
|
||||
'titleFormat', '\Huge', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
end
|
|
@ -1,68 +0,0 @@
|
|||
function rep = CountryTablePage(rep, countryAbbr, countryName, db_q, dc_q, db_a, dc_a, trange, vline_after)
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
seriesNames = {{'RS_', 'Short Term Interest Rate'}, ...
|
||||
{'RR_', 'Real Interest Rate'}, ...
|
||||
{'BLT_','Bank Lending Tightening' }, ...
|
||||
{'PCH_GROWTH_', 'Real GDP Growth (@q ar)'}, ...
|
||||
{'PCH_GROWTH4_', '\% y-o-y'}, ...
|
||||
{'PCH_GROWTH_BAR_', 'Potential GDP Growth (@q ar)'}, ...
|
||||
{'PCH_GROWTH4_BAR_', '\% y-o-y'}, ...
|
||||
{'PCH_PIE_', 'Headline CPI Inflation (@q ar)'}, ...
|
||||
{'PCH_PIE4_', '\% y-o-y'}, ...
|
||||
{'PCH_PIEX_', 'Core CPI Inflation (@q ar)'}, ...
|
||||
{'PCH_PIEX4_', '\% y-o-y'}, ...
|
||||
{'PCH_PIE_GAS_', 'Gas Inflation (@q ar)'}, ...
|
||||
{'PCH_PIE4_GAS_', '\% y-o-y'}, ...
|
||||
{'PCH_PIE_CONSFOOD_', 'Food Inflation (@q ar)'}, ...
|
||||
{'PCH_PIE4_CONSFOOD_', '\% y-o-y'}, ...
|
||||
{'PCH_DOT_REER_T_', 'REER Depreciation (@q ar)'}, ...
|
||||
{'PCH_DOT4_REER_T_', '\% y-o-y'}, ...
|
||||
{'Y_', 'Output Gap'}, ...
|
||||
{'UNR_', 'Unemployment Rate'}, ...
|
||||
{'UNR_BAR_', 'NAIRU'}, ...
|
||||
{'UNR_GAP_', 'Unemployment Gap'}};
|
||||
|
||||
otherThree = {'EA6','LA6','RC6'};
|
||||
notForOtherThree = {'BLT_', 'UNR_', 'UNR_BAR_', 'UNR_GAP_'};
|
||||
|
||||
rep.addTable('title', countryName, ...
|
||||
'range', {trange, dates('2012a'):dates('2014a')}, ...
|
||||
'vlineAfter', {vline_after dates('2014q4')}, ...
|
||||
'writeCSV', true, ...
|
||||
'highlightRows', {'gray!22', 'cyan!33', 'blue!44', 'red!55'});
|
||||
|
||||
for i = 1:length(seriesNames)
|
||||
if any(strcmp(countryAbbr, otherThree)) && ...
|
||||
any(strcmp(seriesNames{i}{1}, notForOtherThree))
|
||||
continue
|
||||
end
|
||||
db_q.tex_rename_([seriesNames{i}{1} countryAbbr], seriesNames{i}{2});
|
||||
rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]}, ...
|
||||
'tableDataRhs', db_a{[seriesNames{i}{1} countryAbbr]});
|
||||
delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
|
||||
delta.tex_rename_('$\Delta$');
|
||||
|
||||
deltaa = db_a{[seriesNames{i}{1} countryAbbr]}-dc_a{[seriesNames{i}{1} countryAbbr]};
|
||||
deltaa.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableRowIndent', 2, ...
|
||||
'tableDataRhs', deltaa);
|
||||
end
|
||||
end
|
|
@ -1,65 +0,0 @@
|
|||
function rep = ResidTablePage(rep, countryAbbr, countryName, db_q, dc_q, trange, vline_after)
|
||||
% Copyright © 2011-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
seriesNames = {{'RES_RS_'}, ...
|
||||
{'RES_RR_BAR_'}, ...
|
||||
{'RES_BLT_'}, ...
|
||||
{'RES_BLT_BAR_'}, ...
|
||||
{'RES_YY_'}, ...
|
||||
{'RES_Y_'}, ...
|
||||
{'RES_LGDP_BAR_'}, ...
|
||||
{'RES_G_'}, ...
|
||||
{'RES_UNR_GAP_'}, ...
|
||||
{'RES_UNR_G_'}, ...
|
||||
{'RES_UNR_BAR_'}, ...
|
||||
{'RES_RR_DIFF_'}, ...
|
||||
{'RES_LZ_BAR_'}, ...
|
||||
{'RES_DOT_LZ_BAR_'}, ...
|
||||
{'RES_PIETAR_'}, ...
|
||||
{'RES_PIE_'}, ...
|
||||
{'RES_PIEX_'}, ...
|
||||
{'RES_PIE_GAS_'}, ...
|
||||
{'RES_PIE_CONSFOOD_'}};
|
||||
|
||||
otherThree = {'EA6', 'LA6', 'RC6'};
|
||||
notForOtherThree = {'RES_BLT_', 'RES_BLT_BAR_', 'RES_UNR_GAP_', 'RES_UNR_G_', 'RES_UNR_BAR_'};
|
||||
|
||||
notForUS = {'RES_RR_DIFF_', 'RES_LZ_BAR_'};
|
||||
|
||||
firstThree = {'US', 'EU', 'JA'};
|
||||
notForFirstThree = {'RES_DOT_LZ_BAR_', 'RES_PIETAR_'};
|
||||
|
||||
rep.addTable('title', countryName, ...
|
||||
'range', trange, ...
|
||||
'vlineAfter', vline_after);
|
||||
|
||||
for i=1:length(seriesNames)
|
||||
if (any(strcmp(countryAbbr, otherThree)) && ...
|
||||
any(strcmp(seriesNames{i}{1}, notForOtherThree))) || ...
|
||||
(any(strcmp(countryAbbr, 'US')) && any(strcmp(seriesNames{i}{1}, notForUS))) || ...
|
||||
(any(strcmp(countryAbbr, firstThree)) && any(strcmp(seriesNames{i}{1}, notForFirstThree)))
|
||||
continue
|
||||
end
|
||||
rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]});
|
||||
delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
end
|
|
@ -1,316 +0,0 @@
|
|||
function createReport(dc_a, dc_q, db_a, db_q)
|
||||
%function createReport(dc_a, dc_q, db_a, db_q)
|
||||
%
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
tic
|
||||
larange= dates('2007a'):dates('2014a');
|
||||
trange = dates('2012q2'):dates('2014q4');
|
||||
prange = dates('2007q1'):dates('2013q4');
|
||||
forecast_date = dates('2012q2');
|
||||
srange = forecast_date:prange(end);
|
||||
|
||||
startpoint = strings(prange(1));
|
||||
shaded = strings(srange(1));
|
||||
endpoint = strings(prange(end));
|
||||
|
||||
shortNames = {'US', 'EU', 'JA', 'EA6', 'LA6', 'RC6'};
|
||||
longNames = {'Coca Cola', 'Kinder Bueno', 'Pizza', ...
|
||||
'Vegetarianism Is Good', 'OS X', 'Dothraki'};
|
||||
|
||||
%% Begin Report
|
||||
rep = report('directory', 'my/report/dir', 'title', 'Report Title', ...
|
||||
'maketoc', true);
|
||||
|
||||
%% Page 1: GDP
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep.addTable('title', {'Real GDP Growth','subtitle 1', 'subtitle 2'}, ...
|
||||
'range', larange, ...
|
||||
'vlineAfter', dates('2011y'), ...
|
||||
'highlightRows', {'gray!25','white','green!22'});
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_GROWTH4_', larange);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep.addTable('title', 'Potential GDP Growth', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_GROWTH4_BAR_', larange);
|
||||
|
||||
|
||||
%% Page 2: Headline & Core Inflation
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep.addTable('title', 'Headline CPI Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_', larange);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep.addTable('title', 'Core CPI Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIEX4_', larange);
|
||||
|
||||
|
||||
%% Page 3: Gas & Food Inflation
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep.addTable('title', 'Gas Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_GAS_', larange);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep.addTable('title', 'Food Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_CONSFOOD_', larange);
|
||||
|
||||
|
||||
%% Page 4: i & Output Gap
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep.addTable('title', 'Nominal Interest Rate', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'RS_', larange);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep.addTable('title', 'Output Gap', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'), 'tableDirName', 'page4table2');
|
||||
db_a.tex_rename_('Y_WORLD', 'World');
|
||||
rep.addSeries('data', db_a{'Y_WORLD'});
|
||||
delta = db_a{'Y_WORLD'}-dc_a{'Y_WORLD'};
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'Y_', larange);
|
||||
|
||||
%% Country Pages
|
||||
for i=1:length(shortNames)
|
||||
rep.addPage('title', {'Jan1 vs Jan2', longNames{i}}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'});
|
||||
rep.addSection('cols', 5);
|
||||
rep = CountryGraphPage(rep, shortNames{i}, db_q, dc_q, prange, srange);
|
||||
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep = CountryTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, ...
|
||||
db_a, dc_a, trange, dates('2012q2'));
|
||||
end
|
||||
|
||||
%% Residual Reports
|
||||
% Countries
|
||||
for i=1:length(shortNames)
|
||||
rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep = ResidTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, trange, dates('2012q2'));
|
||||
end
|
||||
|
||||
% Commodities
|
||||
rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep.addSection();
|
||||
rep = CommResidTablePage(rep, db_q, dc_q, trange, dates('2012q2'));
|
||||
|
||||
%% Commodities Graphs
|
||||
%Page 24
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries', ...
|
||||
'removeHeaderAndFooter', true);
|
||||
rep.addSection('height', '0.475\textheight');
|
||||
|
||||
rep.addGraph('title', {'World Real Oil Price Index','SUBTITLE'}, ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
'graphBar', true, ...
|
||||
'graphBarColor', 'red', ...
|
||||
'graphBarFillColor', 'gray', ...
|
||||
'graphBarWidth', 1);
|
||||
db_q.tex_rename_('LRPOIL_WORLD', 'Oil Price');
|
||||
rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphMarker', 'triangle*', ...
|
||||
'graphMarkerEdgeColor','black', ...
|
||||
'graphMarkerSize',4);
|
||||
db_q.tex_rename_('LRPOIL_BAR_WORLD', 'Equilibrium Oil Price');
|
||||
rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'green', ...
|
||||
'graphLineStyle', 'solid', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'World Real Food Price Index', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0, ...
|
||||
'showLegend', true, ...
|
||||
'legendAt', [.5,.5]);
|
||||
rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
'graphBar', true, ...
|
||||
'graphBarColor', 'green', ...
|
||||
'graphBarFillColor', 'yellow', ...
|
||||
'graphBarWidth', 1);
|
||||
db_q.tex_rename_('LRPFOOD_WORLD', 'Food Price');
|
||||
rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
db_q.tex_rename_('LRPFOOD_BAR_WORLD', 'Equilibrium Food Price');
|
||||
rep.addSeries('graphVline', dates('2009q2'), ...
|
||||
'graphLineColor', 'red', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
% Page 25
|
||||
rep.addPage('title', {'Jan1 vs Jan2', 'World Oil and Food Prices'}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'}, ...
|
||||
'setPageNumber', 90);
|
||||
rep.addSection('cols', 1);
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ...
|
||||
'cols', 2, ...
|
||||
'heading', '\textbf{My First Paragraph Has Two Columns}');
|
||||
|
||||
rep.addSection('cols', 1);
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\newline', ...
|
||||
'heading', '\textbf{My Next Paragraphs Only Have One}', ...
|
||||
'indent', false);
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\newline');
|
||||
|
||||
rep.addSection('cols', 2);
|
||||
|
||||
rep.addGraph('title', 'World Real Oil Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
srange1 = prange(1):forecast_date;
|
||||
rep.addGraph('title', 'Equilibrium World Real Oil Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange1);
|
||||
rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep.addGraph('title', 'World Real Food Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTickLabels','ALL',...
|
||||
'xTickLabelRotation', 45,...
|
||||
'xAxisTight',false,...
|
||||
'yAxisTight',true);
|
||||
rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('data', dc_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep.addSeries('graphHline', 460, ...
|
||||
'graphLineColor', 'red', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
a=dseries([1:200]', '1984q1');
|
||||
b=dseries([1:200]', '1984q1');
|
||||
c=dseries([1:200]', '1984q1');
|
||||
d=dseries([1:200]', '1984q1');
|
||||
b(dates('2012q2'):dates('2015q2'))=b(dates('2012q2'):dates('2015q2'))+2;
|
||||
c(dates('2012q2'):dates('2015q2'))=c(dates('2012q2'):dates('2015q2'))+4;
|
||||
d(dates('2012q2'):dates('2015q2'))=d(dates('2012q2'):dates('2015q2'))+6;
|
||||
|
||||
rep.addGraph('title', 'Equilibrium World Real Food Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showLegend', true, ...
|
||||
'xTickLabelRotation', 0);
|
||||
rep.addSeries('data', a, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'baseline', ...
|
||||
'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,color=red');
|
||||
rep.addSeries('data', b, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,mark options={rotate=90,scale=3}', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 40);
|
||||
rep.addSeries('data', c, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 30);
|
||||
rep.addSeries('data', d, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 20);
|
||||
|
||||
%% Page 26
|
||||
rep.addPage('title', {'report\_data test'}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'});
|
||||
rep.addSection('cols', 1);
|
||||
rep.addTable('title', {'Table Data 0', 'subtitle 2'});
|
||||
rep.addData('data', [repmat({'a'},10,1) num2cell(rand(10,6))]);
|
||||
rep.addVspace();
|
||||
rep.addSection('cols', 1);
|
||||
rep.addTable('title', {'Table Data 1', 'subtitle 3'});
|
||||
rep.addData('data', [repmat({'a'},10,1) repmat({'b'},10,1) num2cell(rand(10,1))], 'column_names', {'Name', '', 'Var2'});
|
||||
|
||||
%% Write & Compile Report
|
||||
rep.write();
|
||||
rep.compile();
|
||||
toc
|
||||
end
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,26 +0,0 @@
|
|||
% Copyright © 2017-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
% Dynare is free software: you can redistribute it and/or modify
|
||||
% it under the terms of the GNU General Public License as published by
|
||||
% the Free Software Foundation, either version 3 of the License, or
|
||||
% (at your option) any later version.
|
||||
%
|
||||
% Dynare is distributed in the hope that it will be useful,
|
||||
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
% GNU General Public License for more details.
|
||||
%
|
||||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
initialize_dseries_class();
|
||||
initialize_reporting_toolbox();
|
||||
|
||||
db_a = dseries('db_a.csv');
|
||||
db_q = dseries('db_q.csv');
|
||||
dc_a = dseries('dc_a.csv');
|
||||
dc_q = dseries('dc_q.csv');
|
||||
|
||||
createReport(dc_a, dc_q, db_a, db_q);
|
|
@ -1,5 +1,5 @@
|
|||
function rep = AnnualTable(rep, db_a, dc_a, seriesRootName, arange)
|
||||
% Copyright © 2013-2014 Dynare Team
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -20,14 +20,14 @@ shortNames = {'US', 'EU', 'JA', 'EA6', 'LA6', 'RC6'};
|
|||
longNames = {'Coca Cola', 'Kinder Bueno', 'Pizza', ...
|
||||
'Vegetarianism Is Good', 'OS X', 'Dothraki'};
|
||||
|
||||
rep = rep.addSeries('tableSubSectionHeader', 'A group', ...
|
||||
rep.addSeries('tableSubSectionHeader', 'A group', ...
|
||||
'tableRowColor', 'red!22');
|
||||
for i=1:length(shortNames)
|
||||
db_a = db_a.tex_rename([seriesRootName shortNames{i}], longNames{i});
|
||||
rep = rep.addSeries('data', db_a{[seriesRootName shortNames{i}]});
|
||||
for i = 1:length(shortNames)
|
||||
db_a.tex_rename_([seriesRootName shortNames{i}], longNames{i});
|
||||
rep.addSeries('data', db_a{[seriesRootName shortNames{i}]});
|
||||
delta = dc_a{[seriesRootName shortNames{i}]}-db_a{[seriesRootName shortNames{i}]};
|
||||
delta = delta.tex_rename('$\Delta$');
|
||||
rep = rep.addSeries('data', delta, ...
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function rep = CommResidTablePage(rep, db_q, dc_q, trange, vline_after)
|
||||
% Copyright © 2013 Dynare Team
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -23,15 +23,15 @@ seriesNames = {{'RES_LRPOIL_GAP_WORLD'}, ...
|
|||
{'RES_LRPFOOD_BAR_WORLD'}, ...
|
||||
{'RES_LRPFOOD_G_WORLD'}};
|
||||
|
||||
rep = rep.addTable('title', 'Commodities', ...
|
||||
rep.addTable('title', 'Commodities', ...
|
||||
'range', trange, ...
|
||||
'vlineAfter', vline_after);
|
||||
|
||||
for i=1:length(seriesNames)
|
||||
rep = rep.addSeries('data', db_q{seriesNames{i}{1}});
|
||||
for i = 1:length(seriesNames)
|
||||
rep.addSeries('data', db_q{seriesNames{i}{1}});
|
||||
delta = db_q{seriesNames{i}{1}} - dc_q{seriesNames{i}{1}};
|
||||
delta = delta.tex_rename('$\Delta$');
|
||||
rep = rep.addSeries('data', delta, ...
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function rep = CountryGraphPage(rep, countryAbbr, db_q, dc_q, prange, srange)
|
||||
% Copyright © 2013-2014 Dynare Team
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -19,7 +19,7 @@ function rep = CountryGraphPage(rep, countryAbbr, db_q, dc_q, prange, srange)
|
|||
startpoint = strings(prange(1));
|
||||
shaded = strings(srange(1));
|
||||
endpoint = strings(prange(end));
|
||||
rep = rep.addGraph('title', 'Interest Rate', ...
|
||||
rep.addGraph('title', 'Interest Rate', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
|
@ -27,75 +27,75 @@ rep = rep.addGraph('title', 'Interest Rate', ...
|
|||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0, ...
|
||||
'writeCSV', true);
|
||||
rep = rep.addSeries('data', db_q{['RS_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['RS_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['RS_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['RS_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'Output Gap', ...
|
||||
rep.addGraph('title', 'Output Gap', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{['Y_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['Y_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['Y_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['Y_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'Headline Inflation (y/y)', ...
|
||||
rep.addGraph('title', 'Headline Inflation (y/y)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['PCH_PIE4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'Headline Inflation (q/q)', ...
|
||||
rep.addGraph('title', 'Headline Inflation (q/q)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['PCH_PIE_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'GDP Growth (q/q)', ...
|
||||
rep.addGraph('title', 'GDP Growth (q/q)', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showZeroline', true, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['PCH_GROWTH_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'Core Inflation (y/y)', ...
|
||||
rep.addGraph('title', 'Core Inflation (y/y)', ...
|
||||
'titleFormat', '\Huge', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
|
@ -103,11 +103,11 @@ rep = rep.addGraph('title', 'Core Inflation (y/y)', ...
|
|||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
rep.addSeries('data', db_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
rep.addSeries('data', dc_q{['PCH_PIEX4_' countryAbbr]}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
function rep = CountryTablePage(rep, countryAbbr, countryName, db_q, dc_q, db_a, dc_a, trange, vline_after)
|
||||
% Copyright © 2013-2016 Dynare Team
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -41,28 +41,26 @@ seriesNames = {{'RS_', 'Short Term Interest Rate'}, ...
|
|||
otherThree = {'EA6','LA6','RC6'};
|
||||
notForOtherThree = {'BLT_', 'UNR_', 'UNR_BAR_', 'UNR_GAP_'};
|
||||
|
||||
rep = rep.addTable('title', countryName, ...
|
||||
rep.addTable('title', countryName, ...
|
||||
'range', {trange, dates('2012a'):dates('2014a')}, ...
|
||||
'vlineAfter', {vline_after dates('2014q4')}, ...
|
||||
'writeCSV', true, ...
|
||||
'highlightRows', {'gray!22', 'cyan!33', 'blue!44', 'red!55'});
|
||||
|
||||
|
||||
|
||||
for i=1:length(seriesNames)
|
||||
for i = 1:length(seriesNames)
|
||||
if any(strcmp(countryAbbr, otherThree)) && ...
|
||||
any(strcmp(seriesNames{i}{1}, notForOtherThree))
|
||||
continue
|
||||
end
|
||||
db_q = db_q.tex_rename([seriesNames{i}{1} countryAbbr], seriesNames{i}{2});
|
||||
rep = rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]}, ...
|
||||
db_q.tex_rename_([seriesNames{i}{1} countryAbbr], seriesNames{i}{2});
|
||||
rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]}, ...
|
||||
'tableDataRhs', db_a{[seriesNames{i}{1} countryAbbr]});
|
||||
delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
|
||||
delta = delta.tex_rename('$\Delta$');
|
||||
delta.tex_rename_('$\Delta$');
|
||||
|
||||
deltaa = db_a{[seriesNames{i}{1} countryAbbr]}-dc_a{[seriesNames{i}{1} countryAbbr]};
|
||||
deltaa = deltaa.tex_rename('$\Delta$');
|
||||
rep = rep.addSeries('data', delta, ...
|
||||
deltaa.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableRowIndent', 2, ...
|
||||
'tableDataRhs', deltaa);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function rep = ResidTablePage(rep, countryAbbr, countryName, db_q, dc_q, trange, vline_after)
|
||||
% Copyright © 2011-2013 Dynare Team
|
||||
% Copyright © 2011-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -44,7 +44,7 @@ notForUS = {'RES_RR_DIFF_', 'RES_LZ_BAR_'};
|
|||
firstThree = {'US', 'EU', 'JA'};
|
||||
notForFirstThree = {'RES_DOT_LZ_BAR_', 'RES_PIETAR_'};
|
||||
|
||||
rep = rep.addTable('title', countryName, ...
|
||||
rep.addTable('title', countryName, ...
|
||||
'range', trange, ...
|
||||
'vlineAfter', vline_after);
|
||||
|
||||
|
@ -55,10 +55,10 @@ for i=1:length(seriesNames)
|
|||
(any(strcmp(countryAbbr, firstThree)) && any(strcmp(seriesNames{i}{1}, notForFirstThree)))
|
||||
continue
|
||||
end
|
||||
rep = rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]});
|
||||
rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]});
|
||||
delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
|
||||
delta = delta.tex_rename('$\Delta$');
|
||||
rep = rep.addSeries('data', delta, ...
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
function runDynareReport(dc_a, dc_q, db_a, db_q)
|
||||
%function runDynareReport(dc_a, dc_q, db_a, db_q)
|
||||
|
||||
% Copyright © 2013-2019 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
|
@ -32,99 +34,99 @@ longNames = {'Coca Cola', 'Kinder Bueno', 'Pizza', ...
|
|||
'Vegetarianism Is Good', 'OS X', 'Dothraki'};
|
||||
|
||||
%% Begin Report
|
||||
rep = report('title', 'Report Title', 'maketoc', true);
|
||||
|
||||
rep = report('directory', 'my/report/dir', 'title', 'Report Title', ...
|
||||
'maketoc', true);
|
||||
|
||||
%% Page 1: GDP
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep = rep.addVspace();
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep = rep.addTable('title', {'Real GDP Growth','subtitle 1', 'subtitle 2'}, ...
|
||||
rep.addTable('title', {'Real GDP Growth','subtitle 1', 'subtitle 2'}, ...
|
||||
'range', larange, ...
|
||||
'vlineAfter', dates('2011y'), ...
|
||||
'highlightRows', {'gray!25','white','green!22'});
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_GROWTH4_', larange);
|
||||
rep = rep.addVspace('number', 2);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep = rep.addTable('title', 'Potential GDP Growth', 'range', larange, ...
|
||||
rep.addTable('title', 'Potential GDP Growth', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_GROWTH4_BAR_', larange);
|
||||
|
||||
|
||||
%% Page 2: Headline & Core Inflation
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep = rep.addVspace();
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep = rep.addTable('title', 'Headline CPI Inflation', 'range', larange, ...
|
||||
rep.addTable('title', 'Headline CPI Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_', larange);
|
||||
rep = rep.addVspace('number', 2);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep = rep.addTable('title', 'Core CPI Inflation', 'range', larange, ...
|
||||
rep.addTable('title', 'Core CPI Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIEX4_', larange);
|
||||
|
||||
|
||||
%% Page 3: Gas & Food Inflation
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep = rep.addVspace();
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep = rep.addTable('title', 'Gas Inflation', 'range', larange, ...
|
||||
rep.addTable('title', 'Gas Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_GAS_', larange);
|
||||
rep = rep.addVspace('number', 2);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep = rep.addTable('title', 'Food Inflation', 'range', larange, ...
|
||||
rep.addTable('title', 'Food Inflation', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'PCH_PIE4_CONSFOOD_', larange);
|
||||
|
||||
|
||||
%% Page 4: i & Output Gap
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep = rep.addVspace();
|
||||
rep.addSection();
|
||||
rep.addVspace();
|
||||
|
||||
% Table 1
|
||||
rep = rep.addTable('title', 'Nominal Interest Rate', 'range', larange, ...
|
||||
rep.addTable('title', 'Nominal Interest Rate', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'RS_', larange);
|
||||
rep = rep.addVspace('number', 2);
|
||||
rep.addVspace('number', 2);
|
||||
|
||||
% Table 2
|
||||
rep = rep.addTable('title', 'Output Gap', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'));
|
||||
db_a = db_a.tex_rename('Y_WORLD', 'World');
|
||||
rep = rep.addSeries('data', db_a{'Y_WORLD'});
|
||||
rep.addTable('title', 'Output Gap', 'range', larange, ...
|
||||
'vlineAfter', dates('2011y'), 'tableDirName', 'page4table2');
|
||||
db_a.tex_rename_('Y_WORLD', 'World');
|
||||
rep.addSeries('data', db_a{'Y_WORLD'});
|
||||
delta = db_a{'Y_WORLD'}-dc_a{'Y_WORLD'};
|
||||
delta = delta.tex_rename('$\Delta$');
|
||||
rep = rep.addSeries('data', delta, ...
|
||||
delta.tex_rename_('$\Delta$');
|
||||
rep.addSeries('data', delta, ...
|
||||
'tableShowMarkers', true, ...
|
||||
'tableAlignRight', true);
|
||||
rep = AnnualTable(rep, db_a, dc_a, 'Y_', larange);
|
||||
|
||||
%% Country Pages
|
||||
for i=1:length(shortNames)
|
||||
rep = rep.addPage('title', {'Jan1 vs Jan2', longNames{i}}, ...
|
||||
rep.addPage('title', {'Jan1 vs Jan2', longNames{i}}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'});
|
||||
rep = rep.addSection('cols', 5);
|
||||
rep.addSection('cols', 5);
|
||||
rep = CountryGraphPage(rep, shortNames{i}, db_q, dc_q, prange, srange);
|
||||
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep.addSection();
|
||||
rep = CountryTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, ...
|
||||
db_a, dc_a, trange, dates('2012q2'));
|
||||
end
|
||||
|
@ -132,169 +134,181 @@ end
|
|||
%% Residual Reports
|
||||
% Countries
|
||||
for i=1:length(shortNames)
|
||||
rep = rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep.addSection();
|
||||
rep = ResidTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, trange, dates('2012q2'));
|
||||
end
|
||||
|
||||
% Commodities
|
||||
rep = rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep.addSection();
|
||||
rep = CommResidTablePage(rep, db_q, dc_q, trange, dates('2012q2'));
|
||||
|
||||
%% Commodities Graphs
|
||||
%Page 24
|
||||
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries');
|
||||
rep = rep.addSection();
|
||||
rep.addPage('title', 'Jan1 vs Jan2', ...
|
||||
'titleFormat', '\large\bfseries', ...
|
||||
'removeHeaderAndFooter', true);
|
||||
rep.addSection('height', '0.475\textheight');
|
||||
|
||||
rep = rep.addGraph('title', {'World Real Oil Price Index','SUBTITLE'}, ...
|
||||
rep.addGraph('title', {'World Real Oil Price Index','SUBTITLE'}, ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
'graphBar', true, ...
|
||||
'graphBarColor', 'red', ...
|
||||
'graphBarFillColor', 'gray', ...
|
||||
'graphBarWidth', 1);
|
||||
db_q = db_q.tex_rename('LRPOIL_WORLD', 'Oil Price');
|
||||
rep = rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
db_q.tex_rename_('LRPOIL_WORLD', 'Oil Price');
|
||||
rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphMarker', 'triangle*', ...
|
||||
'graphMarkerEdgeColor','black', ...
|
||||
'graphMarkerSize',4);
|
||||
db_q = db_q.tex_rename('LRPOIL_BAR_WORLD', 'Equilibrium Oil Price');
|
||||
rep = rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
db_q.tex_rename_('LRPOIL_BAR_WORLD', 'Equilibrium Oil Price');
|
||||
rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'green', ...
|
||||
'graphLineStyle', 'solid', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
|
||||
rep = rep.addGraph('title', 'World Real Food Price Index', ...
|
||||
rep.addGraph('title', 'World Real Food Price Index', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', 1:length(prange), ...
|
||||
'xTickLabels', strsplit(num2str(1:length(prange))), ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0, ...
|
||||
'showLegend', true, ...
|
||||
'legendAt', [.5,.5]);
|
||||
rep = rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
|
||||
'graphBar', true, ...
|
||||
'graphBarColor', 'green', ...
|
||||
'graphBarFillColor', 'yellow', ...
|
||||
'graphBarWidth', 1);
|
||||
db_q = db_q.tex_rename('LRPFOOD_WORLD', 'Food Price');
|
||||
rep = rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
db_q.tex_rename_('LRPFOOD_WORLD', 'Food Price');
|
||||
rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
db_q = db_q.tex_rename('LRPFOOD_BAR_WORLD', 'Equilibrium Food Price');
|
||||
rep = rep.addSeries('graphVline', dates('2009q2'), ...
|
||||
db_q.tex_rename_('LRPFOOD_BAR_WORLD', 'Equilibrium Food Price');
|
||||
rep.addSeries('graphVline', dates('2009q2'), ...
|
||||
'graphLineColor', 'red', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
% Page 25
|
||||
rep = rep.addPage('title', {'Jan1 vs Jan2', 'World Oil and Food Prices'}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'});
|
||||
rep = rep.addSection('cols', 1);
|
||||
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ...
|
||||
rep.addPage('title', {'Jan1 vs Jan2', 'World Oil and Food Prices'}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'}, ...
|
||||
'setPageNumber', 90);
|
||||
rep.addSection('cols', 1);
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', ...
|
||||
'cols', 2, ...
|
||||
'heading', '\textbf{My First Paragraph Has Two Columns}');
|
||||
|
||||
rep = rep.addSection('cols', 1);
|
||||
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\newline', ...
|
||||
rep.addSection('cols', 1);
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\newline', ...
|
||||
'heading', '\textbf{My Next Paragraphs Only Have One}', ...
|
||||
'indent', false);
|
||||
rep = rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\newline');
|
||||
rep.addParagraph('text', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\newline');
|
||||
|
||||
rep = rep.addSection('cols', 2);
|
||||
rep.addSection('cols', 2);
|
||||
|
||||
rep = rep.addGraph('title', 'World Real Oil Price', ...
|
||||
rep.addGraph('title', 'World Real Oil Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTicks', [1,5,10,15,find(srange(1)==prange),length(prange)], ...
|
||||
'xTickLabels',{startpoint{:},'2008Q1','2009Q2','2010Q3',shaded{:}, endpoint{:}},...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
rep.addSeries('data', db_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{'LRPOIL_WORLD'}, ...
|
||||
rep.addSeries('data', dc_q{'LRPOIL_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
srange1 = prange(1):forecast_date;
|
||||
rep = rep.addGraph('title', 'Equilibrium World Real Oil Price', ...
|
||||
rep.addGraph('title', 'Equilibrium World Real Oil Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange1);
|
||||
rep = rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
rep.addSeries('data', dc_q{'LRPOIL_BAR_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
rep = rep.addGraph('title', 'World Real Food Price', ...
|
||||
rep.addGraph('title', 'World Real Food Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'xTickLabels','ALL',...
|
||||
'xTickLabelRotation', 45,...
|
||||
'xAxisTight',false,...
|
||||
'yAxisTight',true);
|
||||
rep = rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
rep.addSeries('data', db_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('data', dc_q{'LRPFOOD_WORLD'}, ...
|
||||
rep.addSeries('data', dc_q{'LRPFOOD_WORLD'}, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5);
|
||||
rep = rep.addSeries('graphHline', 460, ...
|
||||
rep.addSeries('graphHline', 460, ...
|
||||
'graphLineColor', 'red', ...
|
||||
'graphLineWidth', 1.5);
|
||||
|
||||
a=dseries([1:200]', '1984q1');
|
||||
b=copy(a);
|
||||
c=copy(a);
|
||||
d=copy(a);
|
||||
b=dseries([1:200]', '1984q1');
|
||||
c=dseries([1:200]', '1984q1');
|
||||
d=dseries([1:200]', '1984q1');
|
||||
b(dates('2012q2'):dates('2015q2'))=b(dates('2012q2'):dates('2015q2'))+2;
|
||||
c(dates('2012q2'):dates('2015q2'))=c(dates('2012q2'):dates('2015q2'))+4;
|
||||
d(dates('2012q2'):dates('2015q2'))=d(dates('2012q2'):dates('2015q2'))+6;
|
||||
|
||||
rep = rep.addGraph('title', 'Equilibrium World Real Food Price', ...
|
||||
rep.addGraph('title', 'Equilibrium World Real Food Price', ...
|
||||
'xrange', prange, ...
|
||||
'shade', srange, ...
|
||||
'showLegend', true, ...
|
||||
'xTickLabelRotation', 0);
|
||||
rep = rep.addSeries('data', a, ...
|
||||
rep.addSeries('data', a, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'baseline', ...
|
||||
'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,color=red');
|
||||
rep = rep.addSeries('data', b, ...
|
||||
rep.addSeries('data', b, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphMiscTikzAddPlotOptions', 'mark=halfcircle*,mark options={rotate=90,scale=3}', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 40);
|
||||
rep = rep.addSeries('data', c, ...
|
||||
rep.addSeries('data', c, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 30);
|
||||
rep = rep.addSeries('data', d, ...
|
||||
rep.addSeries('data', d, ...
|
||||
'graphLineColor', 'blue', ...
|
||||
'graphLineStyle', 'dashed', ...
|
||||
'graphLineWidth', 1.5, ...
|
||||
'graphLegendName', 'control', ...
|
||||
'graphFanShadeColor', 'red', 'graphFanShadeOpacity', 20);
|
||||
|
||||
%% Page 26
|
||||
rep.addPage('title', {'report\_data test'}, ...
|
||||
'titleFormat', {'\large\bfseries', '\large'});
|
||||
rep.addSection('cols', 1);
|
||||
rep.addTable('title', {'Table Data 0', 'subtitle 2'});
|
||||
rep.addData('data', [repmat({'a'},10,1) num2cell(rand(10,6))]);
|
||||
rep.addVspace();
|
||||
rep.addSection('cols', 1);
|
||||
rep.addTable('title', {'Table Data 1', 'subtitle 3'});
|
||||
rep.addData('data', [repmat({'a'},10,1) repmat({'b'},10,1) num2cell(rand(10,1))], 'column_names', {'Name', '', 'Var2'});
|
||||
|
||||
%% Write & Compile Report
|
||||
rep.write();
|
||||
rep.compile();
|
||||
|
|
Loading…
Reference in New Issue