diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index 169333e65..b77520e6b 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -1359,7 +1359,7 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(const OptionsList &options_li void MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename) const { - OptionsList::num_options_t::const_iterator itChain, itState, itNOS, itDuration; + OptionsList::num_options_t::const_iterator itChain, itState, itNOR, itDuration; itChain = options_list.num_options.find("ms.chain"); if (itChain == options_list.num_options.end()) @@ -1376,13 +1376,13 @@ MarkovSwitchingStatement::writeOutput(ostream &output, const string &basename) c } itState = options_list.num_options.find("ms.state"); - itNOS = options_list.num_options.find("ms.number_of_states"); + itNOR = options_list.num_options.find("ms.number_of_regimes"); if (itState != options_list.num_options.end() - && itNOS == options_list.num_options.end()) + && itNOR == options_list.num_options.end()) output << "options_.ms.ms_chain(" << itChain->second << ").state(" << itState->second << ").duration = " << itDuration->second << ";" << endl; else if (itState == options_list.num_options.end() - && itNOS != options_list.num_options.end()) - for (int i = 0; i < atoi(itNOS->second.c_str()); i++) + && itNOR != options_list.num_options.end()) + for (int i = 0; i < atoi(itNOR->second.c_str()); i++) output << "options_.ms.ms_chain(" << itChain->second << ").state(" << i+1 << ").duration = " << itDuration->second << ";" << endl; else { diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy index 00623ef13..ef3a2b988 100644 --- a/preprocessor/DynareBison.yy +++ b/preprocessor/DynareBison.yy @@ -156,7 +156,7 @@ class ParsingDriver; %token SBVAR TREND_VAR DEFLATOR GROWTH_FACTOR MS_IRF MS_VARIANCE_DECOMPOSITION %token MS_ESTIMATION MS_SIMULATION MS_COMPUTE_MDD MS_COMPUTE_PROBABILITIES MS_FORECAST %token SVAR_IDENTIFICATION EQUATION EXCLUSION LAG UPPER_CHOLESKY LOWER_CHOLESKY MONTHLY QUARTERLY -%token MARKOV_SWITCHING CHAIN STATE DURATION NUMBER_OF_STATES +%token MARKOV_SWITCHING CHAIN STATE DURATION NUMBER_OF_REGIMES %token SVAR COEFF COEFFICIENTS VARIANCES CONSTANTS EQUATIONS %token EXTERNAL_FUNCTION EXT_FUNC_NAME EXT_FUNC_NARGS FIRST_DERIV_PROVIDED SECOND_DERIV_PROVIDED %token SELECTED_VARIABLES_ONLY COVA_COMPUTE SIMULATION_FILE_TAG FILE_TAG @@ -742,7 +742,7 @@ ms_options_list : ms_options_list COMMA ms_options ms_options : o_chain | o_state | o_duration - | o_number_of_states + | o_number_of_regimes ; svar : SVAR '(' svar_options_list ')' ';' @@ -2226,7 +2226,7 @@ o_duration : DURATION EQUAL non_negative_number | DURATION EQUAL INF_CONSTANT { driver.option_num("ms.duration","Inf"); } ; -o_number_of_states : NUMBER_OF_STATES EQUAL INT_NUMBER { driver.option_num("ms.number_of_states",$3); }; +o_number_of_regimes : NUMBER_OF_REGIMES EQUAL INT_NUMBER { driver.option_num("ms.number_of_regimes",$3); }; o_coefficients : COEFFICIENTS { driver.option_str("ms.coefficients","svar_coefficients"); }; o_variances : VARIANCES { driver.option_str("ms.variances","svar_variances"); }; o_equations : EQUATIONS EQUAL vec_int diff --git a/preprocessor/DynareFlex.ll b/preprocessor/DynareFlex.ll index 626aad86b..e2b2a1708 100644 --- a/preprocessor/DynareFlex.ll +++ b/preprocessor/DynareFlex.ll @@ -505,7 +505,7 @@ string eofbuff; lower_cholesky {return token::LOWER_CHOLESKY;} chain {return token::CHAIN;} state {return token::STATE;} -number_of_states {return token::NUMBER_OF_STATES;} +number_of_regimes {return token::NUMBER_OF_REGIMES;} duration {return token::DURATION;} coefficients {return token::COEFFICIENTS;} variances {return token::VARIANCES;} diff --git a/preprocessor/ParsingDriver.cc b/preprocessor/ParsingDriver.cc index 4bc662010..6b0e65d22 100644 --- a/preprocessor/ParsingDriver.cc +++ b/preprocessor/ParsingDriver.cc @@ -1747,14 +1747,14 @@ ParsingDriver::markov_switching() error("The value passed to the chain option must be greater than zero."); it0 = options_list.num_options.find("ms.state"); - it1 = options_list.num_options.find("ms.number_of_states"); + it1 = options_list.num_options.find("ms.number_of_regimes"); if ((it0 == options_list.num_options.end()) && (it1 == options_list.num_options.end())) - error("Either a state option or a number_of_states option must be passed to the markov_switching statement."); + error("Either a state option or a number_of_regimes option must be passed to the markov_switching statement."); if ((it0 != options_list.num_options.end()) && (it1 != options_list.num_options.end())) - error("You cannot pass both a state option and a number_of_states option to the markov_switching statement."); + error("You cannot pass both a state option and a number_of_regimes option to the markov_switching statement."); if (it0 != options_list.num_options.end()) if (atoi(it0->second.c_str()) <= 0) @@ -1762,7 +1762,7 @@ ParsingDriver::markov_switching() if (it1 != options_list.num_options.end()) if (atoi(it1->second.c_str()) <= 0) - error("The value passed to the number_of_states option must be greater than zero."); + error("The value passed to the number_of_regimes option must be greater than zero."); string infStr("Inf"); it0 = options_list.num_options.find("ms.duration"); diff --git a/tests/ms-sbvar/test_ms_variances.mod b/tests/ms-sbvar/test_ms_variances.mod index acf3e827c..6f6d2477b 100644 --- a/tests/ms-sbvar/test_ms_variances.mod +++ b/tests/ms-sbvar/test_ms_variances.mod @@ -6,7 +6,7 @@ svar_identification; lower_cholesky; end; -markov_switching(chain=1,number_of_states=2,duration=2.5); +markov_switching(chain=1,number_of_regimes=2,duration=2.5); svar(variances, chain=1); diff --git a/tests/ms-sbvar/test_ms_variances_repeated_runs.mod b/tests/ms-sbvar/test_ms_variances_repeated_runs.mod index 35f64ab84..a4ffc6fb0 100644 --- a/tests/ms-sbvar/test_ms_variances_repeated_runs.mod +++ b/tests/ms-sbvar/test_ms_variances_repeated_runs.mod @@ -6,7 +6,7 @@ svar_identification; lower_cholesky; end; -markov_switching(chain=1,number_of_states=2,duration=2.5); +markov_switching(chain=1,number_of_regimes=2,duration=2.5); svar(variances, chain=1);