From 89fd14f026888f7eb4cec746faa762908b42def1 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Thu, 19 May 2016 18:57:47 +0200 Subject: [PATCH] Filter out unit root cases that lead to crashes --- matlab/identification_analysis.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matlab/identification_analysis.m b/matlab/identification_analysis.m index 902761f29..855c16049 100644 --- a/matlab/identification_analysis.m +++ b/matlab/identification_analysis.m @@ -87,7 +87,9 @@ if info(1)==0, if init, indJJ = (find(max(abs(JJ'),[],1)>1.e-8)); if isempty(indJJ) && any(any(isnan(JJ))) - error('identification_analysis: There are NaN in the JJ matrix. Please check whether your model has units roots and you forgot to set diffuse_filter=1.' ) + error('There are NaN in the JJ matrix. Please check whether your model has units roots and you forgot to set diffuse_filter=1.' ) + elseif any(any(isnan(gam))) + error('There are NaN''s in the theoretical moments: make sure that for non-stationary models stationary transformations of non-stationary observables are used for checking identification. [TIP: use first differences].') end while length(indJJ)