Commit 9d4385da authored by Stéphane Adjemian (Charybdis)'s avatar Stéphane Adjemian (Charybdis)
Browse files

Put back M_.maximum_lag.

parent dfbbc415
......@@ -36,7 +36,7 @@ global M_ options_
iter = size(ex_,1);
y_ = zeros(size(y0,1),iter+1);
y_ = zeros(size(y0,1),iter+M_.maximum_lag);
y_(:,1) = y0;
if ~options_.k_order_solver
......@@ -67,18 +67,18 @@ if options_.k_order_solver% Call dynare++ routines.
mexErrCheck('dynare_simul_', err);
y_(dr.order_var,:) = y_;
else
k2 = dr.kstate(find(dr.kstate(:,2) <= 1+1),[1 2]);
k2 = k2(:,1)+(1+1-k2(:,2))*M_.endo_nbr;
k2 = dr.kstate(find(dr.kstate(:,2) <= 1+M_.maximum_lag),[1 2]);
k2 = k2(:,1)+(M_.maximum_lag+1-k2(:,2))*M_.endo_nbr;
switch iorder
case 1
if isempty(dr.ghu)
for i = 2:iter+1
for i = 2:iter+M_.maximum_lag
yhat = y_(dr.order_var(k2),i-1);
y_(dr.order_var,i) = dr.ghx*yhat;
end
else
epsilon = dr.ghu*transpose(ex_); clear('ex_');
for i = 2:iter+1
for i = 2:iter+M_.maximum_lag
yhat = y_(dr.order_var(k2),i-1);
y_(dr.order_var,i) = dr.ghx*yhat + epsilon(:,i-1);
end
......@@ -88,7 +88,7 @@ else
constant = dr.ys(dr.order_var)+.5*dr.ghs2;
if options_.pruning
y__ = y0;
for i = 2:iter+1
for i = 2:iter+M_.maximum_lag
yhat1 = y__(dr.order_var(k2))-dr.ys(dr.order_var(k2));
yhat2 = y_(dr.order_var(k2),i-1)-dr.ys(dr.order_var(k2));
epsilon = ex_(i-1,:)';
......@@ -103,7 +103,7 @@ else
y__(dr.order_var) = dr.ys(dr.order_var) + dr.ghx*yhat1 + dr.ghu*epsilon;
end
else
for i = 2:iter+1
for i = 2:iter+M_.maximum_lag
yhat = y_(dr.order_var(k2),i-1)-dr.ys(dr.order_var(k2));
epsilon = ex_(i-1,:)';
[err, abcOut1] = A_times_B_kronecker_C(.5*dr.ghxx,yhat,options_.threads.kronecker.A_times_B_kronecker_C);
......
Supports Markdown
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