diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc index 9f14c410..ec75edb8 100644 --- a/src/ParsingDriver.cc +++ b/src/ParsingDriver.cc @@ -2038,6 +2038,12 @@ ParsingDriver::ramsey_model() else if (planner_discount) error("ramsey_model: the 'planner_discount' option cannot be used when the 'optimal_policy_discount_factor' parameter is explicitly declared."); + // Check that instruments are declared endogenous (#72) + if (auto it = options_list.symbol_list_options.find("instruments"); + it != options_list.symbol_list_options.end()) + for (const auto &s : it->second.getSymbols()) + check_symbol_is_endogenous(s); + mod_file->addStatement(make_unique(options_list)); options_list.clear(); planner_discount = nullptr; @@ -2059,6 +2065,12 @@ ParsingDriver::ramsey_policy() else if (planner_discount) error("ramsey_policy: the 'planner_discount' option cannot be used when the 'optimal_policy_discount_factor' parameter is explicitly declared."); + // Check that instruments are declared endogenous (#72) + if (auto it = options_list.symbol_list_options.find("instruments"); + it != options_list.symbol_list_options.end()) + for (const auto &s : it->second.getSymbols()) + check_symbol_is_endogenous(s); + mod_file->addStatement(make_unique(mod_file->symbol_table, symbol_list, options_list)); options_list.clear(); @@ -2114,6 +2126,12 @@ ParsingDriver::discretionary_policy() planner_discount = data_tree->One; init_param("optimal_policy_discount_factor", planner_discount); + // Check that instruments are declared endogenous (#72) + if (auto it = options_list.symbol_list_options.find("instruments"); + it != options_list.symbol_list_options.end()) + for (const auto &s : it->second.getSymbols()) + check_symbol_is_endogenous(s); + mod_file->addStatement(make_unique(symbol_list, options_list)); symbol_list.clear(); options_list.clear();