From 1f0897005fd262b34f64832f5c07ffa7aa8e96e7 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Tue, 21 Jul 2015 10:02:34 +0200 Subject: [PATCH 1/2] Add mod.file lost in 6d048d87665c8cb151f2ddbb4957303f955975d4 --- .../Linear_steady_state_xfail.mod | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/steady_state/Linear_steady_state_xfail.mod diff --git a/tests/steady_state/Linear_steady_state_xfail.mod b/tests/steady_state/Linear_steady_state_xfail.mod new file mode 100644 index 000000000..501a9b4af --- /dev/null +++ b/tests/steady_state/Linear_steady_state_xfail.mod @@ -0,0 +1,23 @@ +// Test whether a nonlinear equation specfied as a linear model is correctly filtered out +var A; + +varexo epsilona; +parameters rho; + +rho = .42; + +model(linear); +log(A) = rho*log(A(-1)) + epsilona; +end; + +initval; + A = 1.34; +end; + +steady; + + + + + + From 84e04522bf36e66634cb8337845fb7534f296ddf Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Tue, 21 Jul 2015 10:41:47 +0200 Subject: [PATCH 2/2] Account for options_.nk potentially being empty. --- matlab/dynare_estimation_1.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 1e4eeb34d..a813fbc0a 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -504,7 +504,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha oo_.Smoother.TrendCoeffs = trend_coeff; oo_.Smoother.Variance = P; i_endo = bayestopt_.smoother_saved_var_list; - if options_.nk ~= 0 && ~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.pshape> 0) && options_.load_mh_file)) + if ~isempty(options_.nk) && options_.nk ~= 0 && (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.pshape> 0) && options_.load_mh_file))) oo_.FilteredVariablesKStepAhead = aK(options_.filter_step_ahead, ... i_endo,:); if isfield(options_,'kalman_algo') @@ -522,7 +522,7 @@ if (~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.psha i1 = dr.order_var(bayestopt_.smoother_var_list(i)); eval(['oo_.SmoothedVariables.' deblank(M_.endo_names(i1,:)) ' = ' ... 'atT(i,:)'';']); - if options_.nk > 0 && ~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.pshape> 0) && options_.load_mh_file)) + if ~isempty(options_.nk) && options_.nk > 0 && ~((any(bayestopt_.pshape > 0) && options_.mh_replic) || (any(bayestopt_.pshape> 0) && options_.load_mh_file)) eval(['oo_.FilteredVariables.' deblank(M_.endo_names(i1,:)) ... ' = squeeze(aK(1,i,2:end-(options_.nk-1)));']); end