diff --git a/matlab/ms-sbvar/initialize_ms_sbvar_options.m b/matlab/ms-sbvar/initialize_ms_sbvar_options.m index 77cfd66dd..be8a8f423 100644 --- a/matlab/ms-sbvar/initialize_ms_sbvar_options.m +++ b/matlab/ms-sbvar/initialize_ms_sbvar_options.m @@ -60,6 +60,7 @@ options_.ms.bayesian_prior = 1; options_.ms.alpha = 1; options_.ms.beta = 1; options_.ms.gsig2_lmdm = 50^2; +options_.ms.specification = 2; if isfield(options_.ms,'initial_year') options_.ms = rmfield(options_.ms,'initial_year'); end diff --git a/matlab/ms-sbvar/ms_sbvar_setup.m b/matlab/ms-sbvar/ms_sbvar_setup.m index 4b80e3495..7132be7a2 100644 --- a/matlab/ms-sbvar/ms_sbvar_setup.m +++ b/matlab/ms-sbvar/ms_sbvar_setup.m @@ -358,6 +358,10 @@ nrows = 1; ncols = nvar; fn_fprintmatrix(fidForC, xM', nrows, ncols, indxFloat) +%=== Specification +fprintf(fidForC,'\n%s','//== Specification (0=default 1=Sims-Zha 2=Random Walk) ==//'); +fprintf(fidForC,'\n%d\n\n',options_.ms.specification); + %=== Uiconst: nvar-by-1 cell. In each cell, nvar-by-qi orthonormal basis for the null of the ith % equation contemporaneous restriction matrix where qi is the number of free parameters. % With this transformation, we have ai = Ui*bi or Ui'*ai = bi where ai is a vector diff --git a/preprocessor/DynareBison.yy b/preprocessor/DynareBison.yy index adada745a..f2e405e84 100644 --- a/preprocessor/DynareBison.yy +++ b/preprocessor/DynareBison.yy @@ -144,8 +144,8 @@ class ParsingDriver; /* end of GSA analysis*/ %token FREQ INITIAL_YEAR INITIAL_SUBPERIOD FINAL_YEAR FINAL_SUBPERIOD DATA VLIST LOG_VAR PERCENT_VAR %token VLISTLOG VLISTPER -%token RESTRICTIONS RESTRICTION_FNAME CROSS_RESTRICTIONS NLAGS CONTEMP_REDUCED_FORM REAL_PSEUDO_FORECAST -%token DUMMY_OBS NSTATES INDXSCALESSTATES NO_BAYESIAN_PRIOR +%token RESTRICTIONS RESTRICTION_FNAME CROSS_RESTRICTIONS NLAGS CONTEMP_REDUCED_FORM REAL_PSEUDO_FORECAST NONE +%token DUMMY_OBS NSTATES INDXSCALESSTATES NO_BAYESIAN_PRIOR SPECIFICATION SIMS_ZHA %token ALPHA BETA ABAND NINV CMS NCMS CNUM %token GSIG2_LMDM Q_DIAG FLAT_PRIOR NCSK NSTD %token INDXPARR INDXOVR INDXAP APBAND INDXIMF IMFBAND INDXFORE FOREBAND INDXGFOREHAT INDXGIMFHAT @@ -1630,6 +1630,7 @@ ms_estimation_option : o_coefficients_prior_hyperparameters | o_alpha | o_beta | o_gsig2_lmdm + | o_specification | o_output_file_tag | o_file_tag | o_no_create_init @@ -2025,6 +2026,11 @@ o_indxscalesstates : INDXSCALESSTATES EQUAL INT_NUMBER {driver.option_num("ms.in o_alpha : ALPHA EQUAL non_negative_number {driver.option_num("ms.alpha",$3); }; o_beta : BETA EQUAL non_negative_number {driver.option_num("ms.beta",$3); }; o_gsig2_lmdm : GSIG2_LMDM EQUAL INT_NUMBER {driver.option_num("ms.gsig2_lmdm",$3); }; +o_specification : SPECIFICATION EQUAL SIMS_ZHA + {driver.option_num("ms.specification","1"); } + | SPECIFICATION EQUAL NONE + {driver.option_num("ms.specification","0"); } + ; o_q_diag : Q_DIAG EQUAL non_negative_number {driver.option_num("ms.q_diag",$3); }; o_flat_prior : FLAT_PRIOR EQUAL INT_NUMBER {driver.option_num("ms.flat_prior",$3); }; o_ncsk : NCSK EQUAL INT_NUMBER {driver.option_num("ms.ncsk",$3); }; diff --git a/preprocessor/DynareFlex.ll b/preprocessor/DynareFlex.ll index 74b5ef403..1a8f32f55 100644 --- a/preprocessor/DynareFlex.ll +++ b/preprocessor/DynareFlex.ll @@ -277,6 +277,9 @@ string eofbuff; return token::BETA; } gsig2_lmdm {return token::GSIG2_LMDM;} +specification {return token::SPECIFICATION;} +sims_zha {return token::SIMS_ZHA;} +none {return token::NONE;} q_diag {return token::Q_DIAG;} flat_prior {return token::FLAT_PRIOR;} ncsk {return token::NCSK;}