Commit 0f8c5ef2 authored by Houtan Bastani's avatar Houtan Bastani

substitute leads/lags appropriately when identification or sensitivity...

substitute leads/lags appropriately when identification or sensitivity statements are present. #1631

Effective cherry pick of preprocessor@4c71d143
parent b3e7cf33
Pipeline #572 failed with stages
in 288 minutes and 51 seconds
/*
* Copyright (C) 2003-2017 Dynare Team
* Copyright (C) 2003-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -663,6 +663,7 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct, Warning
if (it != options_list.num_options.end()
&& it->second == "1")
mod_file_struct.identification_present = true;
mod_file_struct.sensitivity_present = true;
}
void
......
/*
* Copyright (C) 2006-2017 Dynare Team
* Copyright (C) 2006-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -129,7 +129,9 @@ ModFile::checkPass(bool nostrict)
|| mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present
|| mod_file_struct.discretionary_policy_present
|| mod_file_struct.calib_smoother_present;
|| mod_file_struct.calib_smoother_present
|| mod_file_struct.identification_present
|| mod_file_struct.sensitivity_present;
// Allow empty model only when doing a standalone BVAR estimation
if (dynamic_model.equation_number() == 0
......@@ -407,7 +409,9 @@ ModFile::transformPass(bool nostrict, bool compute_xrefs)
|| mod_file_struct.osr_present
|| mod_file_struct.ramsey_policy_present
|| mod_file_struct.discretionary_policy_present
|| mod_file_struct.calib_smoother_present)
|| mod_file_struct.calib_smoother_present
|| mod_file_struct.identification_present
|| mod_file_struct.sensitivity_present)
{
// In stochastic models, create auxiliary vars for leads and lags greater than 2, on both endos and exos
dynamic_model.substituteEndoLeadGreaterThanTwo(false);
......
/*
* Copyright (C) 2006-2017 Dynare Team
* Copyright (C) 2006-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -38,6 +38,7 @@ ModFileStructure::ModFileStructure() :
bvar_present(false),
svar_identification_present(false),
identification_present(false),
sensitivity_present(false),
estimation_analytic_derivation(false),
partial_information(false),
k_order_solver(false),
......
/*
* Copyright (C) 2006-2017 Dynare Team
* Copyright (C) 2006-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -68,6 +68,8 @@ public:
bool svar_identification_present;
//! Whether an identification statement is present or the identification option of dynare_sensitivity statement is equal to one
bool identification_present;
//! Whether a sensitivity statement is present
bool sensitivity_present;
//! Whether the option analytic_derivation is given to estimation
bool estimation_analytic_derivation;
//! Whether the option partial_information is given to stoch_simul/estimation/osr/ramsey_policy
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment