From 07d9b14ccc5c40136ac77d06cc0bd0f716c419d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 30 Jan 2014 17:57:36 +0100
Subject: [PATCH] Rewrote the error message issued when the prefilter option in
 used while the steady state of the observed variables is non zero (introduced
 in commit d82252e805c007a99de353e49d1a3fa2f961d748). (cherry picked from
 commit 7864e0ec82dcc944013e997a552d31cb533eebfe)

---
 matlab/dynare_estimation_init.m | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index a1b61eb3f..5359470ba 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -85,7 +85,7 @@ if options_.lik_init == 1
     if isempty(options_.qz_criterium)
         options_.qz_criterium = 1-1e-6;
     elseif options_.qz_criterium > 1-eps
-        error(['estimation: option qz_criterium is too large for estimating ' ...
+        error(['Estimation: option qz_criterium is too large for estimating ' ...
                'a stationary model. If your model contains unit roots, use ' ...
                'option diffuse_filter'])
     end
@@ -274,7 +274,7 @@ end
 
 if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model)
     if ~options_.smoother
-        error('ESTIMATION: the ''estimated_params'' block is mandatory (unless you are running a smoother)')
+        error('Estimation: the ''estimated_params'' block is mandatory (unless you are running a smoother)')
     end
     xparam1 = [];
     bayestopt_.lb = [];
@@ -494,10 +494,12 @@ else
     options_.noconstant = 0;
     % If the data are prefiltered then there must not be constants in the
     % measurement equation of the DSGE model or in the DSGE-VAR model.
-    if options_.prefilter == 1
-        fprintf('\nestimation_init: You have specified the option "prefilter" to demean your data,\n')
-        fprintf('estimation_init: but your observation equations are not mean zero. Either change your observation\n')
-        fprintf('estimation_init: equation or drop the prefiltering.\n')
+    if options_.prefilter
+        skipline()
+        disp('You have specified the option "prefilter" to demean your data but the')
+        disp('steady state of of the observed variables is non zero.')
+        disp('Either change the measurement equations, by centering the observed')
+        disp('variables in the model block, or drop the prefiltering.')
         error('The option "prefilter" is inconsistent with the non-zero mean measurement equations in the model.')
     end
 end
-- 
GitLab