Commit f0d8b642 authored by Marco Ratto's avatar Marco Ratto
Browse files

bug fixes in retrieving the k-step ahead predictions from occbin simulations

parent afe966d0
......@@ -430,7 +430,7 @@ else
% period ahead (so if regimestart was [1 5] it should be [1 4]
% in out
% end
bbb(oo_.dr.inv_order_var,k) = out.piecewise(1,:);
bbb(oo_.dr.inv_order_var,k) = out.piecewise(1,:) - out.ys';
end
end
% do not overwrite accurate computations using reduced st. space
......@@ -475,7 +475,7 @@ else
% in out
% end
for jnk=1:options_.nk
aaa(jnk,oo_.dr.inv_order_var,k+jnk-1) = out.piecewise(jnk,:);
aaa(jnk,oo_.dr.inv_order_var,k+jnk-1) = out.piecewise(jnk,:) - out.ys';
end
end
aK=aaa;
......
......@@ -433,7 +433,7 @@ while notsteady && t<smpl
Pf = P(:,:,t+1);
end
aK(1,:,t+1) = a1(:,t+1);
if ~isempty(nk) && nk>1 && isoccbin
if ~isempty(nk) && nk>1 && isoccbin && (t>=first_period_occbin_update || isinf(first_period_occbin_update))
opts_simul = occbin_options.opts_regime;
opts_simul.SHOCKS = zeros(nk,M_.exo_nbr);
if smoother_redux
......@@ -455,11 +455,11 @@ while notsteady && t<smpl
end
PK(jnk,:,:,t+jnk) = Pf;
end
if isoccbin
if isoccbin && (t>=first_period_occbin_update || isinf(first_period_occbin_update))
if smoother_redux
aK(jnk,:,t+jnk) = out.piecewise(jnk,oo_.dr.order_var(oo_.dr.restrict_var_list));
aK(jnk,:,t+jnk) = out.piecewise(jnk,oo_.dr.order_var(oo_.dr.restrict_var_list)) - out.ys(oo_.dr.order_var(oo_.dr.restrict_var_list))';
else
aK(jnk,oo_.dr.inv_order_var,t+jnk) = out.piecewise(jnk,:);
aK(jnk,oo_.dr.inv_order_var,t+jnk) = out.piecewise(jnk,:) - out.ys';
end
elseif jnk>1
aK(jnk,:,t+jnk) = T*dynare_squeeze(aK(jnk-1,:,t+jnk-1));
......
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