Commit 51649194 authored by Houtan Bastani's avatar Houtan Bastani Committed by MichelJuillard
Browse files

ms-dsge: add number_of_lags and parameters option to front end

parent dea58be5
......@@ -153,7 +153,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 DURATION NUMBER_OF_REGIMES
%token MARKOV_SWITCHING CHAIN DURATION NUMBER_OF_REGIMES NUMBER_OF_LAGS
%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
......@@ -844,6 +844,8 @@ ms_options : o_chain
| o_duration
| o_restrictions
| o_number_of_regimes
| o_number_of_lags
| o_parameters
;
svar : SVAR '(' svar_options_list ')' ';'
......@@ -2700,6 +2702,8 @@ o_duration : DURATION EQUAL non_negative_number
{ driver.option_num("ms.duration",$3); }
;
o_number_of_regimes : NUMBER_OF_REGIMES EQUAL INT_NUMBER { driver.option_num("ms.number_of_regimes",$3); };
o_number_of_lags : NUMBER_OF_LAGS EQUAL INT_NUMBER { driver.option_num("ms.number_of_lags",$3); };
o_parameters : PARAMETERS EQUAL '[' symbol_list ']' { driver.option_symbol_list("ms.parameters"); };
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
......
......@@ -602,6 +602,7 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
<DYNARE_STATEMENT,DYNARE_BLOCK>upper_cholesky {return token::UPPER_CHOLESKY;}
<DYNARE_STATEMENT,DYNARE_BLOCK>lower_cholesky {return token::LOWER_CHOLESKY;}
<DYNARE_STATEMENT>chain {return token::CHAIN;}
<DYNARE_STATEMENT>number_of_lags {return token::NUMBER_OF_LAGS;}
<DYNARE_STATEMENT>number_of_regimes {return token::NUMBER_OF_REGIMES;}
<DYNARE_STATEMENT>duration {return token::DURATION;}
<DYNARE_STATEMENT>coefficients {return token::COEFFICIENTS;}
......
......@@ -1138,6 +1138,15 @@ ParsingDriver::option_symbol_list(const string &name_option)
error("Variables passed to irf_shocks must be exogenous. Caused by: " + *it);
}
if (name_option.compare("ms.parameters")==0)
{
vector<string> parameters = symbol_list.get_symbols();
for (vector<string>::const_iterator it = parameters.begin();
it != parameters.end(); it++)
if (mod_file->symbol_table.getType(*it) != eParameter)
error("Variables passed to the parameters option of the markov_switching statement must be parameters. Caused by: " + *it);
}
options_list.symbol_list_options[name_option] = symbol_list;
symbol_list.clear();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment