var_forecast test: update following changes
parent
e205c8813f
commit
858f26804f
|
@ -1,14 +1,6 @@
|
||||||
// Example 1 from Collard's guide to Dynare
|
// Example 1 from Collard's guide to Dynare
|
||||||
var y, c, k, a, h, b;
|
var y, c, k, a, h, b;
|
||||||
varexo e, u;
|
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;
|
parameters beta, rho, alpha, delta, theta, psi, tau;
|
||||||
|
|
||||||
alpha = 0.36;
|
alpha = 0.36;
|
||||||
|
@ -21,7 +13,7 @@ theta = 2.95;
|
||||||
|
|
||||||
phi = 0.1;
|
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;
|
model;
|
||||||
c*theta*h^(1+psi)=(1-alpha)*y;
|
c*theta*h^(1+psi)=(1-alpha)*y;
|
||||||
|
@ -51,3 +43,4 @@ var e, u = phi*0.009*0.009;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
stoch_simul(order=1, periods=200);
|
stoch_simul(order=1, periods=200);
|
||||||
|
write_latex_dynamic_model;
|
|
@ -17,15 +17,21 @@ disp('VAR Estimation');
|
||||||
% 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
|
||||||
Y = oo_.endo_simul(1:2, 2:end);
|
|
||||||
|
% Just y in order 3 var:
|
||||||
|
Y = oo_.endo_simul(1, 4:end);
|
||||||
Z = [ ...
|
Z = [ ...
|
||||||
ones(1, size(Y,2)); ...
|
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'*inv(Z*Z');
|
||||||
B = Y*Z'/(Z*Z');
|
B = Y*Z'/(Z*Z');
|
||||||
mu = B(:, 1);
|
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
|
% Sims
|
||||||
% (provides same result as above)
|
% (provides same result as above)
|
||||||
|
|
Loading…
Reference in New Issue