From e37448faaf9b0ae4d8423317da54113b479a3d6d Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sun, 15 Jun 2014 12:26:36 +0200 Subject: [PATCH] Fix exceptions when prefiltering was requested with loglinear option The check for an existing mean was based on the unlogged steady state, resulting in wrong error messages --- matlab/initial_estimation_checks.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/matlab/initial_estimation_checks.m b/matlab/initial_estimation_checks.m index e418965f3..86e17fba1 100644 --- a/matlab/initial_estimation_checks.m +++ b/matlab/initial_estimation_checks.m @@ -161,10 +161,12 @@ if info(1) > 0 print_info(info, DynareOptions.noprint, DynareOptions) end -if any(abs(DynareResults.steady_state(BayesInfo.mfys))>1e-9) && (DynareOptions.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...') +if DynareOptions.prefilter==1 + if (~DynareOptions.loglinear && any(abs(DynareResults.steady_state(BayesInfo.mfys))>1e-9)) || (DynareOptions.loglinear && any(abs(log(DynareResults.steady_state(BayesInfo.mfys)))>1e-9)) + 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 end if ~isequal(DynareOptions.mode_compute,11)