var_forecast test: update following changes

time-shift
Houtan Bastani 2016-11-29 17:14:22 +01:00 committed by Stéphane Adjemian (Charybdis)
parent e205c8813f
commit 858f26804f
2 changed files with 11 additions and 12 deletions

View File

@ -1,14 +1,6 @@
// Example 1 from Collard's guide to Dynare
var y, c, k, a, h, b;
varexo e, u;
verbatim;
% I want these comments included in
% example1.m 1999q1 1999y
%
var = 1;
end;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
@ -21,7 +13,7 @@ theta = 2.95;
phi = 0.1;
var_model(model_name=my_var_est, order=1) y c;
var_model(model_name=my_var_est, order=3) y;
model;
c*theta*h^(1+psi)=(1-alpha)*y;
@ -51,3 +43,4 @@ var e, u = phi*0.009*0.009;
end;
stoch_simul(order=1, periods=200);
write_latex_dynamic_model;

View File

@ -17,15 +17,21 @@ disp('VAR Estimation');
% MLS estimate of mu and B (autoregressive_matrices)
% Y = mu + B*Z
% from New Introduction to Multiple Time Series Analysis
Y = oo_.endo_simul(1:2, 2:end);
% Just y in order 3 var:
Y = oo_.endo_simul(1, 4:end);
Z = [ ...
ones(1, size(Y,2)); ...
oo_.endo_simul(1:2, 1:end-1); ...
oo_.endo_simul(1, 3:end-1); ...
oo_.endo_simul(1, 2:end-2); ...
oo_.endo_simul(1, 1:end-3); ...
];
%B = Y*Z'*inv(Z*Z');
B = Y*Z'/(Z*Z');
mu = B(:, 1);
autoregressive_matrices{1} = B(:, 2:end);
autoregressive_matrices{1} = B(:, 2);
autoregressive_matrices{2} = B(:, 3);
autoregressive_matrices{3} = B(:, 4);
% Sims
% (provides same result as above)