Run detrending engine if trend variables are present, even if unused in a var(deflator=…) statement

Closes: #113
master
Sébastien Villemot 2023-01-24 14:11:27 +01:00
parent 74e5bbf537
commit 1c813a1cf9
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 5 additions and 1 deletions

View File

@ -2879,7 +2879,7 @@ DynamicModel::computeDynJacobianCols()
for (const auto &[symb_lag, deriv_id] : deriv_id_table)
{
int symb_id{symb_lag.first};
int tsid{symbol_table.getTypeSpecificID(symb_id)};
int tsid{symbol_table.getTypeSpecificID(symb_id)}; // At this point, there is no trend_var
if (SymbolType type{symbol_table.getType(symb_id)};
type == SymbolType::exogenous)
dyn_jacobian_cols_table[deriv_id] = ordered_dyn_endo.size() + tsid;

View File

@ -272,6 +272,10 @@ ParsingDriver::set_planner_discount_latex_name(string tex_name)
void
ParsingDriver::end_trend_var(bool log_trend, expr_t growth_factor, const vector<pair<string, string>> &symbol_list)
{
/* Run detrending engine if trend variables are present, even if unused in
a var(deflator=) statement (see #113). */
mod_file->nonstationary_variables = true;
vector<int> declared_trend_vars;
for (auto &[name, tex_name] : symbol_list)
{