From 3085aa2e30ed532dc04a4c293abfef663b36215b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Fri, 16 Nov 2012 10:37:31 +0100 Subject: [PATCH] Block and/or bytecode are not compatible with stoch_simul order >= 2 - move error message from M to preprocessor - document in the reference manual --- doc/dynare.texi | 4 +++- matlab/dr_block.m | 3 --- preprocessor/ModFile.cc | 7 +++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/dynare.texi b/doc/dynare.texi index 4721f2f38..861700c51 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -3062,7 +3062,9 @@ Order of Taylor approximation. Acceptable values are @code{1}, @code{2} and @code{3}. Note that for third order, @code{k_order_solver} option is implied and only empirical moments are available (you must provide a value for @code{periods} -option). Default: @code{2} (except after an @code{estimation} command, +option). A value of @code{2} or more is incompatible with @code{block} +and @code{bytecode} options of the @code{model} block. Default: +@code{2} (except after an @code{estimation} command, in which case the default is the value used for the estimation). @item k_order_solver diff --git a/matlab/dr_block.m b/matlab/dr_block.m index 0e5088ae9..f4589eeb1 100644 --- a/matlab/dr_block.m +++ b/matlab/dr_block.m @@ -52,9 +52,6 @@ function [dr,info,M_,options_,oo_] = dr_block(dr,task,M_,options_,oo_) info = 0; verbose = 0; -if options_.order > 1 - error('2nd and 3rd order approximation not implemented with block option') -end z = repmat(dr.ys,1,M_.maximum_lead + M_.maximum_lag + 1); zx = repmat([oo_.exo_simul oo_.exo_det_simul],M_.maximum_lead + M_.maximum_lag + 1, 1); diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc index 3f6b4a429..f15ee9648 100644 --- a/preprocessor/ModFile.cc +++ b/preprocessor/ModFile.cc @@ -161,6 +161,13 @@ ModFile::checkPass() exit(EXIT_FAILURE); } + if ((block || byte_code) && stochastic_statement_present + && mod_file_struct.order_option >= 2) + { + cerr << "ERROR: In 'model' block, 'block' and/or 'bytecode' options are not yet compatible with a stochastic model at order >= 2" << endl; + exit(EXIT_FAILURE); + } + if (use_dll && (block || byte_code)) { cerr << "ERROR: In 'model' block, 'use_dll' option is not compatible with 'block' or 'bytecode'" << endl; -- GitLab