Skip to content
Snippets Groups Projects
Commit c470e028 authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

Ramsey: add check for complex numbers in conditional steady state

parent 01f1abb1
No related branches found
No related tags found
No related merge requests found
...@@ -93,6 +93,21 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta ...@@ -93,6 +93,21 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
info(2) = resids'*resids; info(2) = resids'*resids;
return; return;
end end
if any(imag(ys(n_multipliers+1:end)))
fprintf('\nevaluate_steady_state: The steady state file computation for the Ramsey problem resulted in complex numbers.\n')
fprintf('evaluate_steady_state: The steady state was computed conditional on the following initial instrument values: \n')
for ii = 1:size(options.instruments,1);
fprintf('\t %s \t %f \n',options.instruments(ii,:),ys_init(strmatch(options.instruments(ii,:),M.endo_names,'exact')))
end
fprintf('evaluate_steady_state: If those initial values are not admissable, change them using an initval-block.\n')
skipline(2);
check=1;
info(1) = 86;
info(2) = resids'*resids;
return;
end
if max(abs(resids(n_multipliers+1:end))) > options.solve_tolf %does it solve for all variables except for the Lagrange multipliers if max(abs(resids(n_multipliers+1:end))) > options.solve_tolf %does it solve for all variables except for the Lagrange multipliers
fprintf('\nevaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.\n') fprintf('\nevaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.\n')
fprintf('evaluate_steady_state: Conditional on the following instrument values: \n') fprintf('evaluate_steady_state: Conditional on the following instrument values: \n')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment