Commit b0c819cb authored by Sébastien Villemot's avatar Sébastien Villemot

Compute 3rd order dynamic derivatives for “dynare_sensitivity(identification)”

Ref. #40
parent 23a08a36
Pipeline #2919 passed with stages
in 3 minutes and 33 seconds
......@@ -1275,7 +1275,11 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct, Warning
{
if (auto it = options_list.num_options.find("identification");
it != options_list.num_options.end() && it->second == "1")
mod_file_struct.identification_present = true;
{
mod_file_struct.identification_present = true;
// The following triggers 3rd order derivatives, see preprocessor#40
mod_file_struct.identification_order = max(mod_file_struct.identification_order, 2);
}
mod_file_struct.sensitivity_present = true;
}
......@@ -2731,7 +2735,7 @@ IdentificationStatement::checkPass(ModFileStructure &mod_file_struct, WarningCon
mod_file_struct.identification_order = max(mod_file_struct.identification_order, order);
}
else
// The default value for order is 1 (which triggers 2nd order dynamic derivatives)
// The default value for order is 1 (which triggers 2nd order dynamic derivatives, see preprocessor#40)
mod_file_struct.identification_order = max(mod_file_struct.identification_order, 1);
}
......
......@@ -779,7 +779,7 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri
exit(EXIT_FAILURE);
}
int derivsOrder = max(mod_file_struct.order_option,
mod_file_struct.identification_order + 1);
mod_file_struct.identification_order + 1); // See preprocessor#40
if (mod_file_struct.sensitivity_present || linear || output == FileOutputType::second)
derivsOrder = max(derivsOrder, 2);
if (mod_file_struct.estimation_analytic_derivation || output == FileOutputType::third)
......
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