2013-06-12 10:54:33 +02:00
function print_info ( info, noprint, DynareOptions)
2009-12-16 18:17:34 +01:00
% Prints error messages
%
% INPUTS
2017-05-16 15:10:20 +02:00
% info [double] vector returned by resol.m
2013-06-12 10:54:33 +02:00
% noprint [integer] equal to 0 if the error message has to be printed.
% DynareOptions [structure] --> options_
2009-12-16 18:17:34 +01:00
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
2019-01-02 17:44:59 +01:00
% Copyright (C) 2005-2019 Dynare Team
2009-12-16 18:17:34 +01:00
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~ noprint
switch info ( 1 )
case 1
2019-01-02 17:44:59 +01:00
error ( ' The model doesn' ' t determine the current variables uniquely' )
2009-12-16 18:17:34 +01:00
case 2
2011-08-29 18:03:26 +02:00
error ( [ ' The generalized Schur (QZ) decomposition failed. ' ...
' For more information, see the documentation for Lapack function dgges: info=' ...
2013-10-31 08:07:55 +01:00
int2str ( info ( 2 ) ) ' , n=' int2str ( info ( 3 ) ) ...
' . You can also run model_diagnostics to get more information on what may cause this problem.' ] )
2009-12-16 18:17:34 +01:00
case 3
2019-01-02 17:44:59 +01:00
error ( ' Blanchard Kahn conditions are not satisfied: no stable equilibrium' )
2009-12-16 18:17:34 +01:00
case 4
2019-01-02 17:44:59 +01:00
error ( ' Blanchard Kahn conditions are not satisfied: indeterminacy' )
2009-12-16 18:17:34 +01:00
case 5
2019-01-02 17:44:59 +01:00
error ( ' Blanchard Kahn conditions are not satisfied: indeterminacy due to rank failure' )
2009-12-16 18:17:34 +01:00
case 6
2019-01-02 17:44:59 +01:00
error ( ' The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite' )
2011-09-01 11:37:40 +02:00
case 7
2013-06-12 10:54:33 +02:00
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 ) )
2012-08-05 13:09:24 +02:00
case 8
2013-04-26 16:56:49 +02:00
if size ( info , 2 ) > = 2
2017-05-16 15:10:20 +02:00
global M_ ;
2017-10-10 10:05:59 +02:00
disp_string = M_ . param_names { info ( 2 ) } ;
2017-05-16 15:10:20 +02:00
for ii = 1 : length ( info ) - 2
2017-10-10 10:05:59 +02:00
disp_string = [ disp_string , ' , ' , M_ . param_names { info ( 2 + ii ) } ] ;
2017-05-16 15:10:20 +02:00
end
2017-10-10 10:05:59 +02:00
error ( [ ' The Jacobian contains NaNs because the following parameters are NaN: ' disp_string ] )
2012-08-05 13:09:24 +02:00
else
2019-01-02 17:44:59 +01:00
error ( ' The Jacobian contains NaNs. For more information, use options_.debug.' )
2012-08-05 13:09:24 +02:00
end
2013-05-02 14:38:47 +02:00
case 9
2019-01-02 17:44:59 +01:00
error ( ' k_order_pert was unable to compute the solution' )
2013-07-28 12:09:59 +02:00
case 10
2019-01-02 17:44:59 +01:00
error ( ' The Jacobian of the dynamic model contains Inf. For more information, use options_.debug.' )
2014-09-25 08:48:35 +02:00
case 11
error ( ' The Hessian of the dynamic model used for second order solutions must not contain Inf' )
case 12
error ( ' The Hessian of the dynamic model used for second order solutions must not contain NaN' )
2012-10-31 11:08:22 +01:00
case 19
2011-10-13 17:14:41 +02:00
error ( ' The steadystate file did not compute the steady state' )
2009-12-16 18:17:34 +01:00
case 20
2014-09-13 11:10:14 +02:00
if DynareOptions . linear
error ( [ ' Impossible to find the steady state. Either the model' ...
' doesn' ' t have a steady state or there are an infinity of steady states.' ...
2017-05-16 15:10:20 +02:00
' Check whether your model is truly linear or whether there is a mistake in linearization.' ] )
2014-09-13 11:10:14 +02:00
else
error ( [ ' Impossible to find the steady state. 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' ] )
end
2009-12-16 18:17:34 +01:00
case 21
2011-10-13 17:14:41 +02:00
error ( ' The steady state is complex' )
2011-06-13 18:41:58 +02:00
case 22
2011-10-13 17:14:41 +02:00
error ( ' The steady state contains NaN or Inf' )
2011-06-13 18:41:58 +02:00
case 23
2011-10-13 17:14:41 +02:00
error ( ' Some updated params are complex' )
2011-06-13 18:41:58 +02:00
case 24
2011-10-13 17:14:41 +02:00
error ( ' Some updated params contain NaN or Inf' )
2013-04-11 17:07:39 +02:00
case 25
error ( ' 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' )
2014-12-04 20:04:36 +01:00
case 26
error ( ' The loglinearization of the model cannot be performed, because the steady state is not strictly positive.' )
2012-06-14 15:11:36 +02:00
case 30
2009-12-16 18:17:34 +01:00
error ( ' Variance can' ' t be computed' )
2011-02-04 15:42:24 +01:00
case 41
2013-05-02 14:31:29 +02:00
error ( ' one (many) parameter(s) do(es) not satisfy the lower bound' ) ;
2011-02-04 15:42:24 +01:00
case 42
2013-05-02 14:31:29 +02:00
error ( ' one (many) parameter(s) do(es) not satisfy the upper bound' ) ;
2010-10-14 12:03:36 +02:00
case 43
2012-04-20 23:13:50 +02:00
error ( ' Covariance matrix of structural shocks is not positive definite' )
2011-12-26 15:39:27 +01:00
case 44 %DsgeLikelihood_hh / dsge_likelihood
2012-01-30 14:03:24 +01:00
error ( ' The covariance matrix of the measurement errors is not positive definite.' ) ;
2012-01-30 18:03:44 +01:00
case 45 %DsgeLikelihood_hh / dsge_likelihood
error ( ' Likelihood is not a number (NaN) or a complex number' ) ;
2012-06-14 15:11:36 +02:00
case 46 %DsgeLikelihood_hh / dsge_likelihood
error ( ' Likelihood is a complex number' ) ;
case 47 %DsgeLikelihood_hh / dsge_likelihood
error ( ' Prior density is not a number (NaN)' ) ;
case 48 %DsgeLikelihood_hh / dsge_likelihood
error ( ' Prior density is a complex number' ) ;
2013-05-23 15:05:09 +02:00
case 49
error ( ' The model violates one (many) endogenous prior restriction(s)' )
2016-06-14 17:28:52 +02:00
case 50
2017-05-16 15:10:20 +02:00
error ( ' Likelihood is Inf' )
2010-06-24 12:53:10 +02:00
case 51
2014-04-11 14:27:32 +02:00
fprintf ( ' \n The dsge_prior_weight is dsge_var=%5.4f, but must be at least %5.4f for the prior to be proper.\n' , info ( 2 ) , info ( 3 ) ) ;
2010-06-24 12:53:10 +02:00
error ( ' You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!' )
2013-11-16 23:33:37 +01:00
case 52 %dsge_var_likelihood
2017-04-09 12:43:10 +02:00
error ( ' 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!' ) ;
case 53 %dsge_var_likelihood
error ( ' 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!' ) ;
2016-06-19 17:00:05 +02:00
case 55
error ( ' Fast Kalman filter only works with stationary models [lik_init=1] or stationary observables for non-stationary models [lik_init=3]' )
2011-04-05 13:46:58 +02:00
case 61 %Discretionary policy
2019-01-02 17:44:59 +01:00
error ( ' Discretionary policy: maximum number of iterations has been reached. Procedure failed.' ) ;
2011-04-05 13:46:58 +02:00
case 62
2019-01-02 17:44:59 +01:00
error ( ' Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.' ) ;
2011-04-05 13:46:58 +02:00
case 63
2019-01-02 17:44:59 +01:00
error ( ' Discretionary policy: NaN elements are present in the solution. Procedure failed.' ) ;
2013-10-30 14:26:30 +01:00
case 71
2019-01-02 17:44:59 +01:00
error ( ' Calibrated covariance of the structural errors implies correlation larger than +-1.' ) ;
2013-10-30 14:26:30 +01:00
case 72
2019-01-02 17:44:59 +01:00
error ( ' Calibrated covariance of the measurement errors implies correlation larger than +-1.' ) ;
2011-02-04 17:17:48 +01:00
% Aim Code Conversions by convertAimCodeToInfo.m
2014-07-18 12:41:28 +02:00
case 81
error ( [ ' Ramsey: The solution to the static first order conditions for optimal policy could not be found. 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' ] ) ;
case 82
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy' ) ;
2014-07-18 12:41:28 +02:00
case 83
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The steady state computation resulted in NaN in the auxiliary equations for optimal policy' ) ;
2014-07-18 12:41:28 +02:00
case 84
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments' ) ;
2014-07-18 12:41:28 +02:00
case 85
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The steady state file does not solve the static first order conditions conditional on the instruments.' ) ;
2016-08-02 17:09:18 +02:00
case 86
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The steady state file provides complex numbers conditional on the instruments.' ) ;
2016-08-02 17:09:18 +02:00
case 87
2019-01-02 17:44:59 +01:00
error ( ' Ramsey: The maximum number of iterations has been reached. Try increasing maxit.' ) ;
2011-02-04 15:42:24 +01:00
case 102
2011-10-13 17:14:41 +02:00
error ( ' Aim: roots not correctly computed by real_schur' ) ;
2011-02-04 15:42:24 +01:00
case 103
2012-04-20 22:32:56 +02:00
error ( ' Aim: too many explosive roots: no stable equilibrium' ) ;
2011-02-04 15:42:24 +01:00
case 135
2012-04-20 22:32:56 +02:00
error ( ' Aim: too many explosive roots, and q(:,right) is singular' ) ;
2011-02-04 15:42:24 +01:00
case 104
2012-04-20 22:32:56 +02:00
error ( ' Aim: too few explosive roots: indeterminacy' ) ;
2011-02-04 15:42:24 +01:00
case 145
2012-04-20 22:32:56 +02:00
error ( ' Aim: too few explosive roots, and q(:,right) is singular' ) ;
2011-02-04 15:42:24 +01:00
case 105
2011-10-13 17:14:41 +02:00
error ( ' Aim: q(:,right) is singular' ) ;
2011-02-04 15:42:24 +01:00
case 161
2011-10-13 17:14:41 +02:00
error ( ' Aim: too many exact shiftrights' ) ;
2011-02-04 15:42:24 +01:00
case 162
2011-10-13 17:14:41 +02:00
error ( ' Aim: too many numeric shiftrights' ) ;
2012-04-20 22:32:56 +02:00
case 163
error ( ' Aim: A is NAN or INF.' )
case 164
error ( ' Aim: Problem in SPEIG.' )
2009-12-16 18:17:34 +01:00
otherwise
error ( ' This case shouldn' ' t happen. Contact the authors of Dynare' )
end
2011-08-29 18:03:26 +02:00
end