print_info.m 5.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
function print_info(info,noprint)
% Prints error messages
%
% INPUTS
%   info    [double]   vector returned by resol.m 
%   noprint [integer]  equal to 0 if the error message has to be printed. 
% OUTPUTS
%    none
%
% SPECIAL REQUIREMENTS
%    none

13
% Copyright (C) 2005-2013 Dynare Team
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%
% 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
        error(['The model doesn''t determine the current variables' ...
               ' uniquely'])
      case 2
Houtan Bastani's avatar
Houtan Bastani committed
36
37
38
        error(['The generalized Schur (QZ) decomposition failed. ' ...
               'For more information, see the documentation for Lapack function dgges: info=' ...
               int2str(info(2)) ', n=' int2str(info(3))])
39
40
41
42
43
44
45
46
47
48
      case 3
        error(['Blanchard Kahn conditions are not satisfied: no stable' ...
               ' equilibrium'])
      case 4
        error(['Blanchard Kahn conditions are not satisfied:' ...
               ' indeterminacy'])
      case 5
        error(['Blanchard Kahn conditions are not satisfied:' ...
               ' indeterminacy due to rank failure'])
      case 6
49
        error(['The Jacobian matrix evaluated at the steady state contains elements ' ...
50
               'that are not real or are infinite'])
51
      case 7
52
        error(['One of the eigenvalues is close to 0/0 (the absolute ' ...
53
               'value of numerator and denominator is smaller than 1e-6)'])
54
55
56
57
58
59
60
61
62
63
64
65
66
      case 8
        if ~isempty(info(2))
          global M_;
            disp_string=deblank(M_.param_names(info(2),:));
          for ii=1:length(info)-2
            disp_string=[disp_string,', ',deblank(M_.param_names(info(2+ii),:))];
          end
          error(['The Jacobian contains NaNs because the following parameters are NaN: '...
              disp_string])
        else
          error(['The Jacobian contains NaNs'])
        end

67
      case 19
68
        error('The steadystate file did not compute the steady state')
69
70
      case 20
        error(['Impossible to find the steady state. Either the model' ...
Houtan Bastani's avatar
Houtan Bastani committed
71
               ' doesn''t have a steady state, there are an infinity of steady states, ' ...
72
               ' or the guess values are too far from the solution'])
73
      case 21
74
        error('The steady state is complex')
75
      case 22
76
        error('The steady state contains NaN or Inf')
77
      case 23
78
        error('Some updated params are complex')
79
      case 24
80
        error('Some updated params contain NaN or Inf')
81
82
      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')
83
      case 30
84
        error('Variance can''t be computed')
85
86
87
88
      case 41
        error('one (many) parameter(s) do(es) not satisfy the lower bound');
      case 42
        error('one (many) parameter(s) do(es) not satisfy the upper bound');
89
      case 43
90
        error('Covariance matrix of structural shocks is not positive definite')
91
      case 44 %DsgeLikelihood_hh / dsge_likelihood
92
        error('The covariance matrix of the measurement errors is not positive definite.');
93
94
      case 45 %DsgeLikelihood_hh / dsge_likelihood
        error('Likelihood is not a number (NaN) or a complex number');
95
96
97
98
99
100
      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');
101
102
      case 51
        error('You are estimating a DSGE-VAR model, but the value of the dsge prior weight is too low!')
103
104
      case 52 %DsgeVarLikelihood
        error('');
105
      case 61 %Discretionary policy
106
        error(['Discretionary policy: maximum number of iterations has been reached. Procedure failed. ']);
107
      case 62
108
        error(['Discretionary policy: some eigenvalues greater than options_.qz_criterium. Model potentially unstable.']);
109
      case 63
110
        error(['Discretionary policy: NaN elements are present in the solution. Procedure failed.']);
111
        % Aim Code Conversions by convertAimCodeToInfo.m
112
      case 102
113
        error('Aim: roots not correctly computed by real_schur');
114
      case 103
115
        error('Aim: too many explosive roots: no stable equilibrium');
116
      case 135
117
        error('Aim: too many explosive roots, and q(:,right) is singular');
118
      case 104
119
        error('Aim: too few explosive roots: indeterminacy');
120
      case 145
121
        error('Aim: too few explosive roots, and q(:,right) is singular');
122
      case 105
123
        error('Aim: q(:,right) is singular');
124
      case 161
125
        error('Aim: too many exact shiftrights');
126
      case 162
127
        error('Aim: too many numeric shiftrights');
128
129
130
131
      case 163
        error('Aim: A is NAN or INF.')
      case 164
        error('Aim: Problem in SPEIG.')
132
133
134
      otherwise
        error('This case shouldn''t happen. Contact the authors of Dynare')
    end
Houtan Bastani's avatar
Houtan Bastani committed
135
end