Commit 49a51ed8 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Forbid the combination of estimation/mode_file and estimated_params_init/use_calibration

Closes #549
parent 07bea735
......@@ -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
{
......
......@@ -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;
};
......
......@@ -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)
{
}
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment