Correction of bugs in the Jacobian matrix for the a purely backward looking non recursive block

time-shift
Ferhat Mihoubi 2011-10-28 22:45:07 +02:00
parent d336bb00a0
commit 01ef553956
1 changed files with 4 additions and 4 deletions

View File

@ -329,7 +329,7 @@ for i = 1:Size;
dr.eigval = [dr.eigval ; data(i).eigval]; dr.eigval = [dr.eigval ; data(i).eigval];
if task ~= 1 if task ~= 1
if (maximum_lag > 0) if (maximum_lag > 0)
ghx = - jacob(1 , 1 : n_pred) / jacob(1 , n_pred + n_static + 1 : n_pred + n_static + n_pred + n_both); ghx = - jacob(: , 1 : n_pred) / jacob(: , n_pred + n_static + 1 : n_pred + n_static + n_pred + n_both);
else else
ghx = 0; ghx = 0;
end; end;
@ -354,7 +354,7 @@ for i = 1:Size;
l_x_sv = dr.ghx(dr.state_var, 1:n_sv); l_x_sv = dr.ghx(dr.state_var, 1:n_sv);
selector_tm1 = M_.block_structure.block(i).tm1; selector_tm1 = M_.block_structure.block(i).tm1;
ghx_other = - (fx_t * l_x + (fx_tp1 * l_x * l_x_sv) + fx_tm1 * selector_tm1) / jacob(1 , n_pred + 1 : n_pred + n_static + n_pred + n_both); ghx_other = - (fx_t * l_x + (fx_tp1 * l_x * l_x_sv) + fx_tm1 * selector_tm1) / jacob(: , n_pred + 1 : n_pred + n_static + n_pred + n_both);
dr.ghx(endo, :) = dr.ghx(endo, :) + ghx_other; dr.ghx(endo, :) = dr.ghx(endo, :) + ghx_other;
end; end;
if exo_nbr if exo_nbr
@ -365,10 +365,10 @@ for i = 1:Size;
l_u = dr.ghu(data(i).other_endogenous,:); l_u = dr.ghu(data(i).other_endogenous,:);
fu_complet = zeros(n, M_.exo_nbr); fu_complet = zeros(n, M_.exo_nbr);
fu_complet(:,data(i).exogenous) = fu; fu_complet(:,data(i).exogenous) = fu;
ghu = -(fu_complet + fx_tp1 * l_x * l_u_sv + (fx_t) * l_u ) / jacob(1 , n_pred + 1 : n_pred + n_static + n_pred + n_both); ghu = -(fu_complet + fx_tp1 * l_x * l_u_sv + (fx_t) * l_u ) / jacob(: , n_pred + 1 : n_pred + n_static + n_pred + n_both);
exo = dr.exo_var; exo = dr.exo_var;
else else
ghu = - fu / jacob(1 , n_pred + 1 : n_pred + n_static + n_pred + n_both); ghu = - fu / jacob(: , n_pred + 1 : n_pred + n_static + n_pred + n_both);
end; end;
else else
if other_endo_nbr > 0 if other_endo_nbr > 0