Skip to content
This repository has been archived by the owner. It is now read-only.

Fix unconditional_forecast values derived from conditional_forecast command #655

Closed
JohannesPfeifer opened this issue May 17, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@JohannesPfeifer
Copy link
Contributor

commented May 17, 2014

The unconditional_forecast-command seems to produce incorrect forecasts when used together with initval. This can be seen in the following mod-file where it yields different results than the forecast-command (which appear sensible).

// See fs2000.mod in the examples/ directory for details on the model

var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;

parameters alp bet gam mst rho psi del;

alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;

model;
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
-P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
W = l/n;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
P*c = m;
m-1+d = l;
e = exp(e_a);
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
gy_obs = dA*y/y(-1);
gp_obs = (P/P(-1))*m(-1)/dA;
end;

initval;
k = 6;
m = mst;
P = 2.25;
c = 0.45;
e = 1;
W = 4;
R = 1.02;
d = 0.85;
n = 0.19;
l = 0.86;
y = 0.6;
gy_obs = exp(gam);
gp_obs = exp(-gam);
dA = exp(gam);
end;

shocks;
var e_a; stderr 0.014;
var e_m; stderr 0.005;
end;

steady;

check;

stoch_simul(irf=0);

conditional_forecast_paths;
var gy_obs;
periods  1  2  3:5;
values   0.01 -0.02 0;
var gp_obs;
periods 1:5;
values  0.05;
end;

initval;
k = 6;
m = mst;
P = 2.25;
c = 0.45;
e = 1;
W = 4;
R = 1.02;
d = 0.85;
n = 0.19;
l = 0.86;
y = 0.6;
gy_obs = exp(gam);
gp_obs = exp(-gam);
dA = exp(gam);
end;

conditional_forecast(parameter_set=calibration, controlled_varexo=(e_a,e_m));

plot_conditional_forecast(periods=10) gy_obs gp_obs;
forecast(periods=40);

The problem seems to come from lines 139-143 of imcforecast where the initial values are supposed to be translated into deviations from steady state:

else
    InitState(:,1) = zeros(M_.endo_nbr,1);
    trend = repmat(oo_.steady_state(oo_.dr.order_var),1,options_cond_fcst.periods+1);
    graph_title='Calibration';
end

However, the initial state is always 0, regardless of the initial values given in initval. Rather the initial values appear in trend and are later added to the forecasts. As a result, if started outside of steady state, there is no tendency of forecasts to return to steady state. This is exactly what can be seen in the flat forecasts in forecasts.uncond.Mean in the above mod-file. In contrast, the forecast-command yields the correct return to steady state.

My reading is that the problem also affects the conditional forecasts.

See also http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5617

@svillemot svillemot added the bug label May 19, 2014

@svillemot svillemot added this to the 4.5 milestone May 19, 2014

JohannesPfeifer pushed a commit to JohannesPfeifer/dynare that referenced this issue Jul 17, 2014

Johannes Pfeifer
Account for initial values when making conditional forecasts
- Closes DynareTeam#655
- Implements unit test
- Saves distribution of controlled exogenous variables
- Adds information that the full path of constrained variables must be specified

JohannesPfeifer added a commit to JohannesPfeifer/dynare that referenced this issue Jun 8, 2015

Account for initial values when making conditional forecasts
- Closes DynareTeam#655
- Implements unit test
- Saves distribution of controlled exogenous variables
- Adds information that the full path of constrained variables must be specified
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.