diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc index eb976e00..9b6e68b9 100644 --- a/src/ComputingTasks.cc +++ b/src/ComputingTasks.cc @@ -2112,6 +2112,12 @@ OsrStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation opt && *opt == "true") mod_file_struct.partial_information = true; + // Fill in mod_file_struct.estimation_analytic_derivation + if (auto opt = options_list.get_if("analytic_derivation"); + opt && *opt == "1") + mod_file_struct.osr_analytic_derivation = true; + + // Option k_order_solver (implicit when order >= 3) if (auto opt = options_list.get_if("k_order_solver"); (opt && *opt == "true") || mod_file_struct.order_option >= 3) diff --git a/src/DynareBison.yy b/src/DynareBison.yy index 06ce4ebd..a7d50583 100644 --- a/src/DynareBison.yy +++ b/src/DynareBison.yy @@ -2356,6 +2356,8 @@ osr_options : stoch_simul_primary_options | o_optim | o_huge_number | o_silent_optimizer + | o_analytic_derivation + | o_analytic_derivation_mode ; osr : OSR ';' diff --git a/src/ModFile.cc b/src/ModFile.cc index 34ea4486..23f86c7a 100644 --- a/src/ModFile.cc +++ b/src/ModFile.cc @@ -670,6 +670,7 @@ ModFile::computingPass(bool no_tmp_terms, OutputType output, int params_derivs_o if (mod_file_struct.identification_present || mod_file_struct.estimation_analytic_derivation + || mod_file_struct.osr_analytic_derivation || (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_present || mod_file_struct.analytic_jacobian_present))) paramsDerivsOrder = params_derivs_order; @@ -722,6 +723,7 @@ ModFile::computingPass(bool no_tmp_terms, OutputType output, int params_derivs_o int paramsDerivsOrder = 0; if (mod_file_struct.identification_present || mod_file_struct.estimation_analytic_derivation + || mod_file_struct.osr_analytic_derivation || (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_present || mod_file_struct.analytic_jacobian_present))) paramsDerivsOrder = params_derivs_order; dynamic_model.computingPass(derivsOrder, paramsDerivsOrder, global_eval_context, no_tmp_terms, block, use_dll); diff --git a/src/Statement.hh b/src/Statement.hh index cd1585ff..6a8bdc7f 100644 --- a/src/Statement.hh +++ b/src/Statement.hh @@ -74,6 +74,8 @@ struct ModFileStructure bool sensitivity_present{false}; //! Whether the option analytic_derivation is given to estimation bool estimation_analytic_derivation{false}; + //! Whether the option analytic_derivation is given to osr + bool osr_analytic_derivation{false}; //! Whether the option partial_information is given to stoch_simul/estimation/osr/ramsey_policy bool partial_information{false}; //! Whether the "k_order_solver" option is used (explictly, or implicitly if order >= 3)