diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index 2a9d3b2c878c5a5ee502c2a6616c3a451e3aedf1..b56685497b02c2832f03961c34ac8d0244d1ce09 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -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 { diff --git a/preprocessor/ComputingTasks.hh b/preprocessor/ComputingTasks.hh index 6d67638c428f6763a9ffec95c57d924b1bb1169e..feddfbbc2ebe1b857453d2c6d0be6847b7df6f43 100644 --- a/preprocessor/ComputingTasks.hh +++ b/preprocessor/ComputingTasks.hh @@ -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; }; diff --git a/preprocessor/Statement.cc b/preprocessor/Statement.cc index 4dbf8ba52d86cc8e60e9d4ce0ad2a7dcb6f62204..f990f6110ba7ad94026e3871c9bd7c2e8d87dcfe 100644 --- a/preprocessor/Statement.cc +++ b/preprocessor/Statement.cc @@ -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) { } diff --git a/preprocessor/Statement.hh b/preprocessor/Statement.hh index d4dad9b8775812f013063dc3b397b6f3da3dbca8..7cd7b92141c156672a33f41084e75882990744e0 100644 --- a/preprocessor/Statement.hh +++ b/preprocessor/Statement.hh @@ -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;