From d80d7aa1e767238ab625be0c4c22e2988934bddd Mon Sep 17 00:00:00 2001 From: Ferhat Mihoubi <ferhat.mihoubi@univ-evry.fr> Date: Sun, 1 Jul 2012 15:15:52 +0200 Subject: [PATCH] Adds the cycle reduction algorithm to solve the polynomial equation for retrieving the coefficients associated to the endogenous variables in the decision rule. --- DynareBison.yy | 11 +++++++++-- DynareFlex.ll | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/DynareBison.yy b/DynareBison.yy index 738e6fe5..83ddd556 100644 --- a/DynareBison.yy +++ b/DynareBison.yy @@ -95,8 +95,8 @@ class ParsingDriver; %token BVAR_PRIOR_DECAY BVAR_PRIOR_FLAT BVAR_PRIOR_LAMBDA %token BVAR_PRIOR_MU BVAR_PRIOR_OMEGA BVAR_PRIOR_TAU BVAR_PRIOR_TRAIN %token BVAR_REPLIC BYTECODE -%token CALIB_SMOOTHER CHANGE_TYPE CHECK CONDITIONAL_FORECAST CONDITIONAL_FORECAST_PATHS CONF_SIG CONSTANT CONTROLLED_VAREXO CORR COVAR CUTOFF -%token DATAFILE FILE DOUBLING DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE CALIBRATION +%token CALIB_SMOOTHER CHANGE_TYPE CHECK CONDITIONAL_FORECAST CONDITIONAL_FORECAST_PATHS CONF_SIG CONSTANT CONTROLLED_VAREXO CORR COVAR CUTOFF CYCLE_REDUCTION +%token DATAFILE FILE DOUBLING DR DR_CYCLE_REDUCTION_TOL DR_ALGO DROP DSAMPLE DYNASAVE DYNATYPE CALIBRATION %token END ENDVAL EQUAL ESTIMATION ESTIMATED_PARAMS ESTIMATED_PARAMS_BOUNDS ESTIMATED_PARAMS_INIT EXTENDED_PATH %token FILENAME FILTER_STEP_AHEAD FILTERED_VARS FIRST_OBS LAST_OBS SET_TIME %token <string_val> FLOAT_NUMBER @@ -937,6 +937,8 @@ stoch_simul_options : o_dr_algo | o_pruning | o_sylvester | o_sylvester_fixed_point_tol + | o_dr + | o_dr_cycle_reduction_tol ; symbol_list : symbol_list symbol @@ -1504,6 +1506,8 @@ estimation_options : o_datafile | o_lyapunov | o_lyapunov_fixed_point_tol | o_lyapunov_doubling_tol + | o_dr + | o_dr_cycle_reduction_tol | o_analytic_derivation ; @@ -2313,6 +2317,9 @@ o_lyapunov : LYAPUNOV EQUAL FIXED_POINT {driver.option_num("lyapunov_fp", "1"); | LYAPUNOV EQUAL DEFAULT {driver.option_num("lyapunov_fp", "0");driver.option_num("lyapunov_db", "0"); driver.option_num("lyapunov_srs", "0");}; o_lyapunov_fixed_point_tol : LYAPUNOV_FIXED_POINT_TOL EQUAL non_negative_number {driver.option_num("lyapunov_fixed_point_tol",$3);}; o_lyapunov_doubling_tol : LYAPUNOV_DOUBLING_TOL EQUAL non_negative_number {driver.option_num("lyapunov_doubling_tol",$3);}; +o_dr : DR EQUAL CYCLE_REDUCTION {driver.option_num("dr_cycle_reduction", "1"); } + | DR EQUAL DEFAULT {driver.option_num("dr_cycle_reduction", "0"); }; +o_dr_cycle_reduction_tol : DR_CYCLE_REDUCTION_TOL EQUAL non_negative_number {driver.option_num("dr_cycle_reduction_tol",$3);}; o_bvar_prior_tau : BVAR_PRIOR_TAU EQUAL signed_number { driver.option_num("bvar_prior_tau", $3); }; o_bvar_prior_decay : BVAR_PRIOR_DECAY EQUAL non_negative_number { driver.option_num("bvar_prior_decay", $3); }; diff --git a/DynareFlex.ll b/DynareFlex.ll index 5e96dc37..c5413092 100644 --- a/DynareFlex.ll +++ b/DynareFlex.ll @@ -302,6 +302,7 @@ string eofbuff; <DYNARE_STATEMENT>fixed_point {return token::FIXED_POINT;} <DYNARE_STATEMENT>doubling {return token::DOUBLING;} <DYNARE_STATEMENT>square_root_solver {return token::SQUARE_ROOT_SOLVER;} +<DYNARE_STATEMENT>cycle_reduction {return token::CYCLE_REDUCTION;} <DYNARE_STATEMENT>default {return token::DEFAULT;} <DYNARE_STATEMENT>alpha { yylval->string_val = new string(yytext); @@ -505,9 +506,11 @@ string eofbuff; <DYNARE_STATEMENT>order {return token::ORDER;} <DYNARE_STATEMENT>sylvester {return token::SYLVESTER;} <DYNARE_STATEMENT>lyapunov {return token::LYAPUNOV;} +<DYNARE_STATEMENT>dr {return token::DR;} <DYNARE_STATEMENT>sylvester_fixed_point_tol {return token::SYLVESTER_FIXED_POINT_TOL;} <DYNARE_STATEMENT>lyapunov_fixed_point_tol {return token::LYAPUNOV_FIXED_POINT_TOL;} <DYNARE_STATEMENT>lyapunov_doubling_tol {return token::LYAPUNOV_DOUBLING_TOL;} +<DYNARE_STATEMENT>dr_cycle_reduction_tol {return token::DR_CYCLE_REDUCTION_TOL;} <DYNARE_STATEMENT>replic {return token::REPLIC;} <DYNARE_STATEMENT>ar {return token::AR;} <DYNARE_STATEMENT>nofunctions {return token::NOFUNCTIONS;} -- GitLab