18.06.2013 Views

Measuring the Effects of a Shock to Monetary Policy - Humboldt ...

Measuring the Effects of a Shock to Monetary Policy - Humboldt ...

Measuring the Effects of a Shock to Monetary Policy - Humboldt ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

102 Bayesian FAVARs with Agnostic Identification<br />

end%for<br />

F_reg = F_reg(:,:);<br />

F_reg = F_reg(d+1:T,:);<br />

% For doing inference on <strong>the</strong> Transition equation one has <strong>to</strong> first draw Q and <strong>the</strong> draw vec(Phi)<br />

% Note that for generalization it is good <strong>to</strong> write [kappa1_prior,kappa2_prior; kappa1_post and kappa1_post]<br />

% shortcuts<br />

VV = V_hat’*V_hat;<br />

FF_reg = inv(F_reg’*F_reg);<br />

Phi_FF = inv(Omega_prior + FF_reg);<br />

% Draw posterior Q<br />

Q_bar = Q_prior + VV + Phi_hat’*Phi_FF*Phi_hat;<br />

kappa1_prior = K+M+2;<br />

kappa1_post = T+kappa1_prior;<br />

kappa2_prior = Q_prior;<br />

kappa2_post = Q_bar; % Scale Matrix<br />

% Inverse Wishart draw<br />

% df = degrees <strong>of</strong> freedom<br />

%QW = wishrnd(inv(kappa2_post),kappa1_post);<br />

%Q_draw = inv(QW); % =1 % 0.999<br />

end<br />

vec_Phi_draw = mvnrnd(vecPhi_posterior,sigma_Phi,1);<br />

Phi_draw = reshape(vec_Phi_draw’,d*(K+M),(K+M))’;<br />

calculation.stateSpaceStructure.Phi_bar(1:K+M,:) = Phi_draw;<br />

Phi_draw = reshape(Phi_draw,K+M,K+M,d);<br />

%%%%% set param_prec_obs output structure<br />

param_prec_fac.Q_draw = Q_draw;<br />

param_prec_fac.Phi_draw = Phi_draw;<br />

%%%%%%**********************************************************%%%%%<br />

%%%%%% Bayesian FAVAR Code August 26th %%%%%

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!