var test, add estimation for nkm model, fix plotting
parent
a248d9b51f
commit
0a017dd1bb
|
@ -13,7 +13,7 @@ save('nkm_saved_data.mat')
|
||||||
%% Estimate VAR using simulated data
|
%% Estimate VAR using simulated data
|
||||||
disp('VAR Estimation');
|
disp('VAR Estimation');
|
||||||
|
|
||||||
|
%% UNCOMMENT IF RUNNING EXAMPLE1
|
||||||
% MLS estimate of mu and B (autoregressive_matrices)
|
% MLS estimate of mu and B (autoregressive_matrices)
|
||||||
% Y = mu + B*Z
|
% Y = mu + B*Z
|
||||||
% from New Introduction to Multiple Time Series Analysis
|
% 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{2} = B(:, 4:5);
|
||||||
autoregressive_matrices{3} = B(:, 6:7);
|
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
|
% Sims
|
||||||
% (provides same result as above)
|
% (provides same result as above)
|
||||||
% var = rfvar3(Y',1,zeros(size(Y')),0,5,2)
|
% 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)
|
for j = 1:length(endo_names)
|
||||||
subplot(ridx, cidx, j);
|
subplot(ridx, cidx, j);
|
||||||
hold on
|
hold on
|
||||||
title(endo_names(j));
|
title(endo_names(j,:));
|
||||||
plot(nv.oo_.irfs.([endo_names(j) '_' exo_names(i)]));
|
plot(nv.oo_.irfs.([deblank(endo_names(j,:)) '_' deblank(exo_names(i,:))]));
|
||||||
plot(wv.oo_.irfs.([endo_names(j) '_' exo_names(i)]), '--');
|
plot(wv.oo_.irfs.([deblank(endo_names(j,:)) '_' deblank(exo_names(i,:))]), '--');
|
||||||
hold off
|
hold off
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue