Hello DynareUser1
for example, type
dynare DSGE.mod noclearall
You will notice there are a lot of data generated in your MATLAB workspace, especially one document called oo_
.
Then input:
DSGEresults = oo_;
save DSGEresults;
These two commands prevent you from losing your data. Sometimes you may run extra documents, like DSGE2.m
, DSGE2.mod
, DSGE3.m
, DSGE3.mod
, etc. If at the beginning of these codes you have clear all
; close all
; then previous outputs oo_
will be deleted, but DSGEresults
still maintain.
Similarly,
DSGEresults2 = oo_;
save DSGEresults2;
and
DSGEresults3 = oo_;
save DSGEresults3;
Now letâs plot figures
In a new m-file, without loss of generality, name it as figure_irf.m
clear all;
close all;
load DSGEresults.mat;
load DSGEresults2.mat;
load DSGEresutls3.mat;
figure;
subplot(1,2,1)
plot(DSGEresults.irfs.Consumption_zA * 100, ':', 'Linewidth', 1, 'Color', [0,0.5,1]);
hold all
plot(DSGEresults2.irfs.Consumption_zA * 100, '--', 'LineWidth',1, 'Color', [0.5,1,0]);
hold all
plot(DSGEresults3.irfs.Consumption_zA*100, '-', 'LineWidth',1, 'Color', [1,0,0.5]);
title('Consumption','FontName','Times New Roman');
subplot(1,2,2)
plot(DSGEresults.irfs.Consumption_zA * 100, ':', 'Linewidth', 1, 'Color', [0,0.5,1]);
hold all
plot(DSGEresults.irfs.Consumption_zG * 100, '--', 'LineWidth',1, 'Color', [0.5,1,0]);
hold all
plot(DSGEresults.irfs.Consumption_zYf *100, '-', 'LineWidth',1, 'Color', [1,0,0.5]);
title('Consumption','FontName','Times New Roman');
The first subplot is for productivity shock zA
in all 3 cases; the second subplot is for shocks zA
, zG
, and zYf
in the first case DSGE.
There are indeed many alternative ways to plot IRFs. You can collect them from Dynare forum, or from authorsâ or journalsâ websites.
Cheers!