method_of_moments: remove var_list_
parent
1c3e6f89af
commit
f354458418
|
@ -4742,9 +4742,7 @@ Smoother2histvalStatement::writeJsonOutput(ostream &output) const
|
|||
output << "}";
|
||||
}
|
||||
|
||||
MethodOfMomentsStatement::MethodOfMomentsStatement(SymbolList symbol_list_arg,
|
||||
OptionsList options_list_arg) :
|
||||
symbol_list{move(symbol_list_arg)},
|
||||
MethodOfMomentsStatement::MethodOfMomentsStatement(OptionsList options_list_arg) :
|
||||
options_list{move(options_list_arg)}
|
||||
{
|
||||
}
|
||||
|
@ -4752,15 +4750,6 @@ MethodOfMomentsStatement::MethodOfMomentsStatement(SymbolList symbol_list_arg,
|
|||
void
|
||||
MethodOfMomentsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
{
|
||||
try
|
||||
{
|
||||
symbol_list.checkPass(warnings, { SymbolType::endogenous });
|
||||
}
|
||||
catch (SymbolList::SymbolListException &e)
|
||||
{
|
||||
cerr << "ERROR: method_of_moments: " << e.message << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
mod_file_struct.mom_estimation_present = true;
|
||||
// Fill in option_order of mod_file_struct
|
||||
if (auto it = options_list.num_options.find("order");
|
||||
|
@ -4815,7 +4804,6 @@ MethodOfMomentsStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
|
|||
void
|
||||
MethodOfMomentsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
symbol_list.writeOutput("var_list_", output);
|
||||
options_list.writeOutput(output, "options_mom_");
|
||||
|
||||
output << "[oo_, options_mom_, M_] = method_of_moments(bayestopt_, options_, oo_, estim_params_, M_, options_mom_);" << endl;
|
||||
|
@ -4830,11 +4818,6 @@ MethodOfMomentsStatement::writeJsonOutput(ostream &output) const
|
|||
output << ", ";
|
||||
options_list.writeJsonOutput(output);
|
||||
}
|
||||
if (!symbol_list.empty())
|
||||
{
|
||||
output << ", ";
|
||||
symbol_list.writeJsonOutput(output);
|
||||
}
|
||||
output << "}";
|
||||
}
|
||||
|
||||
|
|
|
@ -1125,10 +1125,9 @@ public:
|
|||
class MethodOfMomentsStatement : public Statement
|
||||
{
|
||||
private:
|
||||
const SymbolList symbol_list;
|
||||
const OptionsList options_list;
|
||||
public:
|
||||
MethodOfMomentsStatement(SymbolList symbol_list_arg, OptionsList options_list_arg);
|
||||
MethodOfMomentsStatement(OptionsList options_list_arg);
|
||||
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
|
||||
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
|
||||
void writeJsonOutput(ostream &output) const override;
|
||||
|
|
|
@ -1345,8 +1345,7 @@ method_of_moments : METHOD_OF_MOMENTS ';'
|
|||
{ driver.method_of_moments(); }
|
||||
| METHOD_OF_MOMENTS '(' method_of_moments_options_list ')' ';'
|
||||
{ driver.method_of_moments(); }
|
||||
| METHOD_OF_MOMENTS '(' method_of_moments_options_list ')' symbol_list ';'
|
||||
{ driver.method_of_moments(); }
|
||||
;
|
||||
|
||||
method_of_moments_options_list : method_of_moments_option COMMA method_of_moments_options_list
|
||||
| method_of_moments_option
|
||||
|
|
|
@ -3216,8 +3216,7 @@ ParsingDriver::perfect_foresight_solver()
|
|||
void
|
||||
ParsingDriver::method_of_moments()
|
||||
{
|
||||
mod_file->addStatement(make_unique<MethodOfMomentsStatement>(symbol_list, options_list));
|
||||
symbol_list.clear();
|
||||
mod_file->addStatement(make_unique<MethodOfMomentsStatement>(options_list));
|
||||
options_list.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue