From 3c0ebb4cc544cd11f467f6b4985011c116d81b0e Mon Sep 17 00:00:00 2001
From: Michel Juillard <michel.juillard@mjui.fr>
Date: Thu, 1 Sep 2011 11:37:40 +0200
Subject: [PATCH] added error for near 0/0 on diagonal of Real Generalized
Schur decomposition (info=7) and corrected error in test for singular w1
submatrix, introduced in Sept. 2010.
---
matlab/dr1.m | 7 ++++++-
matlab/print_info.m | 3 +++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/matlab/dr1.m b/matlab/dr1.m
index 3fa897cf48..5ac1c7e27d 100644
--- a/matlab/dr1.m
+++ b/matlab/dr1.m
@@ -378,6 +378,11 @@ else % use original Dynare solver
if ~exist('OCTAVE_VERSION')
dr.eigval = eig(e,d);
end
+ for i=1:nd
+ if abs(ss(i,i)) < 1e-6 && abs(tt(i,i)) < 1e-6
+ info(7) = 1;
+ end
+ end
return
end
@@ -412,7 +417,7 @@ else % use original Dynare solver
% derivatives with respect to dynamic state variables
% forward variables
w1 =w(1:n3,n2:nd);
- if ~isfloat(w1) && (condest(w1) > 1e9)
+ if ~isscalar(w1) && (condest(w1) > 1e9)
% condest() fails on a scalar under Octave
info(1) = 5;
info(2) = condest(w1);
diff --git a/matlab/print_info.m b/matlab/print_info.m
index d05ea71997..4d7ecc82a1 100644
--- a/matlab/print_info.m
+++ b/matlab/print_info.m
@@ -48,6 +48,9 @@ if ~noprint
case 6
error(['The Jacobian matrix evaluated at the steady state contains elements ' ...
'that are not real or are infinite'])
+ case 7
+ error(['One of the eigenvalue is is close to 0/0 (the absolute ' ...
+ 'value of numerator and denominator is smaller than 1e-6).'])
case 19
error('The steadystate file did not compute the steady state (inconsistent deep parameters).')
case 20
--
GitLab