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