From 8574dfd0530a7574ad3ec64fa66c69febcda034f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 12 Jun 2013 10:54:33 +0200 Subject: [PATCH] Adapted print_info routine. --- matlab/check.m | 2 +- matlab/dyn_risky_steadystate_solver.m | 6 +++--- matlab/initial_estimation_checks.m | 2 +- matlab/print_info.m | 10 +++++----- matlab/resid.m | 2 +- matlab/steady.m | 2 +- matlab/stoch_simul.m | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/matlab/check.m b/matlab/check.m index d68f7f641..8c7ad94ff 100644 --- a/matlab/check.m +++ b/matlab/check.m @@ -73,7 +73,7 @@ oo.dr=set_state_space(oo.dr,M,options); [dr,info,M,options,oo] = resol(1,M,options,oo); if info(1) ~= 0 && info(1) ~= 3 && info(1) ~= 4 - print_info(info, options.noprint); + print_info(info, options.noprint, options); end eigenvalues_ = dr.eigval; diff --git a/matlab/dyn_risky_steadystate_solver.m b/matlab/dyn_risky_steadystate_solver.m index 7f5437909..114e2c1b0 100644 --- a/matlab/dyn_risky_steadystate_solver.m +++ b/matlab/dyn_risky_steadystate_solver.m @@ -271,7 +271,7 @@ function dr_np = first_step_ds(x,pm,M,dr,options,oo) [dr_np,info] = dyn_first_order_solver(d1_np,pm.M_np,pm.dr_np,options,0); if info - print_info(info,0); + print_info(info, 0, options); return end @@ -309,7 +309,7 @@ function [resid,dr] = risky_residuals_k_order(ys,pm,M,dr,options,oo) [dr_np,info] = dyn_first_order_solver(d1_np,pm.M_np,pm.dr_np,options,0); if info - print_info(info,0); + print_info(info, 0, options); return end @@ -386,7 +386,7 @@ function [resid,dr] = risky_residuals_k_order(ys,pm,M,dr,options,oo) disp(aa3(:,kk2)) [dr,info] = dyn_first_order_solver(d1b,M,dr,options,0); if info - print_info(info,0); + print_info(info, 0, options); return end diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m index 673d8c360..ac884f183 100644 --- a/matlab/initial_estimation_checks.m +++ b/matlab/initial_estimation_checks.m @@ -66,7 +66,7 @@ end if info(1) > 0 disp('Error in computing likelihood for initial parameter values') - print_info(info, DynareOptions.noprint) + print_info(info, DynareOptions.noprint, DynareOptions) end if any(abs(DynareResults.steady_state(BayesInfo.mfys))>1e-9) && (DynareOptions.prefilter==1) diff --git a/matlab/print_info.m b/matlab/print_info.m index 67bffa264..82f053a40 100644 --- a/matlab/print_info.m +++ b/matlab/print_info.m @@ -1,9 +1,10 @@ -function print_info(info,noprint) +function print_info(info, noprint, DynareOptions) % Prints error messages % % INPUTS -% info [double] vector returned by resol.m -% noprint [integer] equal to 0 if the error message has to be printed. +% info [double] vector returned by resol.m +% noprint [integer] equal to 0 if the error message has to be printed. +% DynareOptions [structure] --> options_ % OUTPUTS % none % @@ -49,8 +50,7 @@ if ~noprint error(['The Jacobian matrix evaluated at the steady state contains elements ' ... 'that are not real or are infinite']) case 7 - error(['One of the eigenvalues is close to 0/0 (the absolute ' ... - 'value of numerator and denominator is smaller than 1e-6)']) + error('One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than %s!\n If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.',num2str(DynareOptions.qz_zero_threshold)) case 8 if size(info,2)>=2 global M_; diff --git a/matlab/resid.m b/matlab/resid.m index b8082b8e0..807bb435f 100644 --- a/matlab/resid.m +++ b/matlab/resid.m @@ -113,7 +113,7 @@ if nargout == 0 end if info(1) - print_info(info,options_.noprint) + print_info(info,options_.noprint, options_) end diff --git a/matlab/steady.m b/matlab/steady.m index 24456b028..510d1f89f 100644 --- a/matlab/steady.m +++ b/matlab/steady.m @@ -89,7 +89,7 @@ else if options_.noprint == 0 resid; end - print_info(info,options_.noprint); + print_info(info,options_.noprint, options_); end M_.Sigma_e = Sigma_e; diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index e06b413bb..b6540e737 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -78,7 +78,7 @@ end if info(1) options_ = options_old; - print_info(info, options_.noprint); + print_info(info, options_.noprint, options_); return end