diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index eee52067486289111ee79f4d4b2f175f89c959d2..3e681ef6da339e4147d8c8dedaab686c3e69bf34 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -351,15 +351,6 @@ EstimatedParamsStatement::EstimatedParamsStatement(const vector<EstimationParams estim_params_list(estim_params_list_arg), symbol_table(symbol_table_arg) { - for (vector<EstimationParams>::const_iterator it = estim_params_list.begin(); - it != estim_params_list.end(); it++) - if (it->prior == "1") //BETA_PDF is associated with "1" in DynareBison.yy - if (dynamic_cast<NumConstNode *>(it->mean)->isNumConstNodeEqualTo(0.5) && - dynamic_cast<NumConstNode *>(it->std)->isNumConstNodeEqualTo(0.5)) - { - cerr << "ERROR: The prior density is not defined for the beta distribution when the mean = standard deviation = 0.5." << endl; - exit(EXIT_FAILURE); - } } void @@ -367,8 +358,18 @@ EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct) { for (vector<EstimationParams>::const_iterator it = estim_params_list.begin(); it != estim_params_list.end(); it++) - if (it->name == "dsge_prior_weight") - mod_file_struct.dsge_prior_weight_in_estimated_params = true; + { + if (it->name == "dsge_prior_weight") + mod_file_struct.dsge_prior_weight_in_estimated_params = true; + + if (it->prior == "1") //BETA_PDF is associated with "1" in DynareBison.yy + if (dynamic_cast<NumConstNode *>(it->mean)->isNumConstNodeEqualTo(0.5) && + dynamic_cast<NumConstNode *>(it->std)->isNumConstNodeEqualTo(0.5)) + { + cerr << "ERROR: The prior density is not defined for the beta distribution when the mean = standard deviation = 0.5." << endl; + exit(EXIT_FAILURE); + } + } } void