From 9dff2ba6cde6fee094b451da51d98ad6d449b6e6 Mon Sep 17 00:00:00 2001 From: stepan Date: Wed, 6 Jan 2010 13:53:47 +0000 Subject: [PATCH] * Added missing dummy output argument (result is equal to one if BK conditions are satisfied). * Removed useless definition of options_.qz_criterium git-svn-id: https://www.dynare.org/svn/dynare/trunk@3306 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/check.m | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/matlab/check.m b/matlab/check.m index b7dd226ca..1fc75bb76 100644 --- a/matlab/check.m +++ b/matlab/check.m @@ -6,7 +6,7 @@ function result = check % none % % OUTPUTS -% result +% result [integer] scalar, equal to 1 if the derterministic steady state satisfies BK conditions. % % SPECIAL REQUIREMENTS % none @@ -57,15 +57,18 @@ nyf = nnz(dr.kstate(:,2)>M_.maximum_endo_lag+1); [m_lambda,i]=sort(abs(eigenvalues_)); n_explod = nnz(abs(eigenvalues_) > options_.qz_criterium); +result = 0; +if (nyf== n_explod) && (dr.rank == nyf) + result = 1; +end + if options_.noprint == 0 disp(' ') disp('EIGENVALUES:') disp(sprintf('%16s %16s %16s\n','Modulus','Real','Imaginary')) z=[m_lambda real(eigenvalues_(i)) imag(eigenvalues_(i))]'; disp(sprintf('%16.4g %16.4g %16.4g\n',z)) - options_ = set_default_option(options_,'qz_criterium',1.000001); - disp(sprintf('\nThere are %d eigenvalue(s) larger than 1 in modulus ', ... - n_explod)); + disp(sprintf('\nThere are %d eigenvalue(s) larger than 1 in modulus ', n_explod)); disp(sprintf('for %d forward-looking variable(s)',nyf)); disp(' ') if dr.rank == nyf & nyf == n_explod @@ -76,18 +79,4 @@ if options_.noprint == 0 disp(' ') end -options_ = temp_options; - -% 2/9/99 MJ: line 15, added test for absence of exogenous variable. -% 8/27/2000 MJ: change JACOB call. Added ...,1 to cumsum() -% 6/24/01 MJ: added count of abs(eigenvalues) > 1 -% 2/21/02 MJ: count eigenvalues > 1[+1e-5] -% 01/22/03 MJ: warning(warning_state) needs parentheses for Matlab 6.5 -% name conflicts with parameters -% 05/21/03 MJ: replace computation by dr1.m and add rank check -% 06/05/03 MJ: corrected bug when M_.maximum_lag > 0 - - - - - +options_ = temp_options; \ No newline at end of file