Commit 14eb831c authored by Sébastien Villemot's avatar Sébastien Villemot

Fix forecast command with deterministic exogenous and linear option

Closes #1608

(cherry picked from commit fda02185)
parent 5cdd420d
......@@ -151,12 +151,17 @@ else
elseif horizon <= exo_det_length
ex = zeros(exo_det_length,M.exo_nbr);
end
if options.linear
iorder = 1;
else
iorder = options.order;
end
if isequal(M.H,0)
[yf,int_width] = simultxdet(y0,ex,oo.exo_det_simul,...
options.order,var_list,M,oo,options);
iorder,var_list,M,oo,options);
else
[yf,int_width,int_width_ME] = simultxdet(y0,ex,oo.exo_det_simul,...
options.order,var_list,M,oo,options);
iorder,var_list,M,oo,options);
end
end
......
......@@ -295,6 +295,7 @@ MODFILES = \
stochastic_purely_forward/stochastic_purely_forward.mod \
stochastic_purely_forward/stochastic_purely_forward_with_static.mod \
forecast/Hansen_exo_det_forecast.mod \
forecast/linear_exo_det_forecast.mod \
forecast/ls2003_rolling_window_forecast.mod \
gradient/fs2000_numgrad_13.mod \
gradient/fs2000_numgrad_15.mod \
......
// Regression test for issue #1608 (combining forecast, varexo_det and linear)
var y, pi, i, g, u, k;
varexo e_g e_u e_k;
varexo_det gov;
parameters lambda, pi_target, y_target, phi_pi, phi, rho, rhoout, rhopi, rhoint, sigma1, sigma2, sigma3;
lambda = 0.3;
pi_target = 0;
y_target = 0;
phi_pi = 1.5;
phi = 1;
rho = 0.99;
T = 50;
rhoout = 0.8;
rhopi = 0.5;
rhoint = 0;
sigma1 = 1;
sigma2 = 1;
sigma3 = 1;
model(linear);
y=y(+1)-phi*(i-pi(+1))+gov+g;
pi=lambda*y+rho*pi(+1)+u;
i=phi_pi*(pi-pi_target)+k;
g=rhoout*g(-1)+e_g;
u=rhopi*u(-1)+e_u;
k=rhoint*k(-1)+e_k;
end;
steady;
check;
shocks;
var e_g;
stderr sigma1;
var e_u;
stderr sigma2;
var e_k;
stderr sigma3;
var gov;
periods 1:9;
values 0.2;
end;
stoch_simul(irf=0);
forecast;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment