Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
naffe15 committed Jun 11, 2021
1 parent c23e6f8 commit a103646
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
Binary file modified HitchhikerGuide_.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/BVAR tutorial/example_11_connectedness.m
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
%%


step_plot = 150;
step_plot = 200;
tmp_str = b(tstart:step_plot:end,1);

figure('Name','Rolling Connectedness Index')
Expand All @@ -306,7 +306,7 @@
set(gca,'Xticklabel',tmp_str)
title('Rolling Connectedness Index')
axis tight
ylim([90 99])
ylim([88 99])
legend('Ridge','Lasso','ElasticNet')
STR_RECAP = [ dirname '/RolllingIndex'];
saveas(gcf,STR_RECAP,'fig');
Expand Down
34 changes: 30 additions & 4 deletions examples/BVAR tutorial/example_3_irf.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,31 @@

%% Extra part 2): Historical Decomposition
% VAR with zero-sign restrictions
clear all
load DataGK
y = [logip logcpi gs1 ebp];
lags = 12;


% specify the restrictions
% 1) ad = aggregate demand disturbance [sign restrictions]
options.zeros_signs{1} = 'y(1,1)=1;';
options.zeros_signs{end+1} = 'y(2,1)=1;';
options.zeros_signs{end+1} = 'y(3,1)=1;';
% 2) as = aggregate supply shock [sign restrictions]
options.zeros_signs{end+1} = 'y(1,2)=1;';
options.zeros_signs{end+1} = 'y(2,2)=-1;';
% 3) mp = monetary policy shock, no cont response of prices and quantities
% [zero restrictions]
options.zeros_signs{end+1} = 'ys(1,3)= 0;';
options.zeros_signs{end+1} = 'ys(2,3)=0;';
% 3) mp = rate and bond premium go up [sign restrictions]
options.zeros_signs{end+1} = 'y(3,3)=1;';
options.zeros_signs{end+1} = 'y(4,3)=1;';
% run the BVAR
bvar4 = bvar_(y,lags,options);



% uses the zero-sign restrictions average rotation
opts_.Omega = mean(bvar4.Omegaz,3);
Expand Down Expand Up @@ -300,12 +325,13 @@

%% Extra part 3): Minnesota Priors IRF

%clear all
clear options
%load DataGK
%y = [logip logcpi gs1 ebp];
clear all

load DataGK
y = [logip logcpi gs1 ebp];
lags = 12;
options.hor = 48;
bvar1 = bvar_(y,lags,options);
options.presample = 12;
options.prior.name = 'Minnesota';
options.minn_prior_tau = 0.5;
Expand Down
Binary file removed examples/BVAR tutorial/g1.mat
Binary file not shown.

0 comments on commit a103646

Please sign in to comment.