Commit 00a87039 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

update irf macro

parent 966bef71
function make_report_irfs(oo) function make_report_irfs(M, oo)
% Builds posterior IRFs after the MH algorithm. % Builds posterior IRFs after the MH algorithm.
% %
% INPUTS % INPUTS
...@@ -28,29 +28,44 @@ function make_report_irfs(oo) ...@@ -28,29 +28,44 @@ function make_report_irfs(oo)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://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
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 end
n6 = 1;
r = report(); r = report();
for i = 1:length(fields) for i = 1:length(M.exo_names)
if mod(i-1, 6) == 0 for j = 1:length(M.endo_names)
r = r.addPage('title', {'Canned Irf Report'}); if mod(n6 - 1, 6) == 0
r = r.addSection('cols', 2); r = r.addPage('title', {'Canned Irf Report'; ['shock ' M.exo_names(i)]});
end r = r.addSection('cols', 2);
r = r.addGraph('data', dseries(oo.irfs.(fields{i})'), ... n6 = 1;
'title', strrep(fields{i}, '_', '\_'), ... end
'titleFormat', '\Huge', ... idx = ismember(fields,[M.endo_names(j) '_' M.exo_names(i)]);
'showGrid', false, ... if any(idx)
'yTickLabelZeroFill', false, ... r = r.addGraph('data', dseries(oo.irfs.(fields{idx})'), ...
'showZeroLine', true, ... 'title', strrep(fields{idx}, '_', '\_'), ...
'zeroLineColor', 'red'); 'titleFormat', '\Huge', ...
'showGrid', false, ...
'yTickLabelZeroFill', false, ...
'showZeroLine', true, ...
'zeroLineColor', 'red');
n6 = n6 + 1;
end
end
end end
r.write(); r.write();
r.compile(); r.compile();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment