take care of extra exos in estimated_params_init

time-shift
Houtan Bastani 2015-04-02 17:57:12 +02:00
parent 3422bfcf93
commit 3842303fc4
2 changed files with 27 additions and 0 deletions

View File

@ -975,6 +975,32 @@ EstimatedParamsInitStatement::checkPass(ModFileStructure &mod_file_struct, Warni
mod_file_struct.estim_params_use_calib = true;
}
Statement *
EstimatedParamsInitStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
{
vector<EstimationParams> new_estim_params_list;
SymbolTable *new_symbol_table = dynamic_datatree.getSymbolTable();
try
{
for (vector<EstimationParams>::const_iterator it = estim_params_list.begin();
it != estim_params_list.end(); it++)
if (!it->name2.empty())
{
new_symbol_table->getID(it->name);
new_symbol_table->getID(it->name2);
}
else
new_symbol_table->getID(it->name);
}
catch (SymbolTable::UnknownSymbolNameException &e)
{
cerr << "ERROR: A variable in the estimated_params_init statement was not found in the symbol table" << endl
<< " This likely means that you have declared a varexo that is not used in the model" << endl;
exit(EXIT_FAILURE);
}
return new EstimatedParamsInitStatement(estim_params_list, *new_symbol_table, use_calibration);
}
void
EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basename) const
{

View File

@ -333,6 +333,7 @@ public:
const bool use_calibration_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename) const;
virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
};
class EstimatedParamsBoundsStatement : public Statement