File: get_error_message.m

package info (click to toggle)
dynare 4.6.3-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 74,896 kB
  • sloc: cpp: 98,057; ansic: 28,929; pascal: 13,844; sh: 5,947; objc: 4,236; yacc: 4,215; makefile: 2,583; lex: 1,534; fortran: 877; python: 647; ruby: 291; lisp: 152; xml: 22
file content (171 lines) | stat: -rw-r--r-- 9,526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
function message = get_error_message(info, DynareOptions)
% Returns error messages
%
% INPUTS
%   info              [double]     vector returned by resol.m
%   DynareOptions     [structure]  --> options_
% OUTPUTS
%    message          [string]     corresponding error message
%
% SPECIAL REQUIREMENTS
%    none

% Copyright (C) 2005-2020 Dynare Team
%
% 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/>.

switch info(1)
    case 0
        message = '';
    case 1
        message = 'The model doesn''t determine the current variable uniquely.';
    case 2
        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));
    case 3
        message = 'Blanchard & Kahn conditions are not satisfied: no stable equilibrium.';
    case 4
        message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy.';
    case 5
        message = 'Blanchard & Kahn conditions are not satisfied: indeterminacy due to rank failure.';
    case 6
        message = 'The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite.';
    case 7
        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);
    case 8
        if size(info,2)>=2
            global M_;
            disp_string = M_.param_names{info(2)};
            for ii=1:length(info)-2
                disp_string = [disp_string, ', ', M_.param_names{info(2+ii)}];
            end
            message = ['The Jacobian contains NaNs because the following parameters are NaN: ' disp_string];
        else
            message = 'The Jacobian contains NaNs. For more information, use options_.debug.';
        end
    case 9
        message = 'k_order_pert was unable to compute the solution';
    case 10
        message = 'The Jacobian of the dynamic model contains Inf. For more information, use options_.debug.';
    case 11
        message = 'The Hessian of the dynamic model used for second order solutions must not contain Inf';
    case 12
        message = 'The Hessian of the dynamic model used for second order solutions must not contain NaN';
    case 19
        message = 'The steadystate file did not compute the steady state';
    case 20
        if DynareOptions.linear
            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));
        else
            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));
        end
    case 21
        message = sprintf('The steady state is complex (the sum of square residuals of imaginary parts of the steady state is %5.4f)', info(2));
    case 22
        message = 'The steady state has NaNs or Inf.';
    case 23
        message = 'Parameters have been updated in the steadystate routine and some have complex values.';
    case 24
        message = 'Parameters have been updated in the steadystate routine and some are NaNs or Inf.';
    case 25
        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';
    case 26
        message = 'The loglinearization of the model cannot be performed, because the steady state is not strictly positive.';
    case 30
        message = 'Ergodic variance can''t be computed.';
    case 41
        message = 'one (many) parameter(s) do(es) not satisfy the lower bound';
    case 42
        message = 'one (many) parameter(s) do(es) not satisfy the upper bound';
    case 43
        message = 'Covariance matrix of structural shocks is not positive definite';
    case 44 %DsgeLikelihood_hh / dsge_likelihood
        message = 'The covariance matrix of the measurement errors is not positive definite.';
    case 45 %DsgeLikelihood_hh / dsge_likelihood
        message = 'Likelihood is not a number (NaN) or a complex number';
    case 46 %DsgeLikelihood_hh / dsge_likelihood
        message = 'Likelihood is a complex number';
    case 47 %DsgeLikelihood_hh / dsge_likelihood
        message = 'Prior density is not a number (NaN)';
    case 48 %DsgeLikelihood_hh / dsge_likelihood
        message = 'Prior density is a complex number';
    case 49
        message = 'The model violates one (many) endogenous prior restriction(s)';
    case 50
        message = 'Likelihood is Inf';
    case 51
        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));
    case 52 %dsge_var_likelihood
        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!';
    case 53 %dsge_var_likelihood
        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!';
    case 55
        message = 'Fast Kalman filter only works with stationary models [lik_init=1] or stationary observables for non-stationary models [lik_init=3]';
    case 61 %Discretionary policy
        message = 'Discretionary policy: maximum number of iterations has been reached. Procedure failed.';
    case 62
        message = 'Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.';
    case 63
        message = 'Discretionary policy: NaN elements are present in the solution. Procedure failed.';
    case 64
        message = 'discretionary_policy: the derivatives of the objective function contain NaN.';
    case 65
        message = 'discretionary_policy: the model must be written in deviation form and not have constant terms.';
    case 66
        message = 'discretionary_policy: the objective function must have zero first order derivatives.';
    case 71
        message = 'Calibrated covariance of the structural errors implies correlation larger than +-1.';
    case 72
        message = 'Calibrated covariance of the measurement errors implies correlation larger than +-1.';
        % Aim Code Conversions by convertAimCodeToInfo.m
    case 81
        message = ['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
        message = 'Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy';
    case 83
        message = 'Ramsey: The steady state computation resulted in NaN in the auxiliary equations for optimal policy';
    case 84
        message = 'Ramsey: The steady state file computation for the Ramsey problem resulted in NaNs at the initial values of the instruments';
    case 85
        message = 'Ramsey: The steady state file does not solve the static first order conditions conditional on the instruments.';
    case 86
        message = 'Ramsey: The steady state file provides complex numbers conditional on the instruments.';
    case 87
        message = 'Ramsey: The maximum number of iterations has been reached. Try increasing maxit.';
    case 102
        message = 'Aim: roots not correctly computed by real_schur';
    case 103
        message = 'Aim: too many explosive roots: no stable equilibrium';
    case 135
        message = 'Aim: too many explosive roots, and q(:,right) is singular';
    case 104
        message = 'Aim: too few explosive roots: indeterminacy';
    case 145
        message = 'Aim: too few explosive roots, and q(:,right) is singular';
    case 105
        message = 'Aim: q(:,right) is singular';
    case 161
        message = 'Aim: too many exact shiftrights';
    case 162
        message = 'Aim: too many numeric shiftrights';
    case 163
        message = 'Aim: A is NAN or INF.';
    case 164
        message = 'Aim: Problem in SPEIG.';
    otherwise
        message = 'This case shouldn''t happen. Contact the authors of Dynare';
end