Commit cee82819 authored by MichelJuillard's avatar MichelJuillard
Browse files

changed test for NaN and Inf in Jacobian, changed info error number, changed error message

parent f6f61df1
......@@ -99,7 +99,7 @@ if options_.ramsey_policy
end
ys = oo_.steady_state;
if inst_nbr == 1
nl_func = @(x) dyn_ramsey_static_(x,0,M_,options_,oo_,it_);
nl_func = @(x) dyn_ramsey_static_(x,M_,options_,oo_,it_);
inst_val = fzero(nl_func,oo_.steady_state(k_inst));
else
[inst_val,info1] = dynare_solve('dyn_ramsey_static_', ...
......@@ -192,7 +192,11 @@ if options_.debug
save([M_.fname '_debug.mat'],'jacobia_')
end
if ~isreal(jacobia_)
if ~all(isfinite(jacobia_(:)))
info(1) = 6;
info(2) = 1;
return
elseif ~isreal(jacobia_)
if max(max(abs(imag(jacobia_)))) < 1e-15
jacobia_ = real(jacobia_);
else
......@@ -321,10 +325,6 @@ else % use original Dynare solver
b10 = b(1:nstatic,1:nstatic);
b11 = b(1:nstatic,nstatic+1:end);
b2 = b(nstatic+1:end,nstatic+1:end);
if any(isinf(a(:)))
info = 1;
return
end
% buildind D and E
d = zeros(nd,nd) ;
......
......@@ -45,7 +45,8 @@ if ~noprint
error(['Blanchard Kahn conditions are not satisfied:' ...
' indeterminacy due to rank failure'])
case 6
error('The jacobian matrix evaluated at the steady state is complex')
error(['The Jacobian matrix evaluated at the steady state contains elements ' ...
'that are not real or finite'])
case 19
error('The steadystate file did not compute the steady state (inconsistent deep parameters).')
case 20
......
Markdown is supported
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