Check for complexity of steady state in resid.m

Residuals might be 0, but steady state might be complex, resulting in hard-to-diagnose problems when calling steady.m
time-shift
Johannes Pfeifer 2016-07-14 15:04:27 +02:00
parent 22f49971bc
commit 578fb04590
1 changed files with 10 additions and 0 deletions

View File

@ -51,6 +51,16 @@ Sigma_e = M_.Sigma_e;
M_.Sigma_e = zeros(size(Sigma_e));
info = 0;
if any(imag(oo_.steady_state))
imagrow=find(imag(oo_.steady_state));
if ~isempty(imagrow)
fprintf('\nresid: The initial values for the steady state of the following variables are complex:\n');
for iter=1:length(imagrow)
fprintf('%s\n',M_.endo_names(imagrow(iter),:));
end
end
end
if options_.steadystate_flag
[oo_.steady_state,M_.params,info] = ...
evaluate_steady_state(oo_.steady_state,M_,options_,oo_,0);