Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • data_tables_rewrite_tex_option_of_stoch_simul
  • dynare-5.x
  • master
3 results

Target

Select target project
  • Archives/reporting
  • sebastien/reporting
  • JohannesPfeifer/reporting
3 results
Select Git revision
  • data_tables_rewrite_tex_option_of_stoch_simul
  • dynare-5.x
  • master
3 results
Show changes

Commits on Source 2

function make_report_irfs(M, oo, ticks_every, showOutput) function make_report_irfs(M_, oo_, ticks_every, showOutput)
% Builds canned IRF report % Builds canned IRF report
% %
% INPUTS % INPUTS
% M [struct] % M_ [struct]
% oo [struct] % oo_ [struct]
% ticks_every [int] number of spaces between ticks. Default 5. % ticks_every [int] number of spaces between ticks. Default 5.
% showOutput [bool] showOutput the report. Default true % showOutput [bool] showOutput the report. Default true
% %
...@@ -13,7 +13,7 @@ function make_report_irfs(M, oo, ticks_every, showOutput) ...@@ -13,7 +13,7 @@ function make_report_irfs(M, oo, ticks_every, showOutput)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% None % None
% Copyright © 2015-2018 Dynare Team % Copyright © 2015-2023 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -30,24 +30,24 @@ function make_report_irfs(M, oo, ticks_every, showOutput) ...@@ -30,24 +30,24 @@ function make_report_irfs(M, oo, ticks_every, showOutput)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. % along with Dynare. If not, see <https://www.gnu.org/licenses/>.
if ~isfield(oo, 'irfs') if ~isfield(oo_, 'irfs')
disp('make_report_irfs: oo_.irfs does not exist'); disp('make_report_irfs: oo_.irfs does not exist');
return return
end end
fields = fieldnames(oo.irfs); fields = fieldnames(oo_.irfs);
if isempty(fields) if isempty(fields)
disp('make_report_irfs: oo_.irfs is empty'); disp('make_report_irfs: oo_.irfs is empty');
return return
end end
if ~isfield(M, 'exo_names') if ~isfield(M_, 'exo_names')
disp('make_report_irfs: M_.exo_names does not exist'); disp('make_report_irfs: M_.exo_names does not exist');
return return
end end
if ~isfield(M, 'endo_names') if ~isfield(M_, 'endo_names')
disp('make_report_irfs: M_.endo_names does not exist'); disp('make_report_irfs: M_.endo_names does not exist');
return return
end end
if ~isfield(M, 'fname') if ~isfield(M_, 'fname')
disp('make_report_irfs: M_.fname does not exist'); disp('make_report_irfs: M_.fname does not exist');
return return
end end
...@@ -65,15 +65,15 @@ end ...@@ -65,15 +65,15 @@ end
n6 = 1; n6 = 1;
justAddedPage = 0; justAddedPage = 0;
calcxticks = false; calcxticks = false;
r = report('filename', [M.fname '_canned_irf_report.tex'], 'showOutput', showOutput); r = report('filename', [M_.fname '_canned_irf_report.tex'], 'showOutput', showOutput);
for i = 1:length(M.exo_names) for i = 1:length(M_.exo_names)
newexo = 1; newexo = 1;
for j = 1:length(M.endo_names) for j = 1:length(M_.endo_names)
idx = ismember(fields, [M.endo_names{j} '_' M.exo_names{i}]); idx = ismember(fields, [M_.endo_names{j} '_' M_.exo_names{i}]);
if (mod(n6 - 1, 6) == 0 && ~justAddedPage) || ... if (mod(n6 - 1, 6) == 0 && ~justAddedPage) || ...
(newexo && any(idx)) (newexo && any(idx))
r = r.addPage('title', {'Canned Irf Report'; ['shock ' ... r = r.addPage('title', {'Canned Irf Report'; ['shock ' ...
strrep(M.exo_names{i},'_','\_')]}); strrep(M_.exo_names{i},'_','\_')]});
r = r.addSection('cols', 2); r = r.addSection('cols', 2);
n6 = 1; n6 = 1;
justAddedPage = 1; justAddedPage = 1;
...@@ -81,13 +81,13 @@ for i = 1:length(M.exo_names) ...@@ -81,13 +81,13 @@ for i = 1:length(M.exo_names)
end end
if any(idx) if any(idx)
if ~calcxticks if ~calcxticks
data = dseries(oo.irfs.(fields{idx})'); data = dseries(oo_.irfs.(fields{idx})');
xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1; xTicks = 1:ticks_every:floor(data.nobs/ticks_every)*ticks_every+1;
xTickLabels = regexp(num2str(xTicks-1), '(?:\s)+', 'split'); xTickLabels = regexp(num2str(xTicks-1), '(?:\s)+', 'split');
calcxticks = true; calcxticks = true;
end end
r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ... r = r.addGraph('data', dseries(oo_.irfs.(fields{idx})'), ...
'title', M.endo_names{j}, '_', '\_'), ... 'title', M_.endo_names{j}, '_', '\_'), ...
'titleFormat', '\Huge', ... 'titleFormat', '\Huge', ...
'showGrid', false, ... 'showGrid', false, ...
'yTickLabelZeroFill', false, ... 'yTickLabelZeroFill', false, ...
......