Fixed timing bugs in simulation of backward models with lags on exogenous variables.

time-shift
Stéphane Adjemian (Scylla) 2017-08-31 11:41:18 +02:00
parent 591a68bf50
commit 0efff7c185
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ A1 = jacob(:,nonzeros(DynareModel.lead_lag_incidence(1,:)));
B = jacob(:,end-nx+1:end);
% Simulations
for it = DynareModel.max_lag_orig+(1:samplesize)
for it = 1+(1:samplesize)
Y(:,it) = -A0inv*(cst + A1*Y(iy1,it-1) + B*DynareOutput.exo_simul(it,:)');
end

View File

@ -67,7 +67,7 @@ if ~DynareModel.max_exo_lag_orig
end
% Simulations (call a Newton-like algorithm for each period).
for it = DynareModel.max_lag_orig+(1:samplesize)
for it = 1+(1:samplesize)
ylag = Y(iy1,it-1); % Set lagged variables.
y = Y(:,it-1); % A good guess for the initial conditions is the previous values for the endogenous variables.
Y(:,it) = dynare_solve(model_dynamic_s, y, DynareOptions, model_dynamic, ylag, DynareOutput.exo_simul, DynareModel.params, DynareOutput.steady_state, it);