From d1e9f253940b9925a0c9dd8eb53345555b6d6e54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 29 Mar 2023 16:05:00 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20ramsey=5Fpolicy:=20lift=20restri?=
 =?UTF-8?q?ction=20that=20order=20must=20be=20=E2=A9=BD=202?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This restriction no longer exists, and is actually not applied to stoch_simul
when following ramsey_model.

(manually cherry picked from commit e9babf024254c17a345390fd9fbebcb6ce62bb71)
---
 src/ComputingTasks.cc | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 3c53bb6c..2d1a3119 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -759,20 +759,10 @@ RamseyPolicyStatement::checkPass(ModFileStructure &mod_file_struct, WarningConso
   // of  a stochastic Ramsey problem if present in the *.mod file
   mod_file_struct.ramsey_policy_present = true;
 
-  /* Fill in option_order of mod_file_struct
-     Since ramsey policy needs one further order of derivation (for example, for 1st order
-     approximation, it needs 2nd derivatives), we add 1 to the order declared by user */
+  // Fill in option_order of mod_file_struct
   if (auto it = options_list.num_options.find("order");
       it != options_list.num_options.end())
-    {
-      int order = stoi(it->second);
-      if (order > 2)
-        {
-          cerr << "ERROR: ramsey_policy: order > 2 is not  implemented" << endl;
-          exit(EXIT_FAILURE);
-        }
-      mod_file_struct.order_option = max(mod_file_struct.order_option, order + 1);
-    }
+    mod_file_struct.order_option = max(mod_file_struct.order_option, stoi(it->second));
 
   // Fill in mod_file_struct.partial_information
   if (auto it = options_list.num_options.find("partial_information");
-- 
GitLab