PAC: add growth correction term for definition of Z₁ in the MCE case
parent
4191cec9aa
commit
5bef185370
|
@ -4067,7 +4067,8 @@ DynamicModel::declarePacModelConsistentExpectationEndogs(const string &name)
|
|||
void
|
||||
DynamicModel::addPacModelConsistentExpectationEquation(const string &name, int discount_symb_id,
|
||||
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
||||
ExprNode::subst_table_t &diff_subst_table)
|
||||
ExprNode::subst_table_t &diff_subst_table,
|
||||
expr_t growth)
|
||||
{
|
||||
int pac_target_symb_id;
|
||||
try
|
||||
|
@ -4190,7 +4191,11 @@ DynamicModel::addPacModelConsistentExpectationEquation(const string &name, int d
|
|||
AddMinus(AddTimes(A, AddMinus(const_cast<VariableNode *>(target_base_diff_node), fs)), fp));
|
||||
addEquation(neweq, -1);
|
||||
neqs++;
|
||||
pac_expectation_substitution[{name, eqtag}] = AddVariable(mce_z1_symb_id);
|
||||
/* The growth correction term is not added to the definition of Z₁
|
||||
because the latter is recursive. Rather put it at the level of the
|
||||
substition of pac_expectation operator. */
|
||||
expr_t growth_correction = growth ? AddTimes(AddVariable(pac_growth_neutrality_params.at(name)), growth) : Zero;
|
||||
pac_expectation_substitution[{name, eqtag}] = AddPlus(AddVariable(mce_z1_symb_id), growth_correction);
|
||||
}
|
||||
cout << "Pac Model Consistent Expectation: added " << neqs << " auxiliary variables and equations for model " << name << "." << endl;
|
||||
}
|
||||
|
|
|
@ -582,7 +582,7 @@ public:
|
|||
//! Add model consistent expectation equation for pac model
|
||||
void addPacModelConsistentExpectationEquation(const string &name, int discount,
|
||||
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
||||
ExprNode::subst_table_t &diff_subst_table);
|
||||
ExprNode::subst_table_t &diff_subst_table, expr_t growth);
|
||||
|
||||
//! Table to undiff LHS variables for pac vector z
|
||||
vector<int> getUndiffLHSForPac(const string &aux_model_name,
|
||||
|
|
|
@ -490,7 +490,8 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, bool
|
|||
auto eqtag_and_lag = dynamic_model.walkPacParameters(pms->name);
|
||||
if (pms->aux_model_name.empty())
|
||||
dynamic_model.addPacModelConsistentExpectationEquation(pms->name, symbol_table.getID(pms->discount),
|
||||
eqtag_and_lag, diff_subst_table);
|
||||
eqtag_and_lag, diff_subst_table,
|
||||
pms->growth);
|
||||
else
|
||||
dynamic_model.fillPacModelInfo(pms->name, lhs, max_lag, aux_model_type,
|
||||
eqtag_and_lag, nonstationary, pms->growth);
|
||||
|
|
Loading…
Reference in New Issue