Skip to content
Snippets Groups Projects
Commit 58352429 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Add message if model_diagnostics found no problems

parent bf6f987e
Branches
Tags
1 merge request!616Add more explicit messages, fix typos in manual and add more explicit documentation for endval
...@@ -40,11 +40,13 @@ endo_names = M.endo_names; ...@@ -40,11 +40,13 @@ endo_names = M.endo_names;
lead_lag_incidence = M.lead_lag_incidence; lead_lag_incidence = M.lead_lag_incidence;
maximum_endo_lag = M.maximum_endo_lag; maximum_endo_lag = M.maximum_endo_lag;
problem_dummy=0;
% %
% missing variables at the current period % missing variables at the current period
% %
k = find(lead_lag_incidence(maximum_endo_lag+1,:)==0); k = find(lead_lag_incidence(maximum_endo_lag+1,:)==0);
if ~isempty(k) if ~isempty(k)
problem_dummy=1;
disp(['The following endogenous variables aren''t present at ' ... disp(['The following endogenous variables aren''t present at ' ...
'the current period in the model:']) 'the current period in the model:'])
for i=1:length(k) for i=1:length(k)
...@@ -66,6 +68,7 @@ end ...@@ -66,6 +68,7 @@ end
% testing for problem % testing for problem
if check1(1) if check1(1)
problem_dummy=1;
disp('model diagnostic can''t obtain the steady state') disp('model diagnostic can''t obtain the steady state')
if any(isnan(dr.ys)) if any(isnan(dr.ys))
disp(['model diagnostic obtains a steady state with NaNs']) disp(['model diagnostic obtains a steady state with NaNs'])
...@@ -77,6 +80,7 @@ if check1(1) ...@@ -77,6 +80,7 @@ if check1(1)
end end
if ~isreal(dr.ys) if ~isreal(dr.ys)
problem_dummy=1;
disp(['model diagnostic obtains a steady state with complex ' ... disp(['model diagnostic obtains a steady state with complex ' ...
'numbers']) 'numbers'])
return return
...@@ -108,6 +112,7 @@ for b=1:nb ...@@ -108,6 +112,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)
problem_dummy=1;
singularity_problem = 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'])
...@@ -151,3 +156,7 @@ if singularity_problem ...@@ -151,3 +156,7 @@ if singularity_problem
fprintf('is missing. The problem often derives from Walras Law.\n') fprintf('is missing. The problem often derives from Walras Law.\n')
end end
if problem_dummy==0
fprintf('model_diagnostics was not able to detect any obvious problems with this mod-file.\n')
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment