2023-10-08 22:04:30 +02:00
|
|
|
function [eigenvalues_,result,info] = check(M_, options_, oo_)
|
|
|
|
%[eigenvalues_,result,info] = check(M_, options_, oo_)
|
2018-05-05 21:58:52 +02:00
|
|
|
% Checks determinacy conditions by computing the generalized eigenvalues.
|
|
|
|
%
|
|
|
|
% INPUTS
|
2023-10-08 22:04:30 +02:00
|
|
|
% - M_ [structure] Matlab's structure describing the model
|
|
|
|
% - options_ [structure] Matlab's structure describing the current options
|
|
|
|
% - oo_ [structure] Matlab's structure containing the results
|
2018-05-05 21:58:52 +02:00
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% - eigenvalues_ [double] vector, eigenvalues.
|
|
|
|
% - result [integer] scalar, equal to 1 if Blanchard and Kahn conditions are satisfied, zero otherwise.
|
|
|
|
% - info [integer] scalar or vector, error code as returned by resol routine.
|
2009-06-25 10:30:27 +02:00
|
|
|
|
2023-01-13 16:19:53 +01:00
|
|
|
% Copyright © 2001-2023 Dynare Team
|
2009-06-25 10:30:27 +02: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
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2009-06-25 10:30:27 +02:00
|
|
|
|
2009-09-03 12:11:36 +02:00
|
|
|
|
2023-10-08 22:04:30 +02:00
|
|
|
if ~options_.initval_file && M_.exo_nbr > 1
|
|
|
|
oo_.exo_simul = ones(M_.maximum_lead+M_.maximum_lag+1,1)*oo_.exo_steady_state';
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|
2009-09-03 12:11:36 +02:00
|
|
|
|
2023-10-08 22:04:30 +02:00
|
|
|
options_.order = 1;
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2023-10-08 22:04:30 +02:00
|
|
|
if isempty(options_.qz_criterium)
|
|
|
|
options_.qz_criterium = 1+1e-6;
|
2010-12-23 08:34:13 +01:00
|
|
|
end
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2023-10-08 22:08:57 +02:00
|
|
|
oo_.dr=set_state_space(oo_.dr,M_);
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2023-10-08 22:04:30 +02:00
|
|
|
[dr,info] = resol(1,M_,options_,oo_.dr ,oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state);
|
2009-12-16 18:17:34 +01:00
|
|
|
|
2011-02-10 15:54:23 +01:00
|
|
|
if info(1) ~= 0 && info(1) ~= 3 && info(1) ~= 4
|
2023-10-08 22:04:30 +02:00
|
|
|
print_info(info, 0, options_);
|
2011-09-17 11:47:36 +02:00
|
|
|
end
|
2009-12-16 18:17:34 +01:00
|
|
|
|
|
|
|
eigenvalues_ = dr.eigval;
|
|
|
|
[m_lambda,i]=sort(abs(eigenvalues_));
|
|
|
|
|
2010-01-06 14:53:47 +01:00
|
|
|
result = 0;
|
2023-10-08 22:04:30 +02:00
|
|
|
if (M_.nsfwrd == dr.edim) && (dr.full_rank)
|
2010-01-06 14:53:47 +01:00
|
|
|
result = 1;
|
|
|
|
end
|
|
|
|
|
2023-10-08 22:04:30 +02:00
|
|
|
if ~options_.noprint
|
2013-07-10 17:12:34 +02:00
|
|
|
skipline()
|
2009-12-16 18:17:34 +01:00
|
|
|
disp('EIGENVALUES:')
|
2023-10-08 22:04:30 +02:00
|
|
|
fprintf('%16s %16s %16s\n','Modulus','Real','Imaginary');
|
2009-12-16 18:17:34 +01:00
|
|
|
z=[m_lambda real(eigenvalues_(i)) imag(eigenvalues_(i))]';
|
2023-10-08 22:04:30 +02:00
|
|
|
fprintf('%16.4g %16.4g %16.4g\n',z);
|
|
|
|
fprintf('\nThere are %d eigenvalue(s) larger than 1 in modulus ', dr.edim);
|
|
|
|
fprintf('for %d forward-looking variable(s)', M_.nsfwrd);
|
2013-07-10 17:12:34 +02:00
|
|
|
skipline()
|
2012-09-10 13:25:31 +02:00
|
|
|
if result
|
2009-12-16 18:17:34 +01:00
|
|
|
disp('The rank condition is verified.')
|
|
|
|
else
|
2013-12-08 11:40:10 +01:00
|
|
|
disp('The rank condition ISN''T verified!')
|
2009-06-25 10:30:27 +02:00
|
|
|
end
|
2013-07-10 17:12:34 +02:00
|
|
|
skipline()
|
2009-12-16 18:17:34 +01:00
|
|
|
end
|