corrected bug in dr1 when used for check of eigenvalues in a deterministic setup (simul and not stoch_simul)
parent
89bdc81ada
commit
3d0420d220
34
matlab/dr1.m
34
matlab/dr1.m
|
@ -230,8 +230,9 @@ if M_.maximum_endo_lead == 0
|
||||||
end
|
end
|
||||||
else % use original Dynare solver
|
else % use original Dynare solver
|
||||||
[k1,junk,k2] = find(kstate(:,4));
|
[k1,junk,k2] = find(kstate(:,4));
|
||||||
dr.ghx(:,k1) = -b\jacobia_(:,k2);
|
dr.ghx(:,k1) = -b\jacobia_(:,k2);
|
||||||
if M_.exo_nbr
|
% with simul, the Jacobian doesn't contain derivatives w.r. to shocks
|
||||||
|
if size(jacobia_,2) > nz
|
||||||
dr.ghu = -b\jacobia_(:,nz+1:end);
|
dr.ghu = -b\jacobia_(:,nz+1:end);
|
||||||
end
|
end
|
||||||
end % if not use AIM or not...
|
end % if not use AIM or not...
|
||||||
|
@ -360,16 +361,27 @@ else % use original Dynare solver
|
||||||
end
|
end
|
||||||
|
|
||||||
if nba ~= nyf
|
if nba ~= nyf
|
||||||
temp = sort(abs(dr.eigval));
|
sorted_roots = sort(abs(dr.eigval));
|
||||||
if nba > nyf
|
if isfield(options_,'indeterminacy_continuity')
|
||||||
temp = temp(nd-nba+1:nd-nyf)-1-options_.qz_criterium;
|
if options_.indeterminacy_msv == 1
|
||||||
info(1) = 3;
|
[ss,tt,w,q] = qz(e',d');
|
||||||
elseif nba < nyf;
|
[ss,tt,w,q] = reorder(ss,tt,w,q);
|
||||||
temp = temp(nd-nyf+1:nd-nba)-1-options_.qz_criterium;
|
ss = ss';
|
||||||
info(1) = 4;
|
tt = tt';
|
||||||
|
w = w';
|
||||||
|
nba = nyf;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if nba > nyf
|
||||||
|
temp = sorted_roots(nd-nba+1:nd-nyf)-1-options_.qz_criterium;
|
||||||
|
info(1) = 3;
|
||||||
|
elseif nba < nyf;
|
||||||
|
temp = sorted_roots(nd-nyf+1:nd-nba)-1-options_.qz_criterium;
|
||||||
|
info(1) = 4;
|
||||||
|
end
|
||||||
|
info(2) = temp'*temp;
|
||||||
|
return
|
||||||
end
|
end
|
||||||
info(2) = temp'*temp;
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
|
||||||
np = nd - nyf;
|
np = nd - nyf;
|
||||||
|
|
Loading…
Reference in New Issue