From a8201e1803846fe31b5c17e4af479983286e9571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Mon, 3 Jun 2013 15:56:10 +0200 Subject: [PATCH 1/3] Do not check for the steady state in diffuse filter mode Closes #400 --- ComputingTasks.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ComputingTasks.cc b/ComputingTasks.cc index e3d8db26..191f0a8c 100644 --- a/ComputingTasks.cc +++ b/ComputingTasks.cc @@ -358,6 +358,11 @@ EstimationStatement::writeOutput(ostream &output, const string &basename) const else if (atoi(it->second.c_str()) == 2) output << "options_.particle.status = 1;" << endl; + // Do not check for the steady state in diffuse filter mode (#400) + it = options_list.num_options.find("diffuse_filter"); + if (it != options_list.num_options.end() && it->second == "1") + output << "options_.steadystate.nocheck = 1;" << endl; + symbol_list.writeOutput("var_list_", output); output << "dynare_estimation(var_list_);\n"; } From 01aa3e142775075fdacf7db78b910a9e86d65b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 7 Jun 2013 17:16:12 +0200 Subject: [PATCH 2/3] extended_path is a statement, not a block --- DynareFlex.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DynareFlex.ll b/DynareFlex.ll index 626d4b13..af1d867c 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -159,6 +159,7 @@ string eofbuff; /* End of a Dynare statement */ calib_smoother { BEGIN DYNARE_STATEMENT; return token::CALIB_SMOOTHER; } model_diagnostics {BEGIN DYNARE_STATEMENT; return token::MODEL_DIAGNOSTICS;} +extended_path {BEGIN DYNARE_STATEMENT; return token::EXTENDED_PATH;} ; { if (!sigma_e) @@ -185,7 +186,6 @@ string eofbuff; homotopy_setup {BEGIN DYNARE_BLOCK; return token::HOMOTOPY_SETUP;} conditional_forecast_paths {BEGIN DYNARE_BLOCK; return token::CONDITIONAL_FORECAST_PATHS;} svar_identification {BEGIN DYNARE_BLOCK; return token::SVAR_IDENTIFICATION;} -extended_path {BEGIN DYNARE_BLOCK; return token::EXTENDED_PATH;} /* For the semicolon after an "end" keyword */ ; {return Dynare::parser::token_type (yytext[0]);} From 98daf662aa86adca9358c60922e9cf443e854786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 7 Jun 2013 18:17:02 +0200 Subject: [PATCH 3/3] extended_path: new order and hybrid options (ref #152) Also add stub in the doc for the new options --- ComputingTasks.cc | 7 ++++--- DynareBison.yy | 8 ++++++-- DynareFlex.ll | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ComputingTasks.cc b/ComputingTasks.cc index 191f0a8c..101d139b 100644 --- a/ComputingTasks.cc +++ b/ComputingTasks.cc @@ -2440,9 +2440,10 @@ ExtendedPathStatement::writeOutput(ostream &output, const string &basename) cons { // Beware: options do not have the same name in the interface and in the M code... - OptionsList::num_options_t::const_iterator it = options_list.num_options.find("solver_periods"); - if (it != options_list.num_options.end()) - output << "options_.ep.periods = " << it->second << ";" << endl; + for (OptionsList::num_options_t::const_iterator it = options_list.num_options.begin(); + it != options_list.num_options.end(); ++it) + if (it->first != string("periods")) + output << "options_." << it->first << " = " << it->second << ";" << endl; output << "oo_.endo_simul = [ oo_.steady_state, extended_path([], " << options_list.num_options.find("periods")->second << ") ];" << endl diff --git a/DynareBison.yy b/DynareBison.yy index 9a3bca1b..82044fc1 100644 --- a/DynareBison.yy +++ b/DynareBison.yy @@ -103,7 +103,7 @@ class ParsingDriver; %token DEFAULT FIXED_POINT %token FORECAST K_ORDER_SOLVER INSTRUMENTS PRIOR SHIFT MEAN STDEV VARIANCE MODE INTERVAL SHAPE DOMAINN %token GAMMA_PDF GRAPH GRAPH_FORMAT CONDITIONAL_VARIANCE_DECOMPOSITION NOCHECK STD -%token HISTVAL HOMOTOPY_SETUP HOMOTOPY_MODE HOMOTOPY_STEPS HOMOTOPY_FORCE_CONTINUE HP_FILTER HP_NGRID +%token HISTVAL HOMOTOPY_SETUP HOMOTOPY_MODE HOMOTOPY_STEPS HOMOTOPY_FORCE_CONTINUE HP_FILTER HP_NGRID HYBRID %token IDENTIFICATION INF_CONSTANT INITVAL INITVAL_FILE BOUNDS JSCALE INIT %token INT_NUMBER %token DATE_NUMBER @@ -2229,6 +2229,8 @@ extended_path_options_list : extended_path_option COMMA extended_path_options_li extended_path_option : o_periods | o_solver_periods + | o_extended_path_order + | o_hybrid ; model_diagnostics : MODEL_DIAGNOSTICS ';' @@ -2262,7 +2264,9 @@ o_irf_shocks : IRF_SHOCKS EQUAL '(' symbol_list ')' { driver.option_symbol_list( o_hp_filter : HP_FILTER EQUAL non_negative_number { driver.option_num("hp_filter", $3); }; o_hp_ngrid : HP_NGRID EQUAL INT_NUMBER { driver.option_num("hp_ngrid", $3); }; o_periods : PERIODS EQUAL INT_NUMBER { driver.option_num("periods", $3); }; -o_solver_periods : SOLVER_PERIODS EQUAL INT_NUMBER { driver.option_num("solver_periods", $3); }; +o_solver_periods : SOLVER_PERIODS EQUAL INT_NUMBER { driver.option_num("ep.periods", $3); }; +o_extended_path_order : ORDER EQUAL INT_NUMBER { driver.option_num("ep.stochastic.order", $3); }; +o_hybrid : HYBRID { driver.option_num("ep.stochastic.hybrid_order", "2"); }; o_maxit : MAXIT EQUAL INT_NUMBER { driver.option_num("maxit_", $3); }; o_solve_maxit : SOLVE_MAXIT EQUAL INT_NUMBER { driver.option_num("solve_maxit", $3); }; o_cutoff : CUTOFF EQUAL non_negative_number { driver.cutoff($3); }; diff --git a/DynareFlex.ll b/DynareFlex.ll index af1d867c..789a57f1 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -310,6 +310,7 @@ string eofbuff; cycle_reduction {return token::CYCLE_REDUCTION;} logarithmic_reduction {return token::LOGARITHMIC_REDUCTION;} use_univariate_filters_if_singularity_is_detected {return token::USE_UNIVARIATE_FILTERS_IF_SINGULARITY_IS_DETECTED;} +hybrid {return token::HYBRID;} default {return token::DEFAULT;} alpha { yylval->string_val = new string(yytext);