Merge pull request #513 from JohannesPfeifer/improved_messages

Add more explicit information in case of singularity problem
time-shift
Houtan Bastani 2013-10-31 02:17:07 -07:00
commit b79f7e5559
3 changed files with 10 additions and 2 deletions

View File

@ -85,6 +85,7 @@ end
% %
% singular Jacobian of static model % singular Jacobian of static model
% %
singularity_problem = 0;
if ~isfield(M,'block_structure_stat') if ~isfield(M,'block_structure_stat')
nb = 1; nb = 1;
else else
@ -107,6 +108,7 @@ for b=1:nb
end end
rank_jacob = rank(jacob); rank_jacob = rank(jacob);
if rank_jacob < size(jacob,1) if rank_jacob < size(jacob,1)
singularity_problem = 1;
disp(['model_diagnostic: the Jacobian of the static model is ' ... disp(['model_diagnostic: the Jacobian of the static model is ' ...
'singular']) 'singular'])
disp(['there is ' num2str(endo_nbr-rank_jacob) ... disp(['there is ' num2str(endo_nbr-rank_jacob) ...
@ -143,4 +145,9 @@ for b=1:nb
end end
end end
end end
if singularity_problem
fprint('The presence of a singularity problem typically indicates that there is one\n')
fprint('redundant equation entered in the model block, while another non-redundant equation\n')
fprint('is missing. The problem often derives from Walras Law.\n')
end

View File

@ -36,7 +36,8 @@ if ~noprint
case 2 case 2
error(['The generalized Schur (QZ) decomposition failed. ' ... error(['The generalized Schur (QZ) decomposition failed. ' ...
'For more information, see the documentation for Lapack function dgges: info=' ... 'For more information, see the documentation for Lapack function dgges: info=' ...
int2str(info(2)) ', n=' int2str(info(3))]) int2str(info(2)) ', n=' int2str(info(3)) ...
'. You can also run model_diagnostics to get more information on what may cause this problem.'])
case 3 case 3
error(['Blanchard Kahn conditions are not satisfied: no stable' ... error(['Blanchard Kahn conditions are not satisfied: no stable' ...
' equilibrium']) ' equilibrium'])