ramsey_{model,policy}, discretionary_policy: check that instruments are declared endogenous
Closes: #72pac-components
parent
3d215020ae
commit
b12746190d
|
@ -2038,6 +2038,12 @@ ParsingDriver::ramsey_model()
|
||||||
else if (planner_discount)
|
else if (planner_discount)
|
||||||
error("ramsey_model: the 'planner_discount' option cannot be used when the 'optimal_policy_discount_factor' parameter is explicitly declared.");
|
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<RamseyModelStatement>(options_list));
|
mod_file->addStatement(make_unique<RamseyModelStatement>(options_list));
|
||||||
options_list.clear();
|
options_list.clear();
|
||||||
planner_discount = nullptr;
|
planner_discount = nullptr;
|
||||||
|
@ -2059,6 +2065,12 @@ ParsingDriver::ramsey_policy()
|
||||||
else if (planner_discount)
|
else if (planner_discount)
|
||||||
error("ramsey_policy: the 'planner_discount' option cannot be used when the 'optimal_policy_discount_factor' parameter is explicitly declared.");
|
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<RamseyPolicyStatement>(mod_file->symbol_table,
|
mod_file->addStatement(make_unique<RamseyPolicyStatement>(mod_file->symbol_table,
|
||||||
symbol_list, options_list));
|
symbol_list, options_list));
|
||||||
options_list.clear();
|
options_list.clear();
|
||||||
|
@ -2114,6 +2126,12 @@ ParsingDriver::discretionary_policy()
|
||||||
planner_discount = data_tree->One;
|
planner_discount = data_tree->One;
|
||||||
init_param("optimal_policy_discount_factor", planner_discount);
|
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<DiscretionaryPolicyStatement>(symbol_list, options_list));
|
mod_file->addStatement(make_unique<DiscretionaryPolicyStatement>(symbol_list, options_list));
|
||||||
symbol_list.clear();
|
symbol_list.clear();
|
||||||
options_list.clear();
|
options_list.clear();
|
||||||
|
|
Loading…
Reference in New Issue