Commit bc62662f authored by Houtan Bastani's avatar Houtan Bastani
Browse files

DSGE-Var: bug fix. Add init param statement at the before the estimation statement

parent 3aaccc59
......@@ -86,6 +86,12 @@ ModFile::addStatement(Statement *st)
statements.push_back(st);
}
void
ModFile::addStatementAtFront(Statement *st)
{
statements.insert(statements.begin(), st);
}
void
ModFile::checkPass()
{
......@@ -226,9 +232,9 @@ ModFile::transformPass()
{
int sid = symbol_table.addSymbol("dsge_prior_weight", eParameter);
if (!mod_file_struct.dsge_var_calibrated.empty())
addStatement(new InitParamStatement(sid,
expressions_tree.AddNumConstant(mod_file_struct.dsge_var_calibrated),
symbol_table));
addStatementAtFront(new InitParamStatement(sid,
expressions_tree.AddNumConstant(mod_file_struct.dsge_var_calibrated),
symbol_table));
}
catch (SymbolTable::AlreadyDeclaredException &e)
{
......
......@@ -82,6 +82,8 @@ private:
public:
//! Add a statement
void addStatement(Statement *st);
//! Add a statement at the front of the statements vector
void addStatementAtFront(Statement *st);
//! Evaluate all the statements
/*! \param warn_uninit Should a warning be displayed for uninitialized endogenous/exogenous/parameters ? */
void evalAllExpressions(bool warn_uninit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment