From a1594429358a571b6feeb7d46227b80557a24e7e Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Wed, 29 Oct 2014 09:02:29 +0100 Subject: [PATCH] Fix message in dynare_estimation_init.m If some parameters are NaN after computing the steady state, the message erroneously said that parameters had been changed. In a check for equality, NaN is not equal to NaN. Thus, NaNs are now taken care of separately. --- matlab/dynare_estimation_init.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 99534d9f9..2f90468de 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -451,8 +451,15 @@ if options_.analytic_derivation, [tmp1, params] = evaluate_steady_state(oo_.steady_state,M,options_,oo_,steadystate_check_flag); change_flag=any(find(params-M.params)); if change_flag, - disp('The steadystate file changed the values for the following parameters: '), - disp(M.param_names(find(params-M.params),:)) + skipline(); + if any(isnan(params)) + disp('After computing the steadystate, the following parameters are still NaN: '), + disp(M.param_names(isnan(params),:)) + end + if any(find(params(~isnan(params))-M.params(~isnan(params)))) + disp('The steadystate file changed the values for the following parameters: '), + disp(M.param_names(find(params(~isnan(params))-M.params(~isnan(params))),:)) + end disp('The derivatives of jacobian and steady-state will be computed numerically'), disp('(re-set options_.analytic_derivation_mode= -2)'), options_.analytic_derivation_mode= -2;