Skip to content
Snippets Groups Projects
Verified Commit e576dc8c authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Block decomposition: fix evaluation of recursive variables in solved blocks

Ref. #1726
parent a69d598b
No related branches found
No related tags found
No related merge requests found
Pipeline #4244 passed
...@@ -92,9 +92,10 @@ for it_=start:incr:finish ...@@ -92,9 +92,10 @@ for it_=start:incr:finish
g1=spalloc( Blck_size, Blck_size, nze); g1=spalloc( Blck_size, Blck_size, nze);
while ~(cvg==1 || iter>maxit_) while ~(cvg==1 || iter>maxit_)
if is_dynamic if is_dynamic
[r, ~, T(:, it_), g1] = feval(fname, Block_Num, dynvars_from_endo_simul(y, it_, M), x, params, steady_state, T(:, it_), it_, false); [r, yy, T(:, it_), g1] = feval(fname, Block_Num, dynvars_from_endo_simul(y, it_, M), x, params, steady_state, T(:, it_), it_, false);
y(:, it_) = yy(M.lead_lag_incidence(M.maximum_endo_lag+1,:));
else else
[r, ~, T, g1] = feval(fname, Block_Num, y, x, params, T); [r, y, T, g1] = feval(fname, Block_Num, y, x, params, T);
end end
if ~isreal(r) if ~isreal(r)
max_res=(-(max(max(abs(r))))^2)^0.5; max_res=(-(max(max(abs(r))))^2)^0.5;
......
...@@ -83,7 +83,8 @@ while ~(cvg==1 || iter>maxit_) ...@@ -83,7 +83,8 @@ while ~(cvg==1 || iter>maxit_)
r = NaN(Blck_size, periods); r = NaN(Blck_size, periods);
g1a = spalloc(Blck_size*periods, Blck_size*periods, nze*periods); g1a = spalloc(Blck_size*periods, Blck_size*periods, nze*periods);
for it_ = y_kmin+(1:periods) for it_ = y_kmin+(1:periods)
[r(:, it_-y_kmin), ~, T(:, it_), g1]=feval(fname, Block_Num, dynvars_from_endo_simul(y, it_, M), x, params, steady_state, T(:, it_), it_, false); [r(:, it_-y_kmin), yy, T(:, it_), g1]=feval(fname, Block_Num, dynvars_from_endo_simul(y, it_, M), x, params, steady_state, T(:, it_), it_, false);
y(:, it_) = yy(M.lead_lag_incidence(M.maximum_endo_lag+1,:));
if periods == 1 if periods == 1
g1a = g1(:, Blck_size+(1:Blck_size)); g1a = g1(:, Blck_size+(1:Blck_size));
elseif it_ == y_kmin+1 elseif it_ == y_kmin+1
......
Subproject commit e4687bb97616a19432e1b46565b6b6065276b657 Subproject commit 4560639eb4035448cc8adc4535a1957fa82924ab
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment