From a27bc872ad7ed18ba380b425dfd66996b2f7116e Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Mon, 16 Aug 2021 14:52:29 +0200
Subject: [PATCH] execute_prior_posterior_function.m: move error in correct,
 transform error into warning

---
 matlab/execute_prior_posterior_function.m | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/matlab/execute_prior_posterior_function.m b/matlab/execute_prior_posterior_function.m
index 10449c2c57..c37a27d63f 100644
--- a/matlab/execute_prior_posterior_function.m
+++ b/matlab/execute_prior_posterior_function.m
@@ -68,12 +68,9 @@ elseif strcmpi(type,'prior')
         else
             error('The prior distributions are not properly set up.')
         end
-        if exist([M_.fname '_prior_restrictions.m'])
-            error('prior_function currently does not support endogenous prior restrictions.')
-            %options_.plot_priors=0;
-            %[~,~,~,~, M_, options_, oo_, ~, ~] = ...
-            %    dynare_estimation_init(M_.endo_names, M_.fname, 1, M_, options_, oo_, estim_params_, bayestopt_);
-        end
+    end
+    if exist([M_.fname '_prior_restrictions.m'])
+        warning('prior_function currently does not support endogenous prior restrictions. They will be ignored. Consider using a prior_function with nobs=1.')
     end
     prior_draw(bayestopt_, options_.prior_trunc);
 else
-- 
GitLab