1function message = get_error_message(info, DynareOptions) 2% Returns error messages 3% 4% INPUTS 5% info [double] vector returned by resol.m 6% DynareOptions [structure] --> options_ 7% OUTPUTS 8% message [string] corresponding error message 9% 10% SPECIAL REQUIREMENTS 11% none 12 13% Copyright (C) 2005-2020 Dynare Team 14% 15% This file is part of Dynare. 16% 17% Dynare is free software: you can redistribute it and/or modify 18% it under the terms of the GNU General Public License as published by 19% the Free Software Foundation, either version 3 of the License, or 20% (at your option) any later version. 21% 22% Dynare is distributed in the hope that it will be useful, 23% but WITHOUT ANY WARRANTY; without even the implied warranty of 24% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25% GNU General Public License for more details. 26% 27% You should have received a copy of the GNU General Public License 28% along with Dynare. If not, see <http://www.gnu.org/licenses/>. 29 30switch info(1) 31 case 0 32 message = ''; 33 case 1 34 message = 'The model doesn''t determine the current variable uniquely.'; 35 case 2 36 message = sprintf('The generalized Schur (QZ) decomposition failed. For more information, see the documentation for Lapack function dgges: info=%d, n=%d. You can also run model_diagnostics to get more information on what may cause this problem.', info(2), info(3)); 37 case 3 38 message = 'Blanchard & Kahn conditions are not satisfied: no stable equilibrium.'; 39 case 4 40 message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy.'; 41 case 5 42 message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.'; 43 case 6 44 message = 'The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.'; 45 case 7 46 message = sprintf('One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is smaller than %5.4f!\n If you believe that the model has a unique solution you can try to reduce the value of qz_zero_threshold.',DynareOptions.qz_zero_threshold); 47 case 8 48 if size(info,2)>=2 49 global M_; 50 disp_string = M_.param_names{info(2)}; 51 for ii=1:length(info)-2 52 disp_string = [disp_string, ', ', M_.param_names{info(2+ii)}]; 53 end 54 message = ['The Jacobian contains NaNs because the following parameters are NaN: ' disp_string]; 55 else 56 message = 'The Jacobian contains NaNs. For more information, use options_.debug.'; 57 end 58 case 9 59 message = 'k_order_pert was unable to compute the solution'; 60 case 10 61 message = 'The Jacobian of the dynamic model contains Inf. For more information, use options_.debug.'; 62 case 11 63 message = 'The Hessian of the dynamic model used for second order solutions must not contain Inf'; 64 case 12 65 message = 'The Hessian of the dynamic model used for second order solutions must not contain NaN'; 66 case 19 67 message = 'The steadystate file did not compute the steady state'; 68 case 20 69 if DynareOptions.linear 70 message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state or there are an infinity of steady states Check whether your model is truly linear or whether there is a mistake in linearization.', info(2)); 71 else 72 message = sprintf('Impossible to find the steady state (the sum of square residuals of the static equations is %5.4f). Either the model doesn''t have a steady state, there are an infinity of steady states, or the guess values are too far from the solution', info(2)); 73 end 74 case 21 75 message = sprintf('The steady state is complex (the sum of square residuals of imaginary parts of the steady state is %5.4f)', info(2)); 76 case 22 77 message = 'The steady state has NaNs or Inf.'; 78 case 23 79 message = 'Parameters have been updated in the steadystate routine and some have complex values.'; 80 case 24 81 message = 'Parameters have been updated in the steadystate routine and some are NaNs or Inf.'; 82 case 25 83 message = 'The solution to the static equations is not a steady state of the dynamic model: verify that the equations tagged by [static] and [dynamic] are consistent'; 84 case 26 85 message = 'The loglinearization of the model cannot be performed, because the steady state is not strictly positive.'; 86 case 30 87 message = 'Ergodic variance can''t be computed.'; 88 case 41 89 message = 'one (many) parameter(s) do(es) not satisfy the lower bound'; 90 case 42 91 message = 'one (many) parameter(s) do(es) not satisfy the upper bound'; 92 case 43 93 message = 'Covariance matrix of structural shocks is not positive definite'; 94 case 44 %DsgeLikelihood_hh / dsge_likelihood 95 message = 'The covariance matrix of the measurement errors is not positive definite.'; 96 case 45 %DsgeLikelihood_hh / dsge_likelihood 97 message = 'Likelihood is not a number (NaN) or a complex number'; 98 case 46 %DsgeLikelihood_hh / dsge_likelihood 99 message = 'Likelihood is a complex number'; 100 case 47 %DsgeLikelihood_hh / dsge_likelihood 101 message = 'Prior density is not a number (NaN)'; 102 case 48 %DsgeLikelihood_hh / dsge_likelihood 103 message = 'Prior density is a complex number'; 104 case 49 105 message = 'The model violates one (many) endogenous prior restriction(s)'; 106 case 50 107 message = 'Likelihood is Inf'; 108 case 51 109 message = sprintf('\n The dsge_prior_weight is dsge_var=%5.4f, but must be at least %5.4f for the prior to be proper.\n You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!', info(2), info(3)); 110 case 52 %dsge_var_likelihood 111 message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on artificial and actual sample is not positive definite!'; 112 case 53 %dsge_var_likelihood 113 message = 'You are estimating a DSGE-VAR model, but the implied covariance matrix of the VAR''s innovations, based on the artificial sample, is not positive definite!'; 114 case 55 115 message = 'Fast Kalman filter only works with stationary models [lik_init=1] or stationary observables for non-stationary models [lik_init=3]'; 116 case 61 %Discretionary policy 117 message = 'Discretionary policy: maximum number of iterations has been reached. Procedure failed.'; 118 case 62 119 message = 'Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.'; 120 case 63 121 message = 'Discretionary policy: NaN elements are present in the solution. Procedure failed.'; 122 case 64 123 message = 'discretionary_policy: the derivatives of the objective function contain NaN.'; 124 case 65 125 message = 'discretionary_policy: the model must be written in deviation form and not have constant terms.'; 126 case 66 127 message = 'discretionary_policy: the objective function must have zero first order derivatives.'; 128 case 71 129 message = 'Calibrated covariance of the structural errors implies correlation larger than +-1.'; 130 case 72 131 message = 'Calibrated covariance of the measurement errors implies correlation larger than +-1.'; 132 % Aim Code Conversions by convertAimCodeToInfo.m 133 case 81 134 message = ['Ramsey: The solution to the static first order conditions for optimal policy could not be found. Either the model' ... 135 ' doesn''t have a steady state, there are an infinity of steady states, ' ... 136 ' or the guess values are too far from the solution']; 137 case 82 138 message = 'Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy'; 139 case 83 140 message = 'Ramsey: The steady state computation resulted in NaN in the auxiliary equations for optimal policy'; 141 case 84 142 message = 'Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments'; 143 case 85 144 message = 'Ramsey: The steady state file does not solve the static first order conditions conditional on the instruments.'; 145 case 86 146 message = 'Ramsey: The steady state file provides complex numbers conditional on the instruments.'; 147 case 87 148 message = 'Ramsey: The maximum number of iterations has been reached. Try increasing maxit.'; 149 case 102 150 message = 'Aim: roots not correctly computed by real_schur'; 151 case 103 152 message = 'Aim: too many explosive roots: no stable equilibrium'; 153 case 135 154 message = 'Aim: too many explosive roots, and q(:,right) is singular'; 155 case 104 156 message = 'Aim: too few explosive roots: indeterminacy'; 157 case 145 158 message = 'Aim: too few explosive roots, and q(:,right) is singular'; 159 case 105 160 message = 'Aim: q(:,right) is singular'; 161 case 161 162 message = 'Aim: too many exact shiftrights'; 163 case 162 164 message = 'Aim: too many numeric shiftrights'; 165 case 163 166 message = 'Aim: A is NAN or INF.'; 167 case 164 168 message = 'Aim: Problem in SPEIG.'; 169 otherwise 170 message = 'This case shouldn''t happen. Contact the authors of Dynare'; 171end