pac: output model type in M_.pac.(model_name)
parent
5e1521f42b
commit
f88682d683
|
@ -3657,6 +3657,8 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
|
||||||
if (growth_param_index >= 0)
|
if (growth_param_index >= 0)
|
||||||
output << modstruct << "pac." << it.first << ".growth_neutrality_param_index = "
|
output << modstruct << "pac." << it.first << ".growth_neutrality_param_index = "
|
||||||
<< symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl;
|
<< symbol_table.getTypeSpecificID(growth_param_index) + 1 << ";" << endl;
|
||||||
|
|
||||||
|
output << modstruct << "pac." << it.first << ".auxiliary_model_type = '" << get<2>(it.second) << "';" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto & pit : pac_equation_info)
|
for (auto & pit : pac_equation_info)
|
||||||
|
@ -4606,6 +4608,7 @@ void
|
||||||
DynamicModel::fillPacModelInfo(const string &pac_model_name,
|
DynamicModel::fillPacModelInfo(const string &pac_model_name,
|
||||||
vector<int> lhs,
|
vector<int> lhs,
|
||||||
int max_lag,
|
int max_lag,
|
||||||
|
string aux_model_type,
|
||||||
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
||||||
const vector<bool> &nonstationary,
|
const vector<bool> &nonstationary,
|
||||||
int growth_symb_id, int growth_lag)
|
int growth_symb_id, int growth_lag)
|
||||||
|
@ -4675,7 +4678,7 @@ DynamicModel::fillPacModelInfo(const string &pac_model_name,
|
||||||
|
|
||||||
pac_expectation_substitution[make_pair(pac_model_name, eqtag)] = subExpr;
|
pac_expectation_substitution[make_pair(pac_model_name, eqtag)] = subExpr;
|
||||||
}
|
}
|
||||||
pac_model_info[pac_model_name] = make_tuple(move(lhs), growth_param_index);
|
pac_model_info[pac_model_name] = make_tuple(move(lhs), growth_param_index, move(aux_model_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -346,6 +346,7 @@ public:
|
||||||
void fillPacModelInfo(const string &pac_model_name,
|
void fillPacModelInfo(const string &pac_model_name,
|
||||||
vector<int> lhs,
|
vector<int> lhs,
|
||||||
int max_lag,
|
int max_lag,
|
||||||
|
string aux_model_type,
|
||||||
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
|
||||||
const vector<bool> &nonstationary,
|
const vector<bool> &nonstationary,
|
||||||
int growth_symb_id, int growth_lag);
|
int growth_symb_id, int growth_lag);
|
||||||
|
@ -476,8 +477,8 @@ public:
|
||||||
map<pair<string, string>, expr_t> pac_expectation_substitution;
|
map<pair<string, string>, expr_t> pac_expectation_substitution;
|
||||||
|
|
||||||
//! Store info about pac models:
|
//! Store info about pac models:
|
||||||
//! pac_model_name -> (lhsvars, growth_param_index)
|
//! pac_model_name -> (lhsvars, growth_param_index, aux_model_type)
|
||||||
map<string, pair<vector<int>, int>> pac_model_info;
|
map<string, tuple<vector<int>, int, string>> pac_model_info;
|
||||||
|
|
||||||
//! Store info about pac models specific to the equation they appear in
|
//! Store info about pac models specific to the equation they appear in
|
||||||
//! (pac_model_name, standardized_eqtag) ->
|
//! (pac_model_name, standardized_eqtag) ->
|
||||||
|
|
|
@ -421,8 +421,10 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
|
||||||
int max_lag;
|
int max_lag;
|
||||||
vector<int> lhs;
|
vector<int> lhs;
|
||||||
vector<bool> nonstationary;
|
vector<bool> nonstationary;
|
||||||
|
string aux_model_type = "";
|
||||||
if (trend_component_model_table.isExistingTrendComponentModelName(pms->aux_model_name))
|
if (trend_component_model_table.isExistingTrendComponentModelName(pms->aux_model_name))
|
||||||
{
|
{
|
||||||
|
aux_model_type = "trend_component";
|
||||||
max_lag = trend_component_model_table.getMaxLag(pms->aux_model_name) + 1;
|
max_lag = trend_component_model_table.getMaxLag(pms->aux_model_name) + 1;
|
||||||
lhs = dynamic_model.getUndiffLHSForPac(pms->aux_model_name, diff_subst_table);
|
lhs = dynamic_model.getUndiffLHSForPac(pms->aux_model_name, diff_subst_table);
|
||||||
// All lhs variables in a trend component model are nonstationary
|
// All lhs variables in a trend component model are nonstationary
|
||||||
|
@ -430,6 +432,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
|
||||||
}
|
}
|
||||||
else if (var_model_table.isExistingVarModelName(pms->aux_model_name))
|
else if (var_model_table.isExistingVarModelName(pms->aux_model_name))
|
||||||
{
|
{
|
||||||
|
aux_model_type = "var";
|
||||||
max_lag = var_model_table.getMaxLag(pms->aux_model_name);
|
max_lag = var_model_table.getMaxLag(pms->aux_model_name);
|
||||||
lhs = var_model_table.getLhs(pms->aux_model_name);
|
lhs = var_model_table.getLhs(pms->aux_model_name);
|
||||||
// nonstationary variables in a VAR are those that are in diff
|
// nonstationary variables in a VAR are those that are in diff
|
||||||
|
@ -449,7 +452,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
|
||||||
dynamic_model.addPacModelConsistentExpectationEquation(pms->name, symbol_table.getID(pms->discount),
|
dynamic_model.addPacModelConsistentExpectationEquation(pms->name, symbol_table.getID(pms->discount),
|
||||||
eqtag_and_lag, diff_subst_table);
|
eqtag_and_lag, diff_subst_table);
|
||||||
else
|
else
|
||||||
dynamic_model.fillPacModelInfo(pms->name, lhs, max_lag,
|
dynamic_model.fillPacModelInfo(pms->name, lhs, max_lag, aux_model_type,
|
||||||
eqtag_and_lag, nonstationary, pms->growth_symb_id, pms->growth_lag);
|
eqtag_and_lag, nonstationary, pms->growth_symb_id, pms->growth_lag);
|
||||||
dynamic_model.substitutePacExpectation(pms->name);
|
dynamic_model.substitutePacExpectation(pms->name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue