Fix indexing in M_.endo_trends

It would use 0-based indexing, instead of 1-based.

Ref. dynare#1648

Closes: #109
master
Sébastien Villemot 2022-12-14 12:05:12 +01:00
parent 8cb3437d2d
commit 2758f46c83
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 2 additions and 2 deletions

View File

@ -1789,13 +1789,13 @@ DynamicModel::writeDriverOutput(ostream &output, const string &basename, bool es
if (auto it = nonstationary_symbols_map.find(symb_id); it != nonstationary_symbols_map.end())
{
auto [is_log, deflator] = it->second;
output << "M_.endo_trends(" << i << ")."
output << "M_.endo_trends(" << i+1 << ")."
<< (is_log ? "log_deflator" : "deflator") << " = '";
deflator->writeJsonOutput(output, {}, {});
output << "';" << endl;
auto growth_factor = const_cast<DynamicModel *>(this)->AddDivide(deflator, deflator->decreaseLeadsLags(1))->removeTrendLeadLag(trend_symbols_map)->replaceTrendVar();
output << "M_.endo_trends(" << i << ")."
output << "M_.endo_trends(" << i+1 << ")."
<< (is_log ? "log_growth_factor" : "growth_factor") << " = '";
growth_factor->writeJsonOutput(output, {}, {});
output << "';" << endl;