From 9ac3e7a582eb65c2d481bbba7fc5eee4593ccb8a Mon Sep 17 00:00:00 2001 From: Michel Juillard Date: Tue, 1 Nov 2011 18:23:12 +0100 Subject: [PATCH] fixing bug when estimating models with a steady state different from zero. Introduced in commit bd00dc11d8fdd969d91663bf635203351a11b36f --- matlab/dynare_estimation_1.m | 7 ------- matlab/dynare_estimation_init.m | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 7333fd7b6..576132a1a 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -72,13 +72,6 @@ if ~isempty(estim_params_) set_parameters(xparam1); end -if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9) - options_.noconstant = 1; -else - options_.noconstant = 0; -end - - % compute sample moments if needed (bvar-dsge) if options_.dsge_var if dataset_.missing.state diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 9dc2ae568..8df351304 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -308,3 +308,19 @@ end dataset_ = initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls); options_.nobs = dataset_.info.ntobs; + +% setting noconstant option +if options_.diffuse_filter + steadystate_check_flag = 0; +else + steadystate_check_flag = 1; +end + +oo_.steady_state = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,steadystate_check_flag); +if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9) + options_.noconstant = 1; +else + options_.noconstant = 0; +end + +