From 0f24420d69fea582d96c2311954b341e2ee43bab Mon Sep 17 00:00:00 2001
From: adjemian <adjemian@ac1d8469-bf42-47a9-8791-bf33cf982152>
Date: Tue, 2 Sep 2008 20:50:30 +0000
Subject: [PATCH] Added a test to warn the user when he tries to estimate a
 model with non zero steady state (for the observed endogenous variables)
 using demeaned data (ie prefilter=1).

git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2023 ac1d8469-bf42-47a9-8791-bf33cf982152
---
 matlab/initial_estimation_checks.m | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m
index 8e4c6cb926..8925d1fed1 100644
--- a/matlab/initial_estimation_checks.m
+++ b/matlab/initial_estimation_checks.m
@@ -81,10 +81,18 @@ function initial_estimation_checks(xparam1,gend,data)
       end
     end
   end
-
+  
   if info(1) > 0
-    disp('Error in computing likelihood for initial parameter values')
-    print_info(info)
+      disp('Error in computing likelihood for initial parameter values')
+      print_info(info)
+  end
+  
+  if any(abs(oo_.steady_state(bayestopt_.mfys))>1e-9) & (options_.prefilter==1) 
+      disp(['You are trying to estimate a model with a non zero steady state for the observed endogenous']
+      disp(['variables using demeaned data!'])
+      error('You should change something in your mod file...')
   end
+  
+  
 
   disp(['Initial value of the log posterior (or likelihood): ' num2str(-fval)]);
-- 
GitLab