From 858f26804f18880587d8862a866bb58c0baa7779 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 29 Nov 2016 17:14:22 +0100 Subject: [PATCH] var_forecast test: update following changes --- tests/ECB/example1_var.mod | 11 ++--------- tests/ECB/run_var_comparison.m | 12 +++++++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/ECB/example1_var.mod b/tests/ECB/example1_var.mod index b1d705548..07b8afbc1 100644 --- a/tests/ECB/example1_var.mod +++ b/tests/ECB/example1_var.mod @@ -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; \ No newline at end of file diff --git a/tests/ECB/run_var_comparison.m b/tests/ECB/run_var_comparison.m index 942ffe92e..711df1d71 100644 --- a/tests/ECB/run_var_comparison.m +++ b/tests/ECB/run_var_comparison.m @@ -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)