Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,12 @@ ModFile::addStatement(Statement *st) ...@@ -86,6 +86,12 @@ ModFile::addStatement(Statement *st)
statements.push_back(st); statements.push_back(st);
} }
void
ModFile::addStatementAtFront(Statement *st)
{
statements.insert(statements.begin(), st);
}
void void
ModFile::checkPass() ModFile::checkPass()
{ {
...@@ -226,7 +232,7 @@ ModFile::transformPass() ...@@ -226,7 +232,7 @@ ModFile::transformPass()
{ {
int sid = symbol_table.addSymbol("dsge_prior_weight", eParameter); int sid = symbol_table.addSymbol("dsge_prior_weight", eParameter);
if (!mod_file_struct.dsge_var_calibrated.empty()) if (!mod_file_struct.dsge_var_calibrated.empty())
addStatement(new InitParamStatement(sid, addStatementAtFront(new InitParamStatement(sid,
expressions_tree.AddNumConstant(mod_file_struct.dsge_var_calibrated), expressions_tree.AddNumConstant(mod_file_struct.dsge_var_calibrated),
symbol_table)); symbol_table));
} }
......
...@@ -82,6 +82,8 @@ private: ...@@ -82,6 +82,8 @@ private:
public: public:
//! Add a statement //! Add a statement
void addStatement(Statement *st); void addStatement(Statement *st);
//! Add a statement at the front of the statements vector
void addStatementAtFront(Statement *st);
//! Evaluate all the statements //! Evaluate all the statements
/*! \param warn_uninit Should a warning be displayed for uninitialized endogenous/exogenous/parameters ? */ /*! \param warn_uninit Should a warning be displayed for uninitialized endogenous/exogenous/parameters ? */
void evalAllExpressions(bool warn_uninit); void evalAllExpressions(bool warn_uninit);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment