take care of extra exos in estimated_params_bounds

issue#70
Houtan Bastani 2015-04-02 18:03:16 +02:00
parent 5a60f2d9d7
commit fd5b9279da
2 changed files with 27 additions and 0 deletions

View File

@ -1067,6 +1067,32 @@ EstimatedParamsBoundsStatement::EstimatedParamsBoundsStatement(const vector<Esti
{
}
Statement *
EstimatedParamsBoundsStatement::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_bounds 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 EstimatedParamsBoundsStatement(estim_params_list, *new_symbol_table);
}
void
EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basename) const
{

View File

@ -345,6 +345,7 @@ public:
EstimatedParamsBoundsStatement(const vector<EstimationParams> &estim_params_list_arg,
const SymbolTable &symbol_table_arg);
virtual void writeOutput(ostream &output, const string &basename) const;
virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
};
class OptimWeightsStatement : public Statement