Commit a66adfea authored by Houtan Bastani's avatar Houtan Bastani
Browse files

add example code, slightly modified from DynareTeam/dynare.git tests/reporting

parent 0f778233
function rep = AnnualTable(rep, db_a, dc_a, seriesRootName, arange)
% Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
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', ...
'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}]});
delta = dc_a{[seriesRootName shortNames{i}]}-db_a{[seriesRootName shortNames{i}]};
delta = delta.tex_rename('$\Delta$');
rep = rep.addSeries('data', delta, ...
'tableShowMarkers', true, ...
'tableAlignRight', true);
end
end
\ No newline at end of file
function rep = CommResidTablePage(rep, db_q, dc_q, trange, vline_after)
% Copyright (C) 2013 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 <http://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 = rep.addTable('title', 'Commodities', ...
'range', trange, ...
'vlineAfter', vline_after);
for i=1:length(seriesNames)
rep = 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, ...
'tableShowMarkers', true, ...
'tableAlignRight', true);
end
end
function rep = CountryGraphPage(rep, countryAbbr, db_q, dc_q, prange, srange)
% Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
startpoint = strings(prange(1));
shaded = strings(srange(1));
endpoint = strings(prange(end));
rep = 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 = rep.addSeries('data', db_q{['RS_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['RS_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['Y_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['PCH_PIE4_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['PCH_PIE_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['PCH_GROWTH_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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 = rep.addSeries('data', db_q{['PCH_PIEX4_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{['PCH_PIEX4_' countryAbbr]}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
end
\ No newline at end of file
function rep = CountryTablePage(rep, countryAbbr, countryName, db_q, dc_q, db_a, dc_a, trange, vline_after)
% Copyright (C) 2013-2014 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 <http://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 = 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 = db_q.tex_rename([seriesNames{i}{1} countryAbbr], seriesNames{i}{2});
rep = 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$');
deltaa = db_a{[seriesNames{i}{1} countryAbbr]}-dc_a{[seriesNames{i}{1} countryAbbr]};
deltaa = delta.tex_rename('$\Delta$');
rep = rep.addSeries('data', delta, ...
'tableShowMarkers', true, ...
'tableRowIndent', 2, ...
'tableDataRhs', deltaa);
end
end
function rep = ResidTablePage(rep, countryAbbr, countryName, db_q, dc_q, trange, vline_after)
% Copyright (C) 2011-2013 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 <http://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 = 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 = 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, ...
'tableShowMarkers', true, ...
'tableAlignRight', true);
end
end
function createReport(dc_a, dc_q, db_a, db_q)
% Copyright (C) 2013-2014 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 <http://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();
%% Page 1: GDP
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
'titleFormat', '\large\bfseries');
rep = rep.addSection();
rep = rep.addVspace();
% Table 1
rep = 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);
% Table 2
rep = 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', ...
'titleFormat', '\large\bfseries');
rep = rep.addSection();
rep = rep.addVspace();
% Table 1
rep = 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);
% Table 2
rep = 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', ...
'titleFormat', '\large\bfseries');
rep = rep.addSection();
rep = rep.addVspace();
% Table 1
rep = 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);
% Table 2
rep = 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', ...
'titleFormat', '\large\bfseries');
rep = rep.addSection();
rep = rep.addVspace();
% Table 1
rep = 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);
% 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'});
delta = db_a{'Y_WORLD'}-dc_a{'Y_WORLD'};
delta = delta.tex_rename('$\Delta$');
rep = 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}}, ...
'titleFormat', {'\large\bfseries', '\large'});
rep = rep.addSection('cols', 5);
rep = CountryGraphPage(rep, shortNames{i}, db_q, dc_q, prange, srange);
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
'titleFormat', '\large\bfseries');
rep = 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 = rep.addPage('title', 'Residual Report Jan1 vs Jan2', ...
'titleFormat', '\large\bfseries');
rep = 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', ...
'titleFormat', '\large\bfseries');
rep = 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 = 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'}, ...
'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'}, ...
'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'}, ...
'graphLineColor', 'green', ...
'graphLineStyle', 'solid', ...
'graphLineWidth', 1.5);
rep = 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 = 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'}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
db_q = db_q.tex_rename('LRPFOOD_BAR_WORLD', 'Equilibrium Food Price');
rep = 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.', ...
'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', ...
'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 = rep.addSection('cols', 2);
rep = 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'}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = 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', ...
'xrange', prange, ...
'shade', srange1);
rep = rep.addSeries('data', db_q{'LRPOIL_BAR_WORLD'}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{'LRPOIL_BAR_WORLD'}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = 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'}, ...
'graphLineColor', 'blue', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('data', dc_q{'LRPFOOD_WORLD'}, ...
'graphLineColor', 'blue', ...
'graphLineStyle', 'dashed', ...
'graphLineWidth', 1.5);
rep = rep.addSeries('graphHline', 460, ...
'graphLineColor', 'red', ...
'graphLineWidth', 1.5);
rep = rep.addGraph('title', 'Equilibrium World Real Food Price', ...
'xrange', prange, ...
'shade', srange, ...
'showLegend', true, ...
'xTickLabelRotation', 0);
rep = rep.addSeries('data', db_q{'LRPFOOD_BAR_WORLD'}, ...
'graphLineColor', 'blue', ...