var test, add estimation for nkm model, fix plotting

time-shift
Houtan Bastani 2016-12-28 12:48:30 +01:00 committed by Stéphane Adjemian (Charybdis)
parent a248d9b51f
commit 0a017dd1bb
1 changed files with 15 additions and 4 deletions

View File

@ -13,7 +13,7 @@ save('nkm_saved_data.mat')
%% Estimate VAR using simulated data
disp('VAR Estimation');
%% UNCOMMENT IF RUNNING EXAMPLE1
% MLS estimate of mu and B (autoregressive_matrices)
% Y = mu + B*Z
% from New Introduction to Multiple Time Series Analysis
@ -33,6 +33,17 @@ autoregressive_matrices{1} = B(:, 2:3);
autoregressive_matrices{2} = B(:, 4:5);
autoregressive_matrices{3} = B(:, 6:7);
%% UNCOMMENT IF RUNNING ESTIMATION FOR NKM
% % FOR NKM
% Y = oo_.endo_simul(2:3, 2:end);
% Z = [ ...
% ones(1, size(Y,2)); ...
% oo_.endo_simul(2:3, 1:end-1); ...
% ];
% B = Y*Z'/(Z*Z');
% mu = B(:, 1);
% autoregressive_matrices{1} = B(:, 2:3);
% Sims
% (provides same result as above)
% var = rfvar3(Y',1,zeros(size(Y')),0,5,2)
@ -66,9 +77,9 @@ for i = 1:length(exo_names)
for j = 1:length(endo_names)
subplot(ridx, cidx, j);
hold on
title(endo_names(j));
plot(nv.oo_.irfs.([endo_names(j) '_' exo_names(i)]));
plot(wv.oo_.irfs.([endo_names(j) '_' exo_names(i)]), '--');
title(endo_names(j,:));
plot(nv.oo_.irfs.([deblank(endo_names(j,:)) '_' deblank(exo_names(i,:))]));
plot(wv.oo_.irfs.([deblank(endo_names(j,:)) '_' deblank(exo_names(i,:))]), '--');
hold off
end
end