Forbid the combination of estimation/mode_file and estimated_params_init/use_calibration

Closes #549
time-shift
Sébastien Villemot 2013-12-09 16:23:49 +01:00
parent 07bea735de
commit 49a51ed808
4 changed files with 19 additions and 1 deletions

View File

@ -342,6 +342,13 @@ EstimationStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
cerr << "ERROR: The estimation statement requires a data file to be supplied via the datafile option." << endl;
exit(EXIT_FAILURE);
}
if (options_list.string_options.find("mode_file") != options_list.string_options.end() &&
mod_file_struct.estim_params_use_calib)
{
cerr << "ERROR: The mode_file option of the estimation statement is incompatible with the use_calibration option of the estimated_params_init block." << endl;
exit(EXIT_FAILURE);
}
}
void
@ -593,6 +600,13 @@ EstimatedParamsInitStatement::EstimatedParamsInitStatement(const vector<Estimati
{
}
void
EstimatedParamsInitStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
{
if (use_calibration)
mod_file_struct.estim_params_use_calib = true;
}
void
EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basename) const
{

View File

@ -293,6 +293,7 @@ public:
EstimatedParamsInitStatement(const vector<EstimationParams> &estim_params_list_arg,
const SymbolTable &symbol_table_arg,
const bool use_calibration_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename) const;
};

View File

@ -49,7 +49,8 @@ ModFileStructure::ModFileStructure() :
bayesian_irf_present(false),
estimation_data_statement_present(false),
last_markov_switching_chain(0),
calib_smoother_present(false)
calib_smoother_present(false),
estim_params_use_calib(false)
{
}

View File

@ -98,6 +98,8 @@ public:
int last_markov_switching_chain;
//! Whether a calib_smoother statement is present
bool calib_smoother_present;
//! Whether there is an estimated_params_init with use_calibration
bool estim_params_use_calib;
//! Set of parameters used within shocks blocks, inside the expressions
//! defining the values of covariances (stored as symbol ids)
set<int> parameters_within_shocks_values;