From 14ab41e414f2d2c8c88b338ac1c1c4e343e48758 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sun, 21 Aug 2016 11:45:11 +0200 Subject: [PATCH] Move debugging information removed in 335ce74acbd3c1a0ea307a284b7652bec9e77cf3 to evaluate_steady_state.m where it belongs --- matlab/evaluate_steady_state.m | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/matlab/evaluate_steady_state.m b/matlab/evaluate_steady_state.m index 883357b5e..9b298c2a2 100644 --- a/matlab/evaluate_steady_state.m +++ b/matlab/evaluate_steady_state.m @@ -213,6 +213,25 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta options, exo_ss, params,... M.orig_endo_nbr,... static_model); + if check && options.debug + [ys,check,fvec,fjac] = dynare_solve(@static_problem,... + ys_init,... + options, exo_ss, params,... + M.orig_endo_nbr,... + static_model); + [infrow,infcol]=find(isinf(fjac) | isnan(fjac)); + fprintf('\nSTEADY: The Jacobian at the initial values contains Inf or NaN. The problem arises from: \n') + display_problematic_vars_Jacobian(infrow,infcol,M,ys_init,'static','STEADY: ') + + problematic_equation = find(~isfinite(fvec)); + if ~isempty(problematic_equation) + fprintf('\nSTEADY: numerical initial values or parameters incompatible with the following equations\n') + disp(problematic_equation') + fprintf('Please check for example\n') + fprintf(' i) if all parameters occurring in these equations are defined\n') + fprintf(' ii) that no division by an endogenous variable initialized to 0 occurs\n') + end + end else % linear model fh_static = str2func([M.fname '_static']);