preprocessor: prior_posterior_function: change option 'prior_posterior_sampling_draws' to 'sampling_draws' #1076

issue#70
Houtan Bastani 2015-10-13 17:40:15 +02:00
parent ca44a87a54
commit 3907462ae9
3 changed files with 6 additions and 10 deletions

View File

@ -167,17 +167,13 @@ PriorPosteriorFunctionStatement::checkPass(ModFileStructure &mod_file_struct, Wa
void
PriorPosteriorFunctionStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
OptionsList::num_options_t::const_iterator it =
options_list.num_options.find("prior_posterior_sampling_draws");
if (it != options_list.num_options.end())
cout << it->first << " = " << it->second << ";" << endl;
options_list.writeOutput(output);
string type = "posterior";
if (options_list.num_options.find("prior") != options_list.num_options.end())
type = "prior";
output << "oo_ = execute_prior_posterior_function("
<< "'" << options_list.string_options.find("function")->second << "',"
<< "'" << options_list.string_options.find("function")->second << "', "
<< "M_, options_, oo_, estim_params_, bayestopt_, dataset_, dataset_info, "
<< "'" << type << "');" << endl;
}

View File

@ -162,7 +162,7 @@ class ParsingDriver;
%token SELECTED_VARIABLES_ONLY COVA_COMPUTE SIMULATION_FILE_TAG FILE_TAG
%token NO_ERROR_BANDS ERROR_BAND_PERCENTILES SHOCKS_PER_PARAMETER NO_CREATE_INIT
%token SHOCK_DRAWS FREE_PARAMETERS MEDIAN DATA_OBS_NBR NEIGHBORHOOD_WIDTH PVALUE_KS PVALUE_CORR
%token FILTERED_PROBABILITIES REAL_TIME_SMOOTHED PRIOR_POSTERIOR_FUNCTION PRIOR_POSTERIOR_SAMPLING_DRAWS
%token FILTERED_PROBABILITIES REAL_TIME_SMOOTHED PRIOR_POSTERIOR_FUNCTION SAMPLING_DRAWS
%token PROPOSAL_TYPE PROPOSAL_UPPER_BOUND PROPOSAL_LOWER_BOUND PROPOSAL_DRAWS USE_MEAN_CENTER
%token ADAPTIVE_MH_DRAWS THINNING_FACTOR COEFFICIENTS_PRIOR_HYPERPARAMETERS
%token CONVERGENCE_STARTING_VALUE CONVERGENCE_ENDING_VALUE CONVERGENCE_INCREMENT_VALUE
@ -1034,7 +1034,7 @@ prior_posterior_function_options_list : prior_posterior_function_options_list CO
prior_posterior_function_options : o_function
| o_prior
| o_posterior
| o_prior_posterior_sampling_draws
| o_sampling_draws
;
simul : SIMUL ';'
@ -3084,7 +3084,7 @@ o_occbin : OCCBIN {driver.option_num("occbin", "1"); };
o_function : FUNCTION EQUAL filename { driver.option_str("function", $3); };
o_prior : PRIOR { driver.option_num("prior", "1"); };
o_posterior : POSTERIOR { driver.option_num("posterior", "1"); };
o_prior_posterior_sampling_draws : PRIOR_POSTERIOR_SAMPLING_DRAWS EQUAL INT_NUMBER { driver.option_num("prior_posterior_sampling_draws",$3); };
o_sampling_draws : SAMPLING_DRAWS EQUAL INT_NUMBER { driver.option_num("sampling_draws",$3); };
range : symbol ':' symbol
{

View File

@ -221,7 +221,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
<INITIAL>std {BEGIN DYNARE_STATEMENT; return token::STD;}
<INITIAL>corr {BEGIN DYNARE_STATEMENT; return token::CORR;}
<DYNARE_STATEMENT>function {return token::FUNCTION;}
<DYNARE_STATEMENT>prior_posterior_sampling_draws {return token::PRIOR_POSTERIOR_SAMPLING_DRAWS;}
<DYNARE_STATEMENT>sampling_draws {return token::SAMPLING_DRAWS;}
<INITIAL>prior_posterior_function {BEGIN DYNARE_STATEMENT; return token::PRIOR_POSTERIOR_FUNCTION;}
/* Inside of a Dynare statement */