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

time-shift
Houtan Bastani 2015-10-13 17:40:15 +02:00
parent f0e94d6475
commit 145e2d5542
6 changed files with 9 additions and 13 deletions

View File

@ -12833,7 +12833,7 @@ Executes the user-defined function on draws from the prior. Either this option o
@item `posterior'
Executes the user-defined function on draws from the posterior. Either this option or the @ref{prior} option is required.
@item prior_posterior_sampling_draws = @var{INTEGER}
@item sampling_draws = @var{INTEGER}
Number of draws used for sampling. Default: 500.
@end table

View File

@ -47,7 +47,7 @@ end
%Create function handle
functionhandle=str2func(posterior_function_name);
n_draws=options_.prior_posterior_sampling_draws;
n_draws=options_.sampling_draws;
% Get informations about the _posterior_draws files.
if strcmpi(type,'posterior')
%% discard first mh_drop percent of the draws:

View File

@ -297,7 +297,7 @@ options_.xls_range = '';
options_.prior_draws = 10000;
% Prior posterior function sampling draws
options_.prior_posterior_sampling_draws = 500;
options_.sampling_draws = 500;
options_.forecast = 0;

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 */