Commit b9c7cff8 authored by michel's avatar michel
Browse files

v4: ramsey_dynamic.m bug correction;

dr1.m: save jacobian on options_.debug == 1

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1168 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 44093cbb
......@@ -97,6 +97,10 @@ else
tempex = [];
end
if options_.debug
save([M_.fname '_debug'],'jacobia_')
end
dr=set_state_space(dr);
kstate = dr.kstate;
kad = dr.kad;
......
No preview for this file type
......@@ -95,12 +95,12 @@ function J = ramsey_dynamic(ys,lbar)
i_mult(k) = n+leadlag_nbr*exo_nbr+(1:length(k));
i_mult = i_mult';
i_leadlag1 = [ i_leadlag1 ...
[zeros(max_lead,exo_nbr);...
[zeros(max_lag,exo_nbr);...
reshape(n+(1:leadlag_nbr*exo_nbr),exo_nbr,leadlag_nbr)'; ...
zeros(max_lag,exo_nbr)] ...
[zeros(max_lead,mult_nbr);...
zeros(max_lead,exo_nbr)] ...
[zeros(max_lag,mult_nbr);...
i_mult;...
zeros(max_lag,mult_nbr)]];
zeros(max_lead,mult_nbr)]];
i_leadlag1 = i_leadlag1';
k = find(i_leadlag1 > 0);
n = length(k);
......@@ -162,8 +162,8 @@ function J = ramsey_dynamic(ys,lbar)
for i=1:leadlag_nbr
ic1 = find(i_leadlag(i,:) > 0);
kc1 = i_leadlag(i,ic1);
ic2 = find(i_leadlag1(max_lag+i,:) > 0);
kc2 = i_leadlag1(max_lag+i,ic2);
ic2 = find(i_leadlag1(max_lead+i,:) > 0);
kc2 = i_leadlag1(max_lead+i,ic2);
[junk,junk,ic3] = intersect(ic1,ic2);
J(ir,kc2(ic3)) = fJ(:,kc1);
end
......
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